[clang] [C23] Implement WG14 N3037 (PR #132939)

2025-03-25 Thread Shafik Yaghmour via cfe-commits
@@ -9089,8 +9089,8 @@ bool Sema::hasStructuralCompatLayout(Decl *D, Decl *Suggested) { // FIXME: Add a specific mode for C11 6.2.7/1 in StructuralEquivalenceContext // and isolate from other C++ specific checks. StructuralEquivalenceContext Ctx( - D->getASTContext()

[clang] [C23] Implement WG14 N3037 (PR #132939)

2025-03-25 Thread Shafik Yaghmour via cfe-commits
@@ -1932,8 +1939,9 @@ TEST_F(StructuralEquivalenceCacheTest, VarDeclWithInitNoEq) { Lang_CXX03); StructuralEquivalenceContext Ctx( - get<0>(TU)->getASTContext(), get<1>(TU)->getASTContext(), - NonEquivalentDecls, StructuralEquivalenceKind::Default, false, fa

[clang] [C23] Implement WG14 N3037 (PR #132939)

2025-03-25 Thread Shafik Yaghmour via cfe-commits
@@ -1868,8 +1872,9 @@ TEST_F(StructuralEquivalenceCacheTest, VarDeclNoEq) { Lang_CXX03); StructuralEquivalenceContext Ctx( - get<0>(TU)->getASTContext(), get<1>(TU)->getASTContext(), - NonEquivalentDecls, StructuralEquivalenceKind::Default, false, false); +

[clang] [C23] Implement WG14 N3037 (PR #132939)

2025-03-25 Thread Shafik Yaghmour via cfe-commits
@@ -1826,8 +1828,9 @@ TEST_F(StructuralEquivalenceCacheTest, SimpleNonEq) { Lang_CXX03); StructuralEquivalenceContext Ctx( - get<0>(TU)->getASTContext(), get<1>(TU)->getASTContext(), - NonEquivalentDecls, StructuralEquivalenceKind::Default, false, false); +

[clang] [CIR] Implement lowering of int-to-bool casts (PR #132996)

2025-03-25 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Andy Kaylor (andykaylor) Changes Lowering of int-to-bool casts had been left as NYI because the incubator implemented it by lowering to cir.cmp, which hasn't been upstreamed yet, but there is no reason this cast can't be lowered directly

[clang] [CIR] Implement lowering of int-to-bool casts (PR #132996)

2025-03-25 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clangir Author: Andy Kaylor (andykaylor) Changes Lowering of int-to-bool casts had been left as NYI because the incubator implemented it by lowering to cir.cmp, which hasn't been upstreamed yet, but there is no reason this cast can't be lowered directl

[clang] [clang] fix crash with ADL for member pointers with dependent class (PR #132977)

2025-03-25 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov closed https://github.com/llvm/llvm-project/pull/132977 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [PGO][Offload] Hide GPU entrypoint on Darwin (PR #132966)

2025-03-25 Thread Ethan Luis McDonough via cfe-commits
https://github.com/EthanLuisMcDonough updated https://github.com/llvm/llvm-project/pull/132966 >From e418000ddb31f6df2aa96061bea6fcc56d7b09a9 Mon Sep 17 00:00:00 2001 From: Ethan Luis McDonough Date: Tue, 25 Mar 2025 12:41:59 -0500 Subject: [PATCH 1/2] [PGO][Offload] Hide GPU entrypoint on Darw

[clang] [CIR] Add binary operators (PR #132420)

2025-03-25 Thread Andy Kaylor via cfe-commits
@@ -35,6 +83,22 @@ class ScalarExprEmitter : public StmtVisitor { ScalarExprEmitter(CIRGenFunction &cgf, CIRGenBuilderTy &builder) : cgf(cgf), builder(builder) {} + //======// + //

[clang] [CIR] [Upstream local initialization for ArrayType (PR #132974)

2025-03-25 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes commented: I have only minor inline comments, good direction. The PR is a bit big but I can see this requires touching everywhere in CIRGen and also LLVM lowering support, which is good end-to-end testing. If there are things there are not needed right now, it'

[clang] [CIR] [Upstream local initialization for ArrayType (PR #132974)

2025-03-25 Thread Bruno Cardoso Lopes via cfe-commits
@@ -32,6 +32,16 @@ class CIRBaseBuilderTy : public mlir::OpBuilder { return create(loc, attr.getType(), attr); } + cir::ConstantOp getConstantInt(mlir::Location loc, mlir::Type ty, + int64_t value) { +return create(loc, ty, cir::IntAt

[clang] [CIR] [Upstream local initialization for ArrayType (PR #132974)

2025-03-25 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes edited https://github.com/llvm/llvm-project/pull/132974 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] [Upstream local initialization for ArrayType (PR #132974)

2025-03-25 Thread Bruno Cardoso Lopes via cfe-commits
@@ -229,6 +236,40 @@ def CastOp : CIR_Op<"cast", let hasFolder = 1; } + +//===--===// +// PtrStrideOp +//===--===// + +def PtrStrideOp : CI

[clang] [Driver] Enable LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON on AIX. (PR #132821)

2025-03-25 Thread Louis Dionne via cfe-commits
https://github.com/ldionne commented: I think this should also impact the set of headers being searched. On per-target runtimes, I think we look for libc++ headers under `include/c++/v1/` in addition to `include/c++/v1` (since that's where `__config_site` ends up)? I'm not super familiar with

[clang] [CIR] [Upstream local initialization for ArrayType (PR #132974)

2025-03-25 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Amr Hesham (AmrDeveloper) Changes This change adds local initialization for ArrayType Issue #130197 --- Patch is 59.03 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/132974.diff 25 Files Aff

[clang] [CIR] [Upstream local initialization for ArrayType (PR #132974)

2025-03-25 Thread Andy Kaylor via cfe-commits
@@ -0,0 +1,150 @@ +//- LoweringHelpers.cpp - Lowering helper functions ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [CIR] [Upstream local initialization for ArrayType (PR #132974)

2025-03-25 Thread Andy Kaylor via cfe-commits
@@ -246,8 +246,8 @@ OpFoldResult cir::ConstantOp::fold(FoldAdaptor /*adaptor*/) { //===--===// LogicalResult cir::CastOp::verify() { - auto resType = getResult().getType(); - auto srcType = getSrc().getTyp

[clang] [CIR] [Upstream local initialization for ArrayType (PR #132974)

2025-03-25 Thread Andy Kaylor via cfe-commits
@@ -540,6 +542,68 @@ mlir::LogicalResult CIRToLLVMCastOpLowering::matchAndRewrite( return mlir::success(); } +mlir::LogicalResult CIRToLLVMPtrStrideOpLowering::matchAndRewrite( +cir::PtrStrideOp ptrStrideOp, OpAdaptor adaptor, +mlir::ConversionPatternRewriter &rewri

[clang] [clang-tools-extra] Reland: [clang] NFC: Clear some uses of MemberPointerType::getClass (PR #132317)

2025-03-25 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: You mean crashes caused by this fix, or do you mean crashes not fixed by it? In any case, I won't be available to revert anything until tomorrow. You can go ahead and revert, but I am afraid it won't be straightforward. https://github.com/llvm/llvm-project/pull/132317 _

[clang] [clang-tools-extra] Reland: [clang] NFC: Clear some uses of MemberPointerType::getClass (PR #132317)

2025-03-25 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: If you do revert, please avoid reverting tests if possible. https://github.com/llvm/llvm-project/pull/132317 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][Driver][HIP] Fix mixing `amdgcnspirv` and `gfxXXX` via `--offload-arch` (PR #133024)

2025-03-25 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver Author: Alex Voicu (AlexVlx) Changes Due to `amdgcnspirv` piggybacking on the HIPAMDToolchain, it loses its immediately apparent SPIR-Vness, which makes the Driver want to go all the way to Assembly emmission. This was problematic as we we

[clang] [CIR] [Upstream local initialization for ArrayType (PR #132974)

2025-03-25 Thread Andy Kaylor via cfe-commits
@@ -254,3 +254,27 @@ mlir::Type CIRGenTypes::convertTypeForMem(clang::QualType qualType, return convertedType; } + +bool CIRGenTypes::isZeroInitializable(clang::QualType t) { + if (t->getAs()) +return astContext.getTargetNullPointerValue(t) == 0; + + if (const auto *a

[clang] [CIR] [Upstream local initialization for ArrayType (PR #132974)

2025-03-25 Thread Andy Kaylor via cfe-commits
@@ -412,3 +412,26 @@ mlir::Attribute ConstantEmitter::tryEmitPrivate(const APValue &value, } llvm_unreachable("Unknown APValue kind"); } + +mlir::Value CIRGenModule::emitNullConstant(QualType t, mlir::Location loc) { + if (t->getAs()) { +return builder.getNullPtr(getT

[clang] [CIR] [Upstream local initialization for ArrayType (PR #132974)

2025-03-25 Thread Andy Kaylor via cfe-commits
@@ -0,0 +1,273 @@ +//===--- CIRGenExprAgg.cpp - Emit CIR Code from Aggregate Expressions -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [CIR] [Upstream local initialization for ArrayType (PR #132974)

2025-03-25 Thread Andy Kaylor via cfe-commits
@@ -0,0 +1,273 @@ +//===--- CIRGenExprAgg.cpp - Emit CIR Code from Aggregate Expressions -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [CIR] [Upstream local initialization for ArrayType (PR #132974)

2025-03-25 Thread Andy Kaylor via cfe-commits
@@ -113,6 +113,11 @@ class CIRGenModule : public CIRGenTypeCache { void emitGlobalVarDefinition(const clang::VarDecl *vd, bool isTentative = false); + // Return the result of value-initializing the given type, i.e. a null + /// expression of

[clang] [CIR] [Upstream local initialization for ArrayType (PR #132974)

2025-03-25 Thread Andy Kaylor via cfe-commits
@@ -449,4 +449,48 @@ LValue CIRGenFunction::emitLValue(const Expr *e) { } } +void CIRGenFunction::emitNullInitialization(mlir::Location loc, Address destPtr, +QualType ty) { + // Ignore empty classes in C++. + if (getLangOpts().

[clang] [CIR] [Upstream local initialization for ArrayType (PR #132974)

2025-03-25 Thread Andy Kaylor via cfe-commits
@@ -449,4 +449,48 @@ LValue CIRGenFunction::emitLValue(const Expr *e) { } } +void CIRGenFunction::emitNullInitialization(mlir::Location loc, Address destPtr, +QualType ty) { + // Ignore empty classes in C++. + if (getLangOpts().

[clang] [CIR] [Upstream local initialization for ArrayType (PR #132974)

2025-03-25 Thread Andy Kaylor via cfe-commits
@@ -196,6 +196,21 @@ class CIRToLLVMTrapOpLowering : public mlir::OpConversionPattern { mlir::ConversionPatternRewriter &) const override; }; +class CIRToLLVMPtrStrideOpLowering +: public mlir::OpConversionPattern { + mlir::DataLayout const &dataLayout;

[clang] [CIR] [Upstream local initialization for ArrayType (PR #132974)

2025-03-25 Thread Andy Kaylor via cfe-commits
@@ -620,6 +684,28 @@ mlir::LogicalResult CIRToLLVMStoreOpLowering::matchAndRewrite( return mlir::LogicalResult::success(); } +/// Switches on the type of attribute and calls the appropriate conversion. +mlir::Value lowerCirAttrAsValue(mlir::Operation *parentOp, +

[clang] [CIR] [Upstream local initialization for ArrayType (PR #132974)

2025-03-25 Thread Andy Kaylor via cfe-commits
@@ -658,6 +744,27 @@ mlir::LogicalResult CIRToLLVMConstantOpLowering::matchAndRewrite( } assert(!cir::MissingFeatures::opGlobalViewAttr()); attr = op.getValue(); + } else if (const auto arrTy = mlir::dyn_cast(op.getType())) { +const auto constArr = mlir::dyn_c

[clang] [CIR] [Upstream local initialization for ArrayType (PR #132974)

2025-03-25 Thread Andy Kaylor via cfe-commits
@@ -540,6 +542,68 @@ mlir::LogicalResult CIRToLLVMCastOpLowering::matchAndRewrite( return mlir::success(); } +mlir::LogicalResult CIRToLLVMPtrStrideOpLowering::matchAndRewrite( +cir::PtrStrideOp ptrStrideOp, OpAdaptor adaptor, +mlir::ConversionPatternRewriter &rewri

[clang] [CIR] [Upstream local initialization for ArrayType (PR #132974)

2025-03-25 Thread Andy Kaylor via cfe-commits
@@ -412,3 +412,26 @@ mlir::Attribute ConstantEmitter::tryEmitPrivate(const APValue &value, } llvm_unreachable("Unknown APValue kind"); } + +mlir::Value CIRGenModule::emitNullConstant(QualType t, mlir::Location loc) { + if (t->getAs()) { +return builder.getNullPtr(getT

[clang] [CIR] [Upstream local initialization for ArrayType (PR #132974)

2025-03-25 Thread Andy Kaylor via cfe-commits
@@ -0,0 +1,150 @@ +//- LoweringHelpers.cpp - Lowering helper functions ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [CIR] [Upstream local initialization for ArrayType (PR #132974)

2025-03-25 Thread Andy Kaylor via cfe-commits
@@ -620,6 +684,28 @@ mlir::LogicalResult CIRToLLVMStoreOpLowering::matchAndRewrite( return mlir::LogicalResult::success(); } +/// Switches on the type of attribute and calls the appropriate conversion. +mlir::Value lowerCirAttrAsValue(mlir::Operation *parentOp, +

[clang] [NFC][Driver][HIP] Fix mixing `amdgcnspirv` and `gfxXXX` via `--offload-arch` (PR #133024)

2025-03-25 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx created https://github.com/llvm/llvm-project/pull/133024 Due to `amdgcnspirv` piggybacking on the HIPAMDToolchain, it loses its immediately apparent SPIR-Vness, which makes the Driver want to go all the way to Assembly emmission. This was problematic as we were tryin

[clang] [llvm] [HLSL] Implement the `smoothstep` intrinsic (PR #132288)

2025-03-25 Thread Kaitlin Peng via cfe-commits
@@ -101,6 +101,52 @@ bool SemaSPIRV::CheckSPIRVBuiltinFunctionCall(unsigned BuiltinID, TheCall->setType(RetTy); break; } + case SPIRV::BI__builtin_spirv_smoothstep: { +if (SemaRef.checkArgCount(TheCall, 3)) + return true; + +// check if the all argument

[clang] [CIR] [Upstream local initialization for ArrayType (PR #132974)

2025-03-25 Thread Andy Kaylor via cfe-commits
@@ -0,0 +1,273 @@ +//===--- CIRGenExprAgg.cpp - Emit CIR Code from Aggregate Expressions -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [NFC][Driver][HIP] Fix mixing `amdgcnspirv` and `gfxXXX` via `--offload-arch` (PR #133024)

2025-03-25 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Alex Voicu (AlexVlx) Changes Due to `amdgcnspirv` piggybacking on the HIPAMDToolchain, it loses its immediately apparent SPIR-Vness, which makes the Driver want to go all the way to Assembly emmission. This was problematic as we were tryi

[clang] [CIR] [Upstream local initialization for ArrayType (PR #132974)

2025-03-25 Thread Andy Kaylor via cfe-commits
@@ -0,0 +1,273 @@ +//===--- CIRGenExprAgg.cpp - Emit CIR Code from Aggregate Expressions -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [llvm] cuda clang: Fix argument order for __reduce_max_sync (PR #132881)

2025-03-25 Thread Artem Belevich via cfe-commits
https://github.com/Artem-B approved this pull request. https://github.com/llvm/llvm-project/pull/132881 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-doc] [feat] add --repository-line-prefix argument (PR #131280)

2025-03-25 Thread Mohamed Emad via cfe-commits
hulxv wrote: Should I modify `HTMLGeneratorTest.cpp` to test `RepositoryLinePrefix`? https://github.com/llvm/llvm-project/blob/7a370748c0928b9ccfe26127e54eb3c1a1827d75/clang-tools-extra/unittests/clang-doc/HTMLGeneratorTest.cpp#L179 https://github.com/llvm/llvm-project/pull/131280 __

[clang] [CIR] [Upstream local initialization for ArrayType (PR #132974)

2025-03-25 Thread Andy Kaylor via cfe-commits
andykaylor wrote: > I already removed some parts like TypeSizeInfoAttr and AddrSpace before > creating the PR for that reason, I will double check again if I can remove > anything else I'm not sure it's worth splitting up now, but you probably could have implemented the zero-initialization ca

[clang] [Clang] Consider preferred_type in bitfield warnings (#116760) (PR #116785)

2025-03-25 Thread Oliver Hunt via cfe-commits
@@ -6404,20 +6404,23 @@ def warn_bitfield_width_exceeds_type_width: Warning< def err_bitfield_too_wide : Error< "%select{bit-field %1|anonymous bit-field}0 is too wide (%2 bits)">; def warn_bitfield_too_small_for_enum : Warning< - "bit-field %0 is not wide enough to store al

[clang] [compiler-rt] [PGO][Offload] Hide GPU entrypoint on Darwin (PR #132966)

2025-03-25 Thread Joseph Huber via cfe-commits
@@ -1273,13 +1273,11 @@ COMPILER_RT_VISIBILITY int __llvm_profile_set_file_object(FILE *File, return 0; } -int __llvm_write_custom_profile(const char *Target, -const __llvm_profile_data *DataBegin, -const __llv

[clang-tools-extra] [clang-doc] [feat] add --repository-line-prefix argument (PR #131280)

2025-03-25 Thread Mohamed Emad via cfe-commits
https://github.com/hulxv updated https://github.com/llvm/llvm-project/pull/131280 >From bf9bd4156cb7f652c9cf0477f537e5c58b470448 Mon Sep 17 00:00:00 2001 From: hulxv Date: Fri, 14 Mar 2025 07:39:15 +0200 Subject: [PATCH 01/15] [clang-doc] [feat] add `--repository-line-prefix` argument (fix #59

[clang] [llvm] [RISCV][WIP] Add assembler support for Zvma (PR #132965)

2025-03-25 Thread Craig Topper via cfe-commits
topperc wrote: SiFive has patches for this we are planning to post soon. https://github.com/llvm/llvm-project/pull/132965 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 53fa289 - [clang] Remove unused member variable from ModuleMap

2025-03-25 Thread Michael Spencer via cfe-commits
Author: Michael Spencer Date: 2025-03-25T10:58:44-07:00 New Revision: 53fa28940e0a3ef183e04dd8bc8566d64bbfd101 URL: https://github.com/llvm/llvm-project/commit/53fa28940e0a3ef183e04dd8bc8566d64bbfd101 DIFF: https://github.com/llvm/llvm-project/commit/53fa28940e0a3ef183e04dd8bc8566d64bbfd101.dif

[clang] [compiler-rt] [llvm] [FMV][AArch64] Add feature CSSC and detect on linux platform. (PR #132727)

2025-03-25 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea updated https://github.com/llvm/llvm-project/pull/132727 >From b61d23aa9950d24ca88780fbcc08935447e987fd Mon Sep 17 00:00:00 2001 From: Alexandros Lamprineas Date: Mon, 24 Mar 2025 12:15:58 + Subject: [PATCH] [FMV][AArch64] Add feature CSSC and detect on linux pla

[clang] [HLSL][RootSignature] Make Root Signature lexer keywords case-insensitive (PR #132967)

2025-03-25 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Finn Plummer (inbelic) Changes >From the corrections to the Root Signature specification here: >https://github.com/llvm/wg-hlsl/issues/192. It was denoted that keywords are >also case-insensitive in DXC. This pr adjusts the lexer to adhe

[clang] [Docs] Document freestanding requirements (PR #132232)

2025-03-25 Thread Joseph Huber via cfe-commits
@@ -1073,6 +1073,28 @@ inputs. Here is some example of ``$``-prefixed options: Language and Target-Independent Features +Freestanding Builds +--- +Passing the ``-ffreestanding`` flag causes Clang to build for a freestand

[clang] [clang][DepScan] Allow ModuleDep to be const (PR #132968)

2025-03-25 Thread Cyndy Ishida via cfe-commits
https://github.com/cyndyishida created https://github.com/llvm/llvm-project/pull/132968 This type can be exposed from C APIs, where instantiations of this type are not expected to mutate after creation. To support this, mark the lazy computation of build arguments mutable, as that is not inten

[clang-tools-extra] [clang-tidy] do not diagnose array types within implicit instantiations of a template (PR #132924)

2025-03-25 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tidy Author: St. Muench (stmuench) Changes So far, the clang-tidy check `modernize-avoid-c-arrays` also diagnosed array types for type template parameters even though no actual array type got written there but it got deduced to one. In such case,

[clang-tools-extra] [clang-tidy] do not diagnose array types within implicit instantiations of a template (PR #132924)

2025-03-25 Thread St. Muench via cfe-commits
https://github.com/stmuench ready_for_review https://github.com/llvm/llvm-project/pull/132924 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix static_cast bypassing access control (PR #132285)

2025-03-25 Thread via cfe-commits
@@ -1572,13 +1571,12 @@ TryCastResult TryLValueToRValueCast(Sema &Self, Expr *SrcExpr, if (RefConv & Sema::ReferenceConversions::DerivedToBase) { Kind = CK_DerivedToBase; -CXXBasePaths Paths(/*FindAmbiguities=*/true, /*RecordPaths=*/true, - /*D

[clang] [clang] Fix static_cast bypassing access control (PR #132285)

2025-03-25 Thread via cfe-commits
@@ -1572,13 +1571,12 @@ TryCastResult TryLValueToRValueCast(Sema &Self, Expr *SrcExpr, if (RefConv & Sema::ReferenceConversions::DerivedToBase) { Kind = CK_DerivedToBase; -CXXBasePaths Paths(/*FindAmbiguities=*/true, /*RecordPaths=*/true, - /*D

[clang] [clang] Refine handling of C++20 aggregate initialization (PR #131320)

2025-03-25 Thread via cfe-commits
https://github.com/cor3ntin updated https://github.com/llvm/llvm-project/pull/131320 >From 12a50619db5432d479f767724691c306aa289ce2 Mon Sep 17 00:00:00 2001 From: offsetof Date: Sun, 16 Mar 2025 09:59:44 + Subject: [PATCH] [clang] Refine handling of C++20 aggregate initialization * Move pa

[clang] [clang][DepScan] Allow ModuleDep to be const (PR #132968)

2025-03-25 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Cyndy Ishida (cyndyishida) Changes This type can be exposed from C APIs, where instantiations of this type are not expected to mutate after creation. To support this, mark the lazy computation of build arguments mutable, as that is not in

[clang] [clang-tools-extra] [clang] Consistently use "load" to refer to populating clang::ModuleMap (PR #132970)

2025-03-25 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese created https://github.com/llvm/llvm-project/pull/132970 Now that we have ModuleMapFile.cpp which parses module maps, it's confusing what ModuleMap::parseModuleMapFile actually does. HeaderSearch already called this loading a module map, so consistently use that te

[clang] [clang][modules] Lazily load by name lookups in module maps (PR #132853)

2025-03-25 Thread Michael Spencer via cfe-commits
@@ -1801,6 +1801,33 @@ HeaderSearch::loadModuleMapFileImpl(FileEntryRef File, bool IsSystem, return LMM_NewlyLoaded; } +HeaderSearch::LoadModuleMapResult +HeaderSearch::parseModuleMapFileImpl(FileEntryRef File, bool IsSystem, Bigcheese wrote: https://githu

[clang] [clang-tools-extra] [clang] Consistently use "load" to refer to populating clang::ModuleMap (PR #132970)

2025-03-25 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 53fa28940e0a3ef183e04dd8bc8566d64bbfd101 985af1dfe88121beafad2c4eb976c685c6ea6d9c --e

[clang] [llvm] [HLSL] Implement the `smoothstep` intrinsic (PR #132288)

2025-03-25 Thread Kaitlin Peng via cfe-commits
https://github.com/kmpeng updated https://github.com/llvm/llvm-project/pull/132288 >From 0a5da660c5aae053d87d556e59f98c121d916b79 Mon Sep 17 00:00:00 2001 From: kmpeng Date: Tue, 18 Mar 2025 13:25:10 -0700 Subject: [PATCH 1/8] create int_spv_smoothstep intrinsic, create smoothstep lowering & m

[clang] [compiler-rt] [PGO][Offload] Hide GPU entrypoint on Darwin (PR #132966)

2025-03-25 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 commented: It worked before your patch right? Is this what it exposed before then? https://github.com/llvm/llvm-project/pull/132966 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailma

[clang] [HLSL][RootSignature] Make Root Signature lexer keywords case-insensitive (PR #132967)

2025-03-25 Thread Finn Plummer via cfe-commits
https://github.com/inbelic created https://github.com/llvm/llvm-project/pull/132967 >From the corrections to the Root Signature specification here: >https://github.com/llvm/wg-hlsl/issues/192. It was denoted that keywords are >also case-insensitive in DXC. This pr adjusts the lexer to adhere

[libclc] [libclc] Move log1p/asinh/acosh to the CLC library (PR #132956)

2025-03-25 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/132956 >From 490f34c8fa49666cc4e7af228f71908f6102d76a Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Tue, 25 Mar 2025 13:06:05 + Subject: [PATCH 1/3] [libclc] Move log1p/asinh/acosh to the CLC library The

[clang] [clang] Fix static_cast bypassing access control (PR #132285)

2025-03-25 Thread Shafik Yaghmour via cfe-commits
@@ -1572,13 +1571,12 @@ TryCastResult TryLValueToRValueCast(Sema &Self, Expr *SrcExpr, if (RefConv & Sema::ReferenceConversions::DerivedToBase) { Kind = CK_DerivedToBase; -CXXBasePaths Paths(/*FindAmbiguities=*/true, /*RecordPaths=*/true, - /*D

[clang] [clang] Fix static_cast bypassing access control (PR #132285)

2025-03-25 Thread Shafik Yaghmour via cfe-commits
@@ -23,3 +22,66 @@ void test(A &a, B &b) { const A &&ar10 = static_cast(xvalue()); const A &&ar11 = static_cast(xvalue()); } + +struct C : private A { // expected-note 4 {{declared private here}} shafik wrote: Normally when we add tests to an existing file

[clang] [clang-tools-extra] [clang][lex] Store non-owning options ref in `HeaderSearch` (PR #132780)

2025-03-25 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese approved this pull request. There's no point in having vague ownership here, so this lgtm. https://github.com/llvm/llvm-project/pull/132780 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-

[clang-tools-extra] [clang-tidy] do not diagnose array types within implicit instantiations of a template (PR #132924)

2025-03-25 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tools-extra Author: St. Muench (stmuench) Changes So far, the clang-tidy check `modernize-avoid-c-arrays` also diagnosed array types for type template parameters even though no actual array type got written there but it got deduced to one. In suc

[clang] [clang][DependencyScanning] Track dependencies from prebuilt modules to determine IsInStableDir (PR #132237)

2025-03-25 Thread Jan Svoboda via cfe-commits
@@ -5834,9 +5834,13 @@ bool ASTReader::readASTFileControlBlock( break; case INPUT_FILE: bool Overridden = static_cast(Record[3]); + size_t FilenameLen = ModuleDir.size() + Record[7] + 1; auto Filename = ResolveImportedPath(PathBuf

[clang] [CIR] Add binary operators (PR #132420)

2025-03-25 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor commented: This looks good to me except for a few nits and the need to defer the ASTContext refactoring change. https://github.com/llvm/llvm-project/pull/132420 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http

[clang] [CIR] [Upstream local initialization for ArrayType (PR #132974)

2025-03-25 Thread Henrich Lauko via cfe-commits
@@ -229,6 +236,43 @@ def CastOp : CIR_Op<"cast", let hasFolder = 1; } + +//===--===// +// PtrStrideOp +//===--===// + +def PtrStrideOp : CI

[clang] [RFC] Initial implementation of P2719 (PR #113510)

2025-03-25 Thread Oliver Hunt via cfe-commits
@@ -2533,9 +2533,43 @@ bool CXXMethodDecl::isUsualDeallocationFunction( getOverloadedOperator() != OO_Array_Delete) ojhunt wrote: *adding the new accessors and adopting them https://github.com/llvm/llvm-project/pull/113510

[clang] [clang-tools-extra] Reland: [clang] NFC: Clear some uses of MemberPointerType::getClass (PR #132317)

2025-03-25 Thread Alexander Kornienko via cfe-commits
alexfh wrote: > @alexfh thanks, this will be fixed here: #132977 We see more clang crashes after #132977 / 960615954e4cb3150ae4a479fa7f9d0d17035eea. I'll start a reduction and will post a new test case, but please revert #132977 and this commit. https://github.com/llvm/llvm-project/pull/13231

[clang] [Clang] Introduce a trait to determine the structure binding size (PR #131515)

2025-03-25 Thread Erich Keane via cfe-commits
erichkeane wrote: See: https://github.com/llvm/llvm-project/pull/132091 https://github.com/llvm/llvm-project/pull/131515 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver] Enable LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON on AIX. (PR #132821)

2025-03-25 Thread Louis Dionne via cfe-commits
https://github.com/ldionne commented: I don't have comment on the diff but I think it's great that AIX is moving towards the mechanism that we want to use for all targets! https://github.com/llvm/llvm-project/pull/132821 ___ cfe-commits mailing list c

[clang] [C23] Implement WG14 N3037 (PR #132939)

2025-03-25 Thread Shafik Yaghmour via cfe-commits
@@ -1964,8 +1972,9 @@ TEST_F(StructuralEquivalenceCacheTest, SpecialNonEq) { Lang_CXX03); StructuralEquivalenceContext Ctx( - get<0>(TU)->getASTContext(), get<1>(TU)->getASTContext(), - NonEquivalentDecls, StructuralEquivalenceKind::Default, false, false); +

[clang] [HLSL] Add new double overloads for math builtins (PR #132979)

2025-03-25 Thread Sarah Spall via cfe-commits
https://github.com/spall updated https://github.com/llvm/llvm-project/pull/132979 >From 5facb02ef4df5e0da31b6adef66f0b72309b99df Mon Sep 17 00:00:00 2001 From: Sarah Spall Date: Mon, 24 Mar 2025 17:15:54 -0700 Subject: [PATCH 1/5] new double overloads + tests --- clang/lib/Frontend/InitPrepro

[clang] [llvm] [HLSL] Implement the `smoothstep` intrinsic (PR #132288)

2025-03-25 Thread Farzon Lotfi via cfe-commits
@@ -101,6 +101,52 @@ bool SemaSPIRV::CheckSPIRVBuiltinFunctionCall(unsigned BuiltinID, TheCall->setType(RetTy); break; } + case SPIRV::BI__builtin_spirv_smoothstep: { +if (SemaRef.checkArgCount(TheCall, 3)) + return true; + +// check if the all argument

[clang] [CIR] Remove failing binop test (PR #133001)

2025-03-25 Thread Andy Kaylor via cfe-commits
andykaylor wrote: @mmha I missed one thing in your binop PR. https://github.com/llvm/llvm-project/pull/133001 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Implement the `smoothstep` intrinsic (PR #132288)

2025-03-25 Thread Kaitlin Peng via cfe-commits
@@ -0,0 +1,183 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5 +// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \ +// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \ +// RUN: -emit-llvm -O1 -o - |

[clang-tools-extra] 57f2e76 - [clang] Consistently use "load" to refer to populating clang::ModuleMap (#132970)

2025-03-25 Thread via cfe-commits
Author: Michael Spencer Date: 2025-03-25T12:32:58-07:00 New Revision: 57f2e76e3010e7b089ebc5dd96aef5966f13b6c5 URL: https://github.com/llvm/llvm-project/commit/57f2e76e3010e7b089ebc5dd96aef5966f13b6c5 DIFF: https://github.com/llvm/llvm-project/commit/57f2e76e3010e7b089ebc5dd96aef5966f13b6c5.dif

[clang] [clang] Placement new error when modifying consts (PR #132460)

2025-03-25 Thread via cfe-commits
github-actions[bot] wrote: @mariusdr Congratulations on having your first Pull Request (PR) merged into the LLVM Project! Your changes will be combined with recent changes from other authors, then tested by our [build bots](https://lab.llvm.org/buildbot/). If there is a problem with a build

[clang] [CodeGen][NFC] Run SROA on complex range tests (PR #131925)

2025-03-25 Thread Mészáros Gergely via cfe-commits
https://github.com/Maetveis edited https://github.com/llvm/llvm-project/pull/131925 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RFC] Initial implementation of P2719 (PR #113510)

2025-03-25 Thread Oliver Hunt via cfe-commits
@@ -3503,9 +3518,23 @@ bool FunctionDecl::isDestroyingOperatorDelete() const { getNumParams() < 2) return false; - auto *RD = getParamDecl(1)->getType()->getAsCXXRecordDecl(); - return RD && RD->isInStdNamespace() && RD->getIdentifier() && - RD->getIdentifi

[clang] 2f3c937 - [CIR] Add binary operators (#132420)

2025-03-25 Thread via cfe-commits
Author: Morris Hafner Date: 2025-03-25T14:12:27-07:00 New Revision: 2f3c93743fc21686158c9ba51da8f25da9a02f9d URL: https://github.com/llvm/llvm-project/commit/2f3c93743fc21686158c9ba51da8f25da9a02f9d DIFF: https://github.com/llvm/llvm-project/commit/2f3c93743fc21686158c9ba51da8f25da9a02f9d.diff

[clang] [compiler-rt] [llvm] [FMV][AArch64] Add feature CSSC and detect on linux platform. (PR #132727)

2025-03-25 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea updated https://github.com/llvm/llvm-project/pull/132727 >From b61d23aa9950d24ca88780fbcc08935447e987fd Mon Sep 17 00:00:00 2001 From: Alexandros Lamprineas Date: Mon, 24 Mar 2025 12:15:58 + Subject: [PATCH] [FMV][AArch64] Add feature CSSC and detect on linux pla

[clang] 9606159 - [clang] fix crash with ADL for member pointers with dependent class (#132977)

2025-03-25 Thread via cfe-commits
Author: Matheus Izvekov Date: 2025-03-25T18:15:55-03:00 New Revision: 960615954e4cb3150ae4a479fa7f9d0d17035eea URL: https://github.com/llvm/llvm-project/commit/960615954e4cb3150ae4a479fa7f9d0d17035eea DIFF: https://github.com/llvm/llvm-project/commit/960615954e4cb3150ae4a479fa7f9d0d17035eea.dif

[clang] [RFC] Initial implementation of P2719 (PR #113510)

2025-03-25 Thread via cfe-commits
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/113510 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reapply "[clang][bytecode] Implement __builtin_{wcscmp,wcsncmp} (#132… (PR #132963)

2025-03-25 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/132963 …723)" This reverts commit 1e2ad6793ac205607e7c809283cf69e1cc36a69a. Fix the previous commit on big-endian hosts by _not_ falling through to the `uint8_t` code path. >From 0e0e60b041eea2e2561c072d62c5160ff

[clang] [clang] fix crash with ADL for member pointers with dependent class (PR #132977)

2025-03-25 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/132977 Fix crash when looking up associated namespaces for member pointers with an unknown class, due to dependency. It was a regression introduced in https://github.com/llvm/llvm-project/pull/131965 and reported he

[clang] [clang] fix crash with ADL for member pointers with dependent class (PR #132977)

2025-03-25 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Matheus Izvekov (mizvekov) Changes Fix crash when looking up associated namespaces for member pointers with an unknown class, due to dependency. It was a regression introduced in https://github.com/llvm/llvm-project/pull/131965 and repor

[clang] [llvm] [HLSL] Implement the `smoothstep` intrinsic (PR #132288)

2025-03-25 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl edited https://github.com/llvm/llvm-project/pull/132288 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] Reland: [clang] NFC: Clear some uses of MemberPointerType::getClass (PR #132317)

2025-03-25 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: @alexfh thanks, this will be fixed here: https://github.com/llvm/llvm-project/pull/132977 https://github.com/llvm/llvm-project/pull/132317 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/l

[clang] [clang] Do not share ownership of `HeaderSearchOptions` (PR #132984)

2025-03-25 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/132984 This PR makes it so that `CompilerInvocation` is the sole owner of the `HeaderSearchOptions` instance. >From b325e5553bafa3b83e3383cd38487f42eecce91b Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Tue,

[clang] [clang] Do not share ownership of `HeaderSearchOptions` (PR #132984)

2025-03-25 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Jan Svoboda (jansvoboda11) Changes This PR makes it so that `CompilerInvocation` is the sole owner of the `HeaderSearchOptions` instance. --- Full diff: https://github.com/llvm/llvm-project/pull/132984.diff 11 Files Affected: - (modifi

[clang] [RFC] Initial implementation of P2719 (PR #113510)

2025-03-25 Thread via cfe-commits
https://github.com/cor3ntin commented: > *[Reviewable](https://reviewable.io/reviews/llvm/llvm-project/113510)* > status: 0 of 54 files reviewed, 119 unresolved discussions (waiting on > @AaronBallman, @Bigcheese, @ChuanqiXu9, @efriedma-quic, @erichkeane, > @mizvekov, @ogiroux, @ojhunt, @Sir

[clang] [clang] Do not share ownership of `HeaderSearchOptions` (PR #132984)

2025-03-25 Thread Jan Svoboda via cfe-commits
@@ -269,9 +269,6 @@ class CompilerInvocation : public CompilerInvocationBase { /// @{ using CompilerInvocationBase::LangOpts; using CompilerInvocationBase::TargetOpts; - std::shared_ptr getHeaderSearchOptsPtr() { -return HSOpts; - } jansvoboda11 wro

[clang] [clang] Do not share ownership of `HeaderSearchOptions` (PR #132984)

2025-03-25 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 7a370748c0928b9ccfe26127e54eb3c1a1827d75 b325e5553bafa3b83e3383cd38487f42eecce91b --e

[clang] [RFC] Initial implementation of P2719 (PR #113510)

2025-03-25 Thread Oliver Hunt via cfe-commits
@@ -9817,27 +9817,54 @@ def err_operator_new_delete_invalid_result_type : Error< def err_operator_new_delete_dependent_result_type : Error< "%0 cannot have a dependent return type; use %1 instead">; def err_operator_new_delete_too_few_parameters : Error< - "%0 must have at l

<    1   2   3   4   5   6   >