[clang] Support [[guarded_by(mutex)]] attribute inside C struct (PR #94216)

2024-06-04 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/94216 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Support [[guarded_by(mutex)]] attribute inside C struct (PR #94216)

2024-06-04 Thread Aaron Ballman via cfe-commits
@@ -3330,6 +3340,63 @@ void Parser::DistributeCLateParsedAttrs(Decl *Dcl, } } +/// GuardedBy attributes (e.g., guarded_by): +/// AttrName '(' expression ')' +void Parser::ParseGuardedByAttribute(IdentifierInfo &AttrName, + SourceLocation

[clang] Support [[guarded_by(mutex)]] attribute inside C struct (PR #94216)

2024-06-04 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Thank you for working on this! The changes should come with a release note in clang/docs/ReleaseNotes.rst so users know about the new functionality. One question I have is whether there will be follow-up work for other thread safety attributes (`acqu

[clang] Support [[guarded_by(mutex)]] attribute inside C struct (PR #94216)

2024-06-04 Thread Aaron Ballman via cfe-commits
@@ -3330,6 +3340,63 @@ void Parser::DistributeCLateParsedAttrs(Decl *Dcl, } } +/// GuardedBy attributes (e.g., guarded_by): +/// AttrName '(' expression ')' +void Parser::ParseGuardedByAttribute(IdentifierInfo &AttrName, + SourceLocation

[clang] Support [[guarded_by(mutex)]] attribute inside C struct (PR #94216)

2024-06-04 Thread Aaron Ballman via cfe-commits
@@ -671,6 +671,16 @@ void Parser::ParseGNUAttributeArgs( ParseBoundsAttribute(*AttrName, AttrNameLoc, Attrs, ScopeName, ScopeLoc, Form); return; + } else if (AttrKind == ParsedAttr::AT_GuardedBy) { +ParseGuardedByAttribute(*AttrName, AttrNa

[clang] 5ae5774 - [Sema] Fix handling of fields with initializers in nested anonymous unions. (#91692)

2024-06-04 Thread via cfe-commits
Author: Eli Friedman Date: 2024-06-04T09:24:44-07:00 New Revision: 5ae5774fb0b5cac11af479b0905dfdd5255b4047 URL: https://github.com/llvm/llvm-project/commit/5ae5774fb0b5cac11af479b0905dfdd5255b4047 DIFF: https://github.com/llvm/llvm-project/commit/5ae5774fb0b5cac11af479b0905dfdd5255b4047.diff

[clang] [Sema] Fix handling of fields with initializers in nested anonymous unions. (PR #91692)

2024-06-04 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic closed https://github.com/llvm/llvm-project/pull/91692 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AMDGPU] Use `I` to decorate imm argument for `__builtin_amdgcn_global_load_lds` (PR #94376)

2024-06-04 Thread Shilei Tian via cfe-commits
https://github.com/shiltian created https://github.com/llvm/llvm-project/pull/94376 None >From d974ef91f988f803e5904d4b922e8b65390d16a0 Mon Sep 17 00:00:00 2001 From: Shilei Tian Date: Tue, 4 Jun 2024 12:26:32 -0400 Subject: [PATCH] [Clang][AMDGPU] Use `I` to decorate imm argument for `__buil

[clang] [Clang][AMDGPU] Use `I` to decorate imm argument for `__builtin_amdgcn_global_load_lds` (PR #94376)

2024-06-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-amdgpu Author: Shilei Tian (shiltian) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/94376.diff 3 Files Affected: - (modified) clang/include/clang/Basic/BuiltinsAMDGPU.def (+1-1) - (modified) clang/lib/Sema/SemaAMDGPU.cpp

[clang] [llvm] [AArch64][SME] Save VG for unwind info when changing streaming-mode (PR #83301)

2024-06-04 Thread Eli Friedman via cfe-commits
@@ -8287,6 +8289,13 @@ AArch64TargetLowering::LowerCall(CallLoweringInfo &CLI, SDValue InGlue; if (RequiresSMChange) { + +if (Subtarget->hasSVE()) { efriedma-quic wrote: If there's no DWARF unwind, nothing can unwind the stack whether or not we store

[clang] [clang] Macro for constant rounding mode (PR #92699)

2024-06-04 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff updated https://github.com/llvm/llvm-project/pull/92699 >From f8cd2539fb7f0388d7f3955f58b61b09da03bf0c Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Sun, 19 May 2024 18:43:08 +0700 Subject: [PATCH 1/4] [clang] Macro for constant rounding mode MIME-Version: 1.0 Co

[clang] [Clang] Fix potential null pointer dereferences in Sema::AddInitializerToDecl (PR #94368)

2024-06-04 Thread via cfe-commits
https://github.com/smanna12 updated https://github.com/llvm/llvm-project/pull/94368 >From b6d45ded3d0d1ad6a50a1292d4f8275081089150 Mon Sep 17 00:00:00 2001 From: "Manna, Soumi" Date: Tue, 4 Jun 2024 08:33:51 -0700 Subject: [PATCH 1/3] [Clang] Fix potential null pointer dereferences in Sema::Ad

[clang] Fix spurious availability warning (PR #94377)

2024-06-04 Thread Gábor Horváth via cfe-commits
https://github.com/Xazax-hun created https://github.com/llvm/llvm-project/pull/94377 The availability attributes are stored on the function declarations. The code was looking for them in the function template declarations. This resulted in spuriously diagnosing availablity issues in contexts t

[clang] [llvm] [Inliner] Propagate more attributes to params when inlining (PR #91101)

2024-06-04 Thread via cfe-commits
goldsteinn wrote: ping https://github.com/llvm/llvm-project/pull/91101 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][C++23] update constexpr diagnostics for missing return statements per P2448 (PR #94123)

2024-06-04 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Thank you for working on this! https://github.com/llvm/llvm-project/pull/94123 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][C++23] update constexpr diagnostics for missing return statements per P2448 (PR #94123)

2024-06-04 Thread Aaron Ballman via cfe-commits
@@ -2487,6 +2477,26 @@ static bool CheckConstexprFunctionBody(Sema &SemaRef, const FunctionDecl *Dcl, return true; } +static bool CheckConstexprMissingReturn(Sema &SemaRef, +const FunctionDecl *Dcl) { + bool IsVoidOrDependentType = D

[clang] [Clang][C++23] update constexpr diagnostics for missing return statements per P2448 (PR #94123)

2024-06-04 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,7 @@ +// RUN: %clang_cc1 -Wno-return-type -std=c++23 -fsyntax-only -verify %s +// expected-no-diagnostics +constexpr int f() { } +static_assert(__is_same(decltype([] constexpr -> int { }( )), int)); AaronBallman wrote: For C++23, I think users will hav

[clang] [Clang][C++23] update constexpr diagnostics for missing return statements per P2448 (PR #94123)

2024-06-04 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/94123 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix potential null pointer dereferences in Sema::AddInitializerToDecl (PR #94368)

2024-06-04 Thread via cfe-commits
https://github.com/smanna12 updated https://github.com/llvm/llvm-project/pull/94368 >From b6d45ded3d0d1ad6a50a1292d4f8275081089150 Mon Sep 17 00:00:00 2001 From: "Manna, Soumi" Date: Tue, 4 Jun 2024 08:33:51 -0700 Subject: [PATCH 1/4] [Clang] Fix potential null pointer dereferences in Sema::Ad

[clang] [llvm] [AArch64] set AppleA14 architecture version to v8.4-a (PR #92600)

2024-06-04 Thread Ahmed Bougacha via cfe-commits
@@ -718,12 +718,16 @@ def ProcessorFeatures { list AppleA13 = [HasV8_4aOps, FeatureCrypto, FeatureFPARMv8, FeatureNEON, FeaturePerfMon, FeatureFullFP16, FeatureFP16FML, FeatureSHA3]; + // Apple A14 a

[clang] [Clang] Fix potential null pointer dereferences in Sema::AddInitializerToDecl (PR #94368)

2024-06-04 Thread via cfe-commits
https://github.com/smanna12 edited https://github.com/llvm/llvm-project/pull/94368 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix potential null pointer dereferences in Sema::AddInitializerToDecl (PR #94368)

2024-06-04 Thread via cfe-commits
smanna12 wrote: > Why add the check here rather than add an assertion at the point of > assignation (i.e. > > ``` > Init = Result.getAs(); > ``` > > Since Init is passed into CheckSelfReference on line 13712 where it's > dereferenced the same issue binds there as well Thanks @feg208 for revi

[clang] Reland "[Win32][ELF] Make CodeView a DebugInfoFormat only for COFF format", second try (PR #88245)

2024-06-04 Thread Reid Kleckner via cfe-commits
https://github.com/rnk approved this pull request. Sorry for the delay, looks good! https://github.com/llvm/llvm-project/pull/88245 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reland "[Win32][ELF] Make CodeView a DebugInfoFormat only for COFF format", second try (PR #88245)

2024-06-04 Thread Reid Kleckner via cfe-commits
https://github.com/rnk edited https://github.com/llvm/llvm-project/pull/88245 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reland "[Win32][ELF] Make CodeView a DebugInfoFormat only for COFF format", second try (PR #88245)

2024-06-04 Thread Reid Kleckner via cfe-commits
@@ -5,15 +5,15 @@ // NO_GHASH-NOT: "-gcodeview-ghash" // default -// RUN: %clang_cl /Z7 -### -- %s 2>&1 | FileCheck -check-prefix=NO_GHASH %s +// RUN: %clang_cl -target x86_64-windows /Z7 -### -- %s 2>&1 | FileCheck -check-prefix=NO_GHASH %s // enabled -// RUN: %clang_cl /Z7

[clang] Reland "[Win32][ELF] Make CodeView a DebugInfoFormat only for COFF format", second try (PR #88245)

2024-06-04 Thread Reid Kleckner via cfe-commits
@@ -298,15 +298,15 @@ // FioRACE2: "-E" // FioRACE2: "-o" "foo.x" -// RUN: %clang_cl /Z7 /Foa.obj -### -- %s 2>&1 | FileCheck -check-prefix=ABSOLUTE_OBJPATH %s +// RUN: %clang_cl -target x86_64-windows /Z7 /Foa.obj -### -- %s 2>&1 | FileCheck -check-prefix=ABSOLUTE_OBJPATH %

[clang] [flang] [llvm] [mlir] [Flang]Fix for changed code at the end of AllocaIP. (PR #92430)

2024-06-04 Thread Mats Petersson via cfe-commits
https://github.com/Leporacanthicus updated https://github.com/llvm/llvm-project/pull/92430 >From e08c19ced1b2bcdd4a83ffcd3c5f5656c2021d52 Mon Sep 17 00:00:00 2001 From: Mats Petersson Date: Fri, 19 Apr 2024 18:00:58 +0100 Subject: [PATCH 1/5] Fix for changed code at the end of AllocaIP. Some o

[clang] [Clang] Fix potential null pointer dereferences in Sema::AddInitializerToDecl (PR #94368)

2024-06-04 Thread via cfe-commits
https://github.com/smanna12 edited https://github.com/llvm/llvm-project/pull/94368 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Support [[guarded_by(mutex)]] attribute inside C struct (PR #94216)

2024-06-04 Thread Yeoul Na via cfe-commits
https://github.com/rapidsna commented: You may also want to consider making the attribute late parsed in C when `-fexperimental-late-parse-attributes` is enabled. See https://github.com/llvm/llvm-project/pull/93121/files#diff-ae2ec9524bdbeea1f06917607482634dd89af5bcbb929805032463e5dafe79e7R2260

[clang] Support [[guarded_by(mutex)]] attribute inside C struct (PR #94216)

2024-06-04 Thread Yeoul Na via cfe-commits
https://github.com/rapidsna edited https://github.com/llvm/llvm-project/pull/94216 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Support [[guarded_by(mutex)]] attribute inside C struct (PR #94216)

2024-06-04 Thread Yeoul Na via cfe-commits
@@ -3330,6 +3340,63 @@ void Parser::DistributeCLateParsedAttrs(Decl *Dcl, } } +/// GuardedBy attributes (e.g., guarded_by): +/// AttrName '(' expression ')' +void Parser::ParseGuardedByAttribute(IdentifierInfo &AttrName, + SourceLocation

[clang] [Clang][AArch64] Generalise streaming mode checks for builtins. (PR #93802)

2024-06-04 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm requested changes to this pull request. https://github.com/llvm/llvm-project/pull/93802 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AArch64] Generalise streaming mode checks for builtins. (PR #93802)

2024-06-04 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm edited https://github.com/llvm/llvm-project/pull/93802 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AArch64] Generalise streaming mode checks for builtins. (PR #93802)

2024-06-04 Thread Paul Walker via cfe-commits
@@ -225,7 +225,7 @@ def IsStreamingCompatible : FlagType<0x40>; def IsReadZA: FlagType<0x80>; def IsWriteZA : FlagType<0x100>; def IsReductionQV : FlagType<0x200>; -def Is

[clang] [Clang][AArch64] Generalise streaming mode checks for builtins. (PR #93802)

2024-06-04 Thread Paul Walker via cfe-commits
@@ -561,16 +561,61 @@ SemaARM::ArmStreamingType getArmStreamingFnType(const FunctionDecl *FD) { static void checkArmStreamingBuiltin(Sema &S, CallExpr *TheCall, const FunctionDecl *FD, - SemaARM::ArmStre

[clang] [Clang][AArch64] Generalise streaming mode checks for builtins. (PR #93802)

2024-06-04 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm edited https://github.com/llvm/llvm-project/pull/93802 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Lower _BitInt(129+) to a different type in LLVM IR (PR #91364)

2024-06-04 Thread Mariya Podchishchaeva via cfe-commits
@@ -5348,18 +5348,8 @@ Value *ScalarExprEmitter::VisitVAArgExpr(VAArgExpr *VE) { return llvm::UndefValue::get(ArgTy); } - // FIXME Volatility. - llvm::Value *Val = Builder.CreateLoad(ArgPtr); - - // If EmitVAArg promoted the type, we must truncate it. - if (ArgTy !=

[clang] [clang CodeGen] Restrict return statements nested in return statements. (PR #94282)

2024-06-04 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: You're right, we have issues anytime we construct an object directly into the return value slot, and the check isn't catching all those cases. It shouldn't really be visible to users unless you're constructing an object using a non-trivial constructor... but the codegen i

[clang] Support [[guarded_by(mutex)]] attribute inside C struct (PR #94216)

2024-06-04 Thread Yeoul Na via cfe-commits
@@ -28,7 +28,12 @@ struct LOCKABLE Mutex {}; struct Foo { - struct Mutex *mu_; +struct Mutex *mu_; +struct Bar { +struct Mutex *other_mu; +} bar; + int a_value GUARDED_BY(mu_); rapidsna wrote: Nit: Please check indent https://github.co

[clang] [clang] Lower _BitInt(129+) to a different type in LLVM IR (PR #91364)

2024-06-04 Thread Mariya Podchishchaeva via cfe-commits
@@ -761,6 +761,10 @@ bool ConstStructBuilder::Build(const InitListExpr *ILE, bool AllowOverwrite) { if (Field->hasAttr()) AllowOverwrite = true; } else { + llvm::Type *LoadType = CGM.getTypes().convertTypeForLoadStore( Fznamznon wrote:

[clang] [llvm] Enable LLDB tests in Linux pre-merge CI (PR #94208)

2024-06-04 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > I think it makes a lot of sense for lldb to have a precommit CI pipeline > which tests changes to lldb. I don't think we're at a point where it would > make sense to enable lldb precommit CI testing for changes to clang, though. > > For starters, the false positive rate from

[clang] [clang] Lower _BitInt(129+) to a different type in LLVM IR (PR #91364)

2024-06-04 Thread Mariya Podchishchaeva via cfe-commits
@@ -128,6 +128,15 @@ class CodeGenTypes { /// memory representation is usually i8 or i32, depending on the target. llvm::Type *ConvertTypeForMem(QualType T, bool ForBitField = false); + /// Check that size and abi alignment of given LLVM type matches size and + /// align

[clang] [llvm] [AArch64] Decouple feature dependency expansion. (PR #94279)

2024-06-04 Thread Tomas Matheson via cfe-commits
@@ -250,13 +248,17 @@ void AArch64::ExtensionSet::addArchDefaults(const ArchInfo &Arch) { bool AArch64::ExtensionSet::parseModifier(StringRef Modifier) { LLVM_DEBUG(llvm::dbgs() << "parseModifier(" << Modifier << ")\n"); - bool IsNegated = Modifier.starts_with("no"); - St

[clang] [llvm] [AArch64] Decouple feature dependency expansion. (PR #94279)

2024-06-04 Thread Tomas Matheson via cfe-commits
@@ -13663,17 +13664,18 @@ QualType ASTContext::getCorrespondingSignedFixedPointType(QualType Ty) const { } } -std::vector ASTContext::filterFunctionTargetVersionAttrs( -const TargetVersionAttr *TV) const { - assert(TV != nullptr); - llvm::SmallVector Feats; - std::ve

[clang] [llvm] [AArch64] Decouple feature dependency expansion. (PR #94279)

2024-06-04 Thread Tomas Matheson via cfe-commits
@@ -166,6 +174,11 @@ void AArch64::ExtensionSet::enable(ArchExtKind E) { Touched.set(E); Enabled.set(E); + // These depend on each other, meaning you can't have one without the other. + // We don't want this to be in ExtensionDependencies to avoid infinite loops. + if (

[clang] [llvm] [AArch64] Decouple feature dependency expansion. (PR #94279)

2024-06-04 Thread Tomas Matheson via cfe-commits
@@ -106,7 +106,7 @@ def FeatureFPARMv8 : Extension<"fp-armv8", "FPARMv8", "Enable ARMv8 (FEAT_FP)", [], "FEAT_FP", "+fp-armv8,+neon", 90>; -let ArchExtKindSpelling = "AEK_SIMD", MArchName = "simd" in +let ArchExtKindSpelling = "AEK_SIMD", MArchName = "simd", MArchAlias = "

[clang] [llvm] [AArch64] Decouple feature dependency expansion. (PR #94279)

2024-06-04 Thread Tomas Matheson via cfe-commits
@@ -69,8 +69,8 @@ void undefined(uint32x2_t v2i32, uint32x4_t v4i32, uint16x8_t v8i16, uint8x16_t vrnd_f16(v4f16); // expected-error {{always_inline function 'vrnd_f16' requires target feature 'fullfp16'}} vmaxnm_f16(v4f16, v4f16); // expected-error {{always_inline functio

[clang] [llvm] [AArch64] Decouple feature dependency expansion. (PR #94279)

2024-06-04 Thread Tomas Matheson via cfe-commits
@@ -265,6 +267,21 @@ bool AArch64::ExtensionSet::parseModifier(StringRef Modifier) { return false; } +void AArch64::ExtensionSet::reconstructFromParsedFeatures( +std::vector &Features) { tmatheson-arm wrote: ```suggestion const std::vector &Feature

[clang] [llvm] [AArch64] Decouple feature dependency expansion. (PR #94279)

2024-06-04 Thread Tomas Matheson via cfe-commits
@@ -250,13 +248,17 @@ void AArch64::ExtensionSet::addArchDefaults(const ArchInfo &Arch) { bool AArch64::ExtensionSet::parseModifier(StringRef Modifier) { LLVM_DEBUG(llvm::dbgs() << "parseModifier(" << Modifier << ")\n"); - bool IsNegated = Modifier.starts_with("no"); - St

[clang] [clang] Lower _BitInt(129+) to a different type in LLVM IR (PR #91364)

2024-06-04 Thread Mariya Podchishchaeva via cfe-commits
@@ -436,9 +436,9 @@ class ScalarExprEmitter if (Value *Result = ConstantEmitter(CGF).tryEmitConstantExpr(E)) { if (E->isGLValue()) -return CGF.Builder.CreateLoad(Address( -Result, CGF.ConvertTypeForMem(E->getType()), -CGF.getContext().

[clang] [clang] Lower _BitInt(129+) to a different type in LLVM IR (PR #91364)

2024-06-04 Thread Mariya Podchishchaeva via cfe-commits
@@ -2012,26 +2015,27 @@ llvm::Value *CodeGenFunction::EmitLoadOfScalar(Address Addr, bool Volatile, } llvm::Value *CodeGenFunction::EmitToMemory(llvm::Value *Value, QualType Ty) { Fznamznon wrote: Done. https://github.com/llvm/llvm-project/pull/91364 __

[clang] [clang] Lower _BitInt(129+) to a different type in LLVM IR (PR #91364)

2024-06-04 Thread Mariya Podchishchaeva via cfe-commits
@@ -2012,26 +2015,27 @@ llvm::Value *CodeGenFunction::EmitLoadOfScalar(Address Addr, bool Volatile, } llvm::Value *CodeGenFunction::EmitToMemory(llvm::Value *Value, QualType Ty) { - // Bool has a different representation in memory than in registers. - if (hasBooleanRepresen

[clang] [clang] Lower _BitInt(129+) to a different type in LLVM IR (PR #91364)

2024-06-04 Thread Mariya Podchishchaeva via cfe-commits
@@ -2044,6 +2048,12 @@ llvm::Value *CodeGenFunction::EmitFromMemory(llvm::Value *Value, QualType Ty) { return emitBoolVecConversion(V, ValNumElems, "extractvec"); } + if (hasBooleanRepresentation(Ty) || Ty->isBitIntType()) { +llvm::Type *ResTy = ConvertType(Ty); +

[clang-tools-extra] [clang-tidy] `doesNotMutateObject`: Handle calls to member functions … (PR #94362)

2024-06-04 Thread Oliver Stöneberg via cfe-commits
firewave wrote: Could this also be applied for #69577? (please also mind the tickets referenced in it) https://github.com/llvm/llvm-project/pull/94362 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listi

[clang] [clang CodeGen] Restrict return statements nested in return statements. (PR #94282)

2024-06-04 Thread via cfe-commits
higher-performance wrote: If you want to just add an easy diagnosis for now, what I'd do is: 1. Change it to a warning 1. Also check that the expression is an aggregate-initialization of a `return` expression This will still have false-positives, but at least it should catch both of our cases

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-06-04 Thread David Blaikie via cfe-commits
dwblaikie wrote: Per ( https://llvm.org/docs/GitHub.html#updating-pull-requests ) please don't force push, makes it hard to follow the changes to the review as they progress. https://github.com/llvm/llvm-project/pull/75912 ___ cfe-commits mailing list

[clang] [flang] [llvm] [OpenMP][LLVM] Update alloca IP after `PrivCB` in `OMPIRBUIlder` (PR #93920)

2024-06-04 Thread Kareem Ergawy via cfe-commits
https://github.com/ergawy updated https://github.com/llvm/llvm-project/pull/93920 >From 926cf8d19c625880c303aff0527e2e6e8a1629bd Mon Sep 17 00:00:00 2001 From: ergawy Date: Thu, 30 May 2024 23:16:39 -0500 Subject: [PATCH 1/3] [OpenMP][][LLVM] Update alloca IP after `PrivCB` in `OMPIRBUIlder`

[clang] e5f7123 - Disable constexpr function body checking in more situations (#94347)

2024-06-04 Thread via cfe-commits
Author: Aaron Ballman Date: 2024-06-04T13:32:11-04:00 New Revision: e5f7123dfef3a80937d088d846ddb3b2bb1869b9 URL: https://github.com/llvm/llvm-project/commit/e5f7123dfef3a80937d088d846ddb3b2bb1869b9 DIFF: https://github.com/llvm/llvm-project/commit/e5f7123dfef3a80937d088d846ddb3b2bb1869b9.diff

[clang] Disable constexpr function body checking in more situations (PR #94347)

2024-06-04 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman closed https://github.com/llvm/llvm-project/pull/94347 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Enable LLDB tests in Linux pre-merge CI (PR #94208)

2024-06-04 Thread Adrian Prantl via cfe-commits
adrian-prantl wrote: > But also, changes in Clang that break lldb do not necessarily mean that a PR > is not ready to land. There are conforming changes that can be made to Clang > which lldb needs to react to as a downstream consumer of Clang as a library > rather than a PR author needing to

[clang] [llvm] [AArch64] set AppleA14 architecture version to v8.4-a (PR #92600)

2024-06-04 Thread Jon Roelofs via cfe-commits
@@ -286,7 +286,6 @@ void AArch64TargetInfo::getTargetDefinesARMV84A(const LangOptions &Opts, void AArch64TargetInfo::getTargetDefinesARMV85A(const LangOptions &Opts, MacroBuilder &Builder) const { Builder.defineMacro("__ARM_FEA

[clang] [llvm] Enable LLDB tests in Linux pre-merge CI (PR #94208)

2024-06-04 Thread Jonas Devlieghere via cfe-commits
JDevlieghere wrote: +1 to what Adrian said. Taht certainly does **not** match my expectations. I'm not sure why there would be a different policy for LLDB than for any of the other monorepo projects. https://github.com/llvm/llvm-project/pull/94208 __

[clang] [clang][RISCV] Enable RVV with function attribute __attribute__((target("arch=+v"))) (PR #83674)

2024-06-04 Thread Brandon Wu via cfe-commits
4vtomat wrote: > FYI, the example code you shown doesn't compile anymore: > https://godbolt.org/z/ooTWEGejf > > This feature is quite important, without it we can't compile in RVV by > default in a lot of libraries, e.g. simdutf, flac, ... I guess it should be `__attribute__((target("arch=+zv

[clang] [clang][RISCV] Enable RVV with function attribute __attribute__((target("arch=+v"))) (PR #83674)

2024-06-04 Thread Brandon Wu via cfe-commits
https://github.com/4vtomat edited https://github.com/llvm/llvm-project/pull/83674 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AMDGPU] Use `I` to decorate imm argument for `__builtin_amdgcn_global_load_lds` (PR #94376)

2024-06-04 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm commented: Missing non-constant tests for each parameter? https://github.com/llvm/llvm-project/pull/94376 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] `constexpr` builtin floating point classification / comparison functions (PR #94118)

2024-06-04 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/94118 >From ed1c00ee4474a626965290f2d16aaaf0f4519ec9 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sat, 1 Jun 2024 17:45:21 +0100 Subject: [PATCH 1/5] constexpr __builtin_signbit --- clang/include/clang/Basic/B

[clang] [llvm] Enable LLDB tests in Linux pre-merge CI (PR #94208)

2024-06-04 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > I would not agree with this specific wording. We have in the past and will in > the future revert commits that break existing tests elsewhere in the LLVM > project. If a patch to Clang breaks an existing test in LLDB, it's up to the > author of the patch to work with the

[clang] [Clang] `constexpr` builtin floating point classification / comparison functions (PR #94118)

2024-06-04 Thread Mital Ashok via cfe-commits
@@ -430,6 +430,78 @@ static bool interp__builtin_iszero(InterpState &S, CodePtr OpPC, return true; } +static bool interp__builtin_signbit(InterpState &S, CodePtr OpPC, +const InterpFrame *Frame, const Function *F, +

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-06-04 Thread David Blaikie via cfe-commits
@@ -1185,6 +1190,21 @@ bool CodeGenVTables::isVTableExternal(const CXXRecordDecl *RD) { TSK == TSK_ExplicitInstantiationDefinition) return false; + // Itanium C++ ABI [5.2.3]: + // Virtual tables for dynamic classes are emitted as follows: + // + // - If the cla

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-06-04 Thread David Blaikie via cfe-commits
@@ -3239,6 +3239,12 @@ bool ASTReader::isConsumerInterestedIn(Decl *D) { if (ES->hasExternalDefinitions(D) == ExternalASTSource::EK_Never) return true; + // The dynamic class defined in a named module is interesting. + // The code generator needs to emit its vtable

[clang] [HLSL] add loop unroll (PR #93879)

2024-06-04 Thread Farzon Lotfi via cfe-commits
@@ -7401,7 +7495,8 @@ b for constant buffer views (CBV). Register space is specified in the format ``space[number]`` and defaults to ``space0`` if omitted. Here're resource binding examples with and without space: -.. code-block:: c++ + +.. code-block:: hlsl

[clang] [ASTMatchers] forCallable should not erase binding on success (PR #89657)

2024-06-04 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/89657 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ASTMatchers] forCallable should not erase binding on success (PR #89657)

2024-06-04 Thread Aaron Ballman via cfe-commits
@@ -832,6 +832,7 @@ Bug Fixes to AST Handling - Fixed malformed AST generated for anonymous union access in templates. (#GH90842) - Improved preservation of qualifiers and sugar in `TemplateNames`, including template keyword. +- ``forCallable`` now properly preserves binding

[clang] [ASTMatchers] forCallable should not erase binding on success (PR #89657)

2024-06-04 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM aside from a small nit with the release notes. Do you need someone to land this on your behalf? https://github.com/llvm/llvm-project/pull/89657 ___ cfe-commits mailing list cfe-commits@l

[clang] [llvm] [CLANG][LLVM][AArch64]SME2.1 intrinsics for MOVAZ tile to 2/4 vectors (PR #88710)

2024-06-04 Thread Amara Emerson via cfe-commits
@@ -674,3 +674,26 @@ let TargetGuard = "sme2" in { def SVLUTI2_LANE_ZT_X2 : Inst<"svluti2_lane_zt_{d}_x2", "2.di[i", "cUcsUsiUibhf", MergeNone, "aarch64_sme_luti2_lane_zt_x2", [IsStreaming, IsInZT0], [ImmCheck<0, ImmCheck0_0>, ImmCheck<2, ImmCheck0_7>]>; def SVLUTI4_LANE_Z

[clang] [llvm] [CLANG][LLVM][AArch64]SME2.1 intrinsics for MOVAZ tile to 2/4 vectors (PR #88710)

2024-06-04 Thread Amara Emerson via cfe-commits
https://github.com/aemerson approved this pull request. LGTM unless others have comments. https://github.com/llvm/llvm-project/pull/88710 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit

[clang] [llvm] [CLANG][LLVM][AArch64]Add SME2.1 intrinsics for MOVAZ tile to vector,… (PR #88499)

2024-06-04 Thread Amara Emerson via cfe-commits
https://github.com/aemerson approved this pull request. https://github.com/llvm/llvm-project/pull/88499 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Lower _BitInt(129+) to a different type in LLVM IR (PR #91364)

2024-06-04 Thread Eli Friedman via cfe-commits
@@ -5348,18 +5348,8 @@ Value *ScalarExprEmitter::VisitVAArgExpr(VAArgExpr *VE) { return llvm::UndefValue::get(ArgTy); } - // FIXME Volatility. - llvm::Value *Val = Builder.CreateLoad(ArgPtr); - - // If EmitVAArg promoted the type, we must truncate it. - if (ArgTy !=

[clang] [clang][RISCV] Enable RVV with function attribute __attribute__((target("arch=+v"))) (PR #83674)

2024-06-04 Thread Camel Coder via cfe-commits
camel-cdr wrote: Ah, thanks, that works. How can support for behavior be detected? The intrinsic spec says: > The `__riscv_v_intrinsic` macro is the C macro to test the compiler's support > for the RISC-V "V" extension intrinsics. and recommends using: ```c #ifdef __riscv_v_intrinsic #include

[clang] [clang][CodeGen] Make `UnqualPtrTy` truly unqualified (PR #94388)

2024-06-04 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx created https://github.com/llvm/llvm-project/pull/94388 At the moment we alias `UnqualPtrTy` with the other default AS pointer types, which means that for certain targets using it doesn't actually yield an unqualified pointer. This patch changes that so that it does

[clang] [Clang][C++23] update constexpr diagnostics for missing return statements per P2448 (PR #94123)

2024-06-04 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/94123 >From 90eeafc82ee08129c2d290e6382f42ec89680049 Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Sun, 2 Jun 2024 00:07:35 +0300 Subject: [PATCH 1/3] feat(92583): [C++23] update constexpr diagnostics for missin

[clang] [clang][CodeGen] Make `UnqualPtrTy` truly unqualified (PR #94388)

2024-06-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen @llvm/pr-subscribers-clang Author: Alex Voicu (AlexVlx) Changes At the moment we alias `UnqualPtrTy` with the other default AS pointer types, which means that for certain targets using it doesn't actually yield an unqualified pointer. Thi

[clang] [clang][CodeGen] Make `UnqualPtrTy` truly unqualified (PR #94388)

2024-06-04 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/94388 >From cdf95a804614950167d2d4df227d06a86a70d4bb Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Tue, 4 Jun 2024 19:52:28 +0100 Subject: [PATCH] Unqualified `ptr`s should be truly unqualified, and not AS0 ptrs. -

[clang] [clang][CodeGen] Make `UnqualPtrTy` truly unqualified (PR #94388)

2024-06-04 Thread Jessica Clarke via cfe-commits
jrtc27 wrote: I don't think that assumption is currently true. I think it's also worth clarifying what this thing is, and possibly renaming it, because "unqualified" has C language level meaning that would contradict what it is here. https://github.com/llvm/llvm-project/pull/94388

[clang] [Clang][C++23] update constexpr diagnostics for missing return statements per P2448 (PR #94123)

2024-06-04 Thread Oleksandr T. via cfe-commits
@@ -2487,6 +2477,26 @@ static bool CheckConstexprFunctionBody(Sema &SemaRef, const FunctionDecl *Dcl, return true; } +static bool CheckConstexprMissingReturn(Sema &SemaRef, +const FunctionDecl *Dcl) { + bool IsVoidOrDependentType = D

[clang] [Clang][C++23] update constexpr diagnostics for missing return statements per P2448 (PR #94123)

2024-06-04 Thread Oleksandr T. via cfe-commits
@@ -0,0 +1,7 @@ +// RUN: %clang_cc1 -Wno-return-type -std=c++23 -fsyntax-only -verify %s +// expected-no-diagnostics +constexpr int f() { } +static_assert(__is_same(decltype([] constexpr -> int { }( )), int)); a-tarasyuk wrote: @AaronBallman Should a new option (

[clang] [Clang][C++23] update constexpr diagnostics for missing return statements per P2448 (PR #94123)

2024-06-04 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk deleted https://github.com/llvm/llvm-project/pull/94123 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][C++23] update constexpr diagnostics for missing return statements per P2448 (PR #94123)

2024-06-04 Thread Oleksandr T. via cfe-commits
@@ -0,0 +1,7 @@ +// RUN: %clang_cc1 -Wno-return-type -std=c++23 -fsyntax-only -verify %s +// expected-no-diagnostics +constexpr int f() { } +static_assert(__is_same(decltype([] constexpr -> int { }( )), int)); a-tarasyuk wrote: @AaronBallman Thanks for the review

[clang] [Clang][AMDGPU] Use `I` to decorate imm argument for `__builtin_amdgcn_global_load_lds` (PR #94376)

2024-06-04 Thread Shilei Tian via cfe-commits
https://github.com/shiltian updated https://github.com/llvm/llvm-project/pull/94376 >From d5ecf4e5f3cd5b7191acf3fd24ef0ac98b8a9f3e Mon Sep 17 00:00:00 2001 From: Shilei Tian Date: Tue, 4 Jun 2024 15:10:08 -0400 Subject: [PATCH] [Clang][AMDGPU] Use `I` to decorate imm argument for `__builtin_am

[clang] [clang] Lower _BitInt(129+) to a different type in LLVM IR (PR #91364)

2024-06-04 Thread Eli Friedman via cfe-commits
@@ -761,6 +761,10 @@ bool ConstStructBuilder::Build(const InitListExpr *ILE, bool AllowOverwrite) { if (Field->hasAttr()) AllowOverwrite = true; } else { + llvm::Type *LoadType = CGM.getTypes().convertTypeForLoadStore( efriedma-quic wrot

[clang] [clang] Lower _BitInt(129+) to a different type in LLVM IR (PR #91364)

2024-06-04 Thread Eli Friedman via cfe-commits
@@ -128,6 +128,15 @@ class CodeGenTypes { /// memory representation is usually i8 or i32, depending on the target. llvm::Type *ConvertTypeForMem(QualType T, bool ForBitField = false); + /// Check that size and abi alignment of given LLVM type matches size and + /// align

[clang] [clang] Fix-it hint for `++this` -> `++*this` when deref is modifiable (PR #94159)

2024-06-04 Thread Rajveer Singh Bharadwaj via cfe-commits
@@ -13367,6 +13367,8 @@ static void DiagnoseConstAssignment(Sema &S, const Expr *E, if (!DiagnosticEmitted) { S.Diag(Loc, diag::err_typecheck_assign_const) << ExprRange << ConstVariable << VD << VD->getType(); + S.Diag(Loc, diag::note_t

[clang] [clang] Fix-it hint for `++this` -> `++*this` when deref is modifiable (PR #94159)

2024-06-04 Thread via cfe-commits
@@ -13367,6 +13367,8 @@ static void DiagnoseConstAssignment(Sema &S, const Expr *E, if (!DiagnosticEmitted) { S.Diag(Loc, diag::err_typecheck_assign_const) << ExprRange << ConstVariable << VD << VD->getType(); + S.Diag(Loc, diag::note_t

[clang] [clang-repl] Lay the foundation of pretty printing for C. (PR #89811)

2024-06-04 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/89811 >From 3094e6026925ebcba6da86dd16111f4f70f9a700 Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Tue, 23 Apr 2024 19:33:00 + Subject: [PATCH] [clang-repl] Lay the foundation of pretty printing for C. -

[clang] [clang-tools-extra] [libcxx] Reland "[clang] Enable sized deallocation by default in C++14 onwards" (PR #90373)

2024-06-04 Thread Mike Hommey via cfe-commits
glandium wrote: What kind of detail are you looking for? https://github.com/llvm/llvm-project/pull/90373 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix potential null pointer dereferences in Sema::AddInitializerToDecl (PR #94368)

2024-06-04 Thread Fred Grim via cfe-commits
https://github.com/feg208 approved this pull request. ltgm https://github.com/llvm/llvm-project/pull/94368 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix self-capturing `__block` variables (PR #89475)

2024-06-04 Thread via cfe-commits
https://github.com/ille-apple updated https://github.com/llvm/llvm-project/pull/89475 >From 26be4b6332bf6b58b3d99bb0065b854dcce2a944 Mon Sep 17 00:00:00 2001 From: ille-apple Date: Fri, 19 Apr 2024 15:36:44 -0700 Subject: [PATCH 1/2] [clang] Fix self-capturing `__block` variables Clang special

[clang] [clang] Fix self-capturing `__block` variables (PR #89475)

2024-06-04 Thread via cfe-commits
https://github.com/ille-apple updated https://github.com/llvm/llvm-project/pull/89475 >From 26be4b6332bf6b58b3d99bb0065b854dcce2a944 Mon Sep 17 00:00:00 2001 From: ille-apple Date: Fri, 19 Apr 2024 15:36:44 -0700 Subject: [PATCH 1/3] [clang] Fix self-capturing `__block` variables Clang special

[clang] [clang] Fix self-capturing `__block` variables (PR #89475)

2024-06-04 Thread via cfe-commits
@@ -2764,6 +2794,9 @@ void CodeGenFunction::emitByrefStructureInit(const AutoVarEmission &emission) { auto layoutInfo = CGM.getObjCRuntime().BuildByrefLayout(CGM, type); storeHeaderField(layoutInfo, getPointerSize(), "byref.layout"); } + + if (emission.NeedsInitOnHe

[clang] [Clang][C++23] update constexpr diagnostics for missing return statements per P2448 (PR #94123)

2024-06-04 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,7 @@ +// RUN: %clang_cc1 -Wno-return-type -std=c++23 -fsyntax-only -verify %s +// expected-no-diagnostics +constexpr int f() { } +static_assert(__is_same(decltype([] constexpr -> int { }( )), int)); AaronBallman wrote: We already have such an option, b

<    1   2   3   4   >