[clang] [clang-tools-extra] [clang] Improve nested name specifier AST representation (PR #147835)

2025-08-22 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > Hi, I'm helping fix some clang-as-a-library users and I'm running into some > issues with the TypePrinter after this commit. Specifically the clang > generator in sandboxed-api is broken > (https://github.com/google/sandboxed-api/tree/main). After doing the trivial > fixes (

[clang] [CIR] Upstream DivOp for ComplexType (PR #153796)

2025-08-22 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper closed https://github.com/llvm/llvm-project/pull/153796 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 304ef65 - [CIR] Upstream DivOp for ComplexType (#153796)

2025-08-22 Thread via cfe-commits
Author: Amr Hesham Date: 2025-08-23T08:39:48+02:00 New Revision: 304ef65f7bbc575b110ba3c7f3ae01c3d8f027e6 URL: https://github.com/llvm/llvm-project/commit/304ef65f7bbc575b110ba3c7f3ae01c3d8f027e6 DIFF: https://github.com/llvm/llvm-project/commit/304ef65f7bbc575b110ba3c7f3ae01c3d8f027e6.diff LO

[clang-tools-extra] Add option to allow pre/post increment/decrement operator in cppcoreg… (PR #155015)

2025-08-22 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `clang-aarch64-sve-vls` running on `linaro-g3-04` while building `clang-tools-extra` at step 7 "ninja check 1". Full details are available at: https://lab.llvm.org/buildbot/#/builders/143/builds/10225 Here is the relevant pi

[clang] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-08-22 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov commented: How about inner qualifiers? The patch doesn't address the situation. For a test like: ```C++ using ConstInt = const int; using WrapConstInt1 = ConstInt __attribute__((overflow_behavior(wrap))); using WrapConstInt2 = const int __attribute__((overflow_behavio

[clang] [clang][initlist] handle incomplete array type in Constant Expr Calculation (PR #155080)

2025-08-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Congcong Cai (HerrCai0907) Changes fix: #151716 In #65918, support of incomplete array type is added in TryReferenceListInitialization. It causes the crash in Constant Expr Calculation since it only considers the case where it is Constan

[clang] [clang][initlist] handle incomplete array type in Constant Expr Calculation (PR #155080)

2025-08-22 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/155080 fix: #151716 In #65918, support of incomplete array type is added in TryReferenceListInitialization. It causes the crash in Constant Expr Calculation since it only considers the case where it is ConstantAr

[clang] [clang] Remove hasValue() check in `RecordExprEvaluator::VisitCXXConstructExpr()` (PR #154610)

2025-08-22 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 closed https://github.com/llvm/llvm-project/pull/154610 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 8b3d4bd - [clang] Remove hasValue() check in `RecordExprEvaluator::VisitCXXConstructExpr()` (#154610)

2025-08-22 Thread via cfe-commits
Author: Timm Baeder Date: 2025-08-23T08:01:48+02:00 New Revision: 8b3d4bdf8bade1d1faa8ff3fcbdda7060f8b46d8 URL: https://github.com/llvm/llvm-project/commit/8b3d4bdf8bade1d1faa8ff3fcbdda7060f8b46d8 DIFF: https://github.com/llvm/llvm-project/commit/8b3d4bdf8bade1d1faa8ff3fcbdda7060f8b46d8.diff L

[clang] [clang] Proofread AutomaticReferenceCounting.rst (PR #155071)

2025-08-22 Thread Tim Gymnich via cfe-commits
https://github.com/tgymnich approved this pull request. https://github.com/llvm/llvm-project/pull/155071 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Add option to allow pre/post increment/decrement operator in cppcoreg… (PR #155015)

2025-08-22 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp closed https://github.com/llvm/llvm-project/pull/155015 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] efed984 - Add option to allow pre/post increment/decrement operator in cppcoreg… (#155015)

2025-08-22 Thread via cfe-commits
Author: Carlos Galvez Date: 2025-08-23T07:39:25+02:00 New Revision: efed9844d53192ec10526f454e8e37eca4de7f57 URL: https://github.com/llvm/llvm-project/commit/efed9844d53192ec10526f454e8e37eca4de7f57 DIFF: https://github.com/llvm/llvm-project/commit/efed9844d53192ec10526f454e8e37eca4de7f57.diff

[clang-tools-extra] [clang-tidy] Add new check 'llvm-use-ranges' (PR #152047)

2025-08-22 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/152047 >From bb17fb65d031190efff6a6ec1c0ca6d9c0d35abb Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Tue, 5 Aug 2025 01:15:02 +0300 Subject: [PATCH 1/4] [clang-tidy] Add new check 'llvm-use-ranges' --- .../clan

[clang-tools-extra] [clang-tidy] Add new check 'llvm-use-ranges' (PR #152047)

2025-08-22 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/152047 >From bb17fb65d031190efff6a6ec1c0ca6d9c0d35abb Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Tue, 5 Aug 2025 01:15:02 +0300 Subject: [PATCH 1/3] [clang-tidy] Add new check 'llvm-use-ranges' --- .../clan

[clang-tools-extra] Add option to allow pre/post increment/decrement operator in cppcoreg… (PR #155015)

2025-08-22 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. https://github.com/llvm/llvm-project/pull/155015 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Add option to allow pre/post increment/decrement operator in cppcoreg… (PR #155015)

2025-08-22 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/155015 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RISCV] Refactor RVV builtin code generation for reduce compilation time [NFC] (PR #154906)

2025-08-22 Thread Craig Topper via cfe-commits
@@ -20,6 +20,958 @@ using namespace clang; using namespace CodeGen; using namespace llvm; +// The 0th bit simulates the `vta` of RVV +// The 1st bit simulates the `vma` of RVV +static constexpr unsigned RVV_VTA = 0x1; +static constexpr unsigned RVV_VMA = 0x2; + +// RISC-V Vect

[clang] [RISCV] Refactor RVV builtin code generation for reduce compilation time [NFC] (PR #154906)

2025-08-22 Thread Craig Topper via cfe-commits
@@ -20,6 +20,958 @@ using namespace clang; using namespace CodeGen; using namespace llvm; +// The 0th bit simulates the `vta` of RVV +// The 1st bit simulates the `vma` of RVV +static constexpr unsigned RVV_VTA = 0x1; +static constexpr unsigned RVV_VMA = 0x2; + +// RISC-V Vect

[clang] [RISCV] Refactor RVV builtin code generation for reduce compilation time [NFC] (PR #154906)

2025-08-22 Thread Craig Topper via cfe-commits
@@ -20,6 +20,958 @@ using namespace clang; using namespace CodeGen; using namespace llvm; +// The 0th bit simulates the `vta` of RVV +// The 1st bit simulates the `vma` of RVV +static constexpr unsigned RVV_VTA = 0x1; +static constexpr unsigned RVV_VMA = 0x2; + +// RISC-V Vect

[clang] [RISCV] Refactor RVV builtin code generation for reduce compilation time [NFC] (PR #154906)

2025-08-22 Thread Craig Topper via cfe-commits
@@ -20,6 +20,958 @@ using namespace clang; using namespace CodeGen; using namespace llvm; +// The 0th bit simulates the `vta` of RVV +// The 1st bit simulates the `vma` of RVV +static constexpr unsigned RVV_VTA = 0x1; +static constexpr unsigned RVV_VMA = 0x2; + +// RISC-V Vect

[clang] [RISCV] Refactor RVV builtin code generation for reduce compilation time [NFC] (PR #154906)

2025-08-22 Thread Craig Topper via cfe-commits
@@ -20,6 +20,958 @@ using namespace clang; using namespace CodeGen; using namespace llvm; +// The 0th bit simulates the `vta` of RVV +// The 1st bit simulates the `vma` of RVV +static constexpr unsigned RVV_VTA = 0x1; +static constexpr unsigned RVV_VMA = 0x2; + +// RISC-V Vect

[clang] [RISCV] Refactor RVV builtin code generation for reduce compilation time [NFC] (PR #154906)

2025-08-22 Thread Craig Topper via cfe-commits
@@ -20,6 +20,958 @@ using namespace clang; using namespace CodeGen; using namespace llvm; +// The 0th bit simulates the `vta` of RVV +// The 1st bit simulates the `vma` of RVV +static constexpr unsigned RVV_VTA = 0x1; +static constexpr unsigned RVV_VMA = 0x2; + +// RISC-V Vect

[clang] [RISCV] Refactor RVV builtin code generation for reduce compilation time [NFC] (PR #154906)

2025-08-22 Thread Craig Topper via cfe-commits
@@ -20,6 +20,958 @@ using namespace clang; using namespace CodeGen; using namespace llvm; +// The 0th bit simulates the `vta` of RVV +// The 1st bit simulates the `vma` of RVV +static constexpr unsigned RVV_VTA = 0x1; +static constexpr unsigned RVV_VMA = 0x2; + +// RISC-V Vect

[clang] [RISCV] Refactor RVV builtin code generation for reduce compilation time [NFC] (PR #154906)

2025-08-22 Thread Craig Topper via cfe-commits
@@ -20,6 +20,958 @@ using namespace clang; using namespace CodeGen; using namespace llvm; +// The 0th bit simulates the `vta` of RVV +// The 1st bit simulates the `vma` of RVV +static constexpr unsigned RVV_VTA = 0x1; +static constexpr unsigned RVV_VMA = 0x2; + +// RISC-V Vect

[clang] [RISCV] Refactor RVV builtin code generation for reduce compilation time [NFC] (PR #154906)

2025-08-22 Thread Craig Topper via cfe-commits
@@ -20,6 +20,958 @@ using namespace clang; using namespace CodeGen; using namespace llvm; +// The 0th bit simulates the `vta` of RVV +// The 1st bit simulates the `vma` of RVV +static constexpr unsigned RVV_VTA = 0x1; +static constexpr unsigned RVV_VMA = 0x2; + +// RISC-V Vect

[clang] [RISCV] Refactor RVV builtin code generation for reduce compilation time [NFC] (PR #154906)

2025-08-22 Thread Craig Topper via cfe-commits
@@ -20,6 +20,958 @@ using namespace clang; using namespace CodeGen; using namespace llvm; +// The 0th bit simulates the `vta` of RVV +// The 1st bit simulates the `vma` of RVV +static constexpr unsigned RVV_VTA = 0x1; +static constexpr unsigned RVV_VMA = 0x2; + +// RISC-V Vect

[clang] [RISCV] Refactor RVV builtin code generation for reduce compilation time [NFC] (PR #154906)

2025-08-22 Thread Craig Topper via cfe-commits
@@ -20,6 +20,958 @@ using namespace clang; using namespace CodeGen; using namespace llvm; +// The 0th bit simulates the `vta` of RVV +// The 1st bit simulates the `vma` of RVV +static constexpr unsigned RVV_VTA = 0x1; +static constexpr unsigned RVV_VMA = 0x2; + +// RISC-V Vect

[clang] [RISCV] Refactor RVV builtin code generation for reduce compilation time [NFC] (PR #154906)

2025-08-22 Thread Craig Topper via cfe-commits
@@ -20,6 +20,958 @@ using namespace clang; using namespace CodeGen; using namespace llvm; +// The 0th bit simulates the `vta` of RVV +// The 1st bit simulates the `vma` of RVV +static constexpr unsigned RVV_VTA = 0x1; +static constexpr unsigned RVV_VMA = 0x2; + +// RISC-V Vect

[clang] [RISCV] Refactor RVV builtin code generation for reduce compilation time [NFC] (PR #154906)

2025-08-22 Thread Craig Topper via cfe-commits
@@ -20,6 +20,958 @@ using namespace clang; using namespace CodeGen; using namespace llvm; +// The 0th bit simulates the `vta` of RVV +// The 1st bit simulates the `vma` of RVV +static constexpr unsigned RVV_VTA = 0x1; +static constexpr unsigned RVV_VMA = 0x2; + +// RISC-V Vect

[clang] [RISCV] Refactor RVV builtin code generation for reduce compilation time [NFC] (PR #154906)

2025-08-22 Thread Craig Topper via cfe-commits
@@ -20,6 +20,958 @@ using namespace clang; using namespace CodeGen; using namespace llvm; +// The 0th bit simulates the `vta` of RVV +// The 1st bit simulates the `vma` of RVV +static constexpr unsigned RVV_VTA = 0x1; +static constexpr unsigned RVV_VMA = 0x2; + +// RISC-V Vect

[clang] [RISCV] Refactor RVV builtin code generation for reduce compilation time [NFC] (PR #154906)

2025-08-22 Thread Craig Topper via cfe-commits
@@ -20,6 +20,958 @@ using namespace clang; using namespace CodeGen; using namespace llvm; +// The 0th bit simulates the `vta` of RVV +// The 1st bit simulates the `vma` of RVV +static constexpr unsigned RVV_VTA = 0x1; +static constexpr unsigned RVV_VMA = 0x2; + +// RISC-V Vect

[clang] [Clang] Add detailed notes explaining why is_aggregate evaluates to false (PR #152488)

2025-08-22 Thread Shamshura Egor via cfe-commits
egorshamshura wrote: @cor3ntin ping 🥺 https://github.com/llvm/llvm-project/pull/152488 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Fix comparing pointers to union members (PR #154342)

2025-08-22 Thread Shafik Yaghmour via cfe-commits
@@ -966,3 +966,15 @@ namespace AddressComparison { static_assert(&U2.a[0] != &U2.b[1]); static_assert(&U2.a[0] == &U2.b[1]); // both-error {{failed}} } + +#if __cplusplus >= 202002L +namespace UnionMemberOnePastEnd { + constexpr bool b() { +union { + int p; +

[clang] [clang][bytecode] Support pmul X86 builtins (PR #154275)

2025-08-22 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: I don't see any tests for this. https://github.com/llvm/llvm-project/pull/154275 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Proofread AutomaticReferenceCounting.rst (PR #155071)

2025-08-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Kazu Hirata (kazutakahirata) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/155071.diff 1 Files Affected: - (modified) clang/docs/AutomaticReferenceCounting.rst (+6-6) ``diff diff --git a/clang/docs/Automat

[clang] [clang] Proofread AutomaticReferenceCounting.rst (PR #155071)

2025-08-22 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/155071 None >From b4852fcf10ec2c8e6bfad0a9efb308fd7e9fdb8b Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Fri, 22 Aug 2025 13:14:57 -0700 Subject: [PATCH] [clang] Proofread AutomaticReferenceCounting.rst ---

[clang] [clang] Diagnose misplaced array bounds with non-identifier declarators. (PR #155064)

2025-08-22 Thread via cfe-commits
https://github.com/keinflue ready_for_review https://github.com/llvm/llvm-project/pull/155064 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Diagnose misplaced array bounds with non-identifier declarators. (PR #155064)

2025-08-22 Thread via cfe-commits
https://github.com/keinflue created https://github.com/llvm/llvm-project/pull/155064 ParseMisplacedBracketDeclarator assumed that declarators without associated identifier are ill-formed and already diagnosed previously. This didn't consider declarators using template-ids, constructors, destru

[clang] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-08-22 Thread Matheus Izvekov via cfe-commits
@@ -5776,6 +5826,51 @@ QualType ASTContext::getBTFTagAttributedType(const BTFTypeTagAttr *BTFAttr, return QualType(Ty, 0); } +QualType ASTContext::getOverflowBehaviorType(const OverflowBehaviorAttr *Attr, + QualType Underlying) co

[clang] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-08-22 Thread Matheus Izvekov via cfe-commits
@@ -2844,6 +2872,8 @@ inline T TypeLoc::getAsAdjusted() const { Cur = ATL.getModifiedLoc(); else if (auto ATL = Cur.getAs()) Cur = ATL.getWrappedLoc(); +// else if (auto ATL = Cur.getAs()) +// Cur = ATL.getWrappedLoc(); mizvekov wrote:

[clang] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-08-22 Thread Matheus Izvekov via cfe-commits
@@ -8914,6 +8975,12 @@ inline bool Type::isIntegerType() const { return IsEnumDeclComplete(ET->getOriginalDecl()) && !IsEnumDeclScoped(ET->getOriginalDecl()); } + + if (isOverflowBehaviorType()) +return cast(CanonicalType) +->getUnderlyingType() +

[clang] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-08-22 Thread Matheus Izvekov via cfe-commits
@@ -9120,6 +9191,8 @@ template const T *Type::getAsAdjusted() const { Ty = A->getModifiedType().getTypePtr(); else if (const auto *A = dyn_cast(Ty)) Ty = A->getWrappedType().getTypePtr(); +// else if (const auto *A = dyn_cast(Ty)) +// Ty = A->getWrap

[clang] [clang-tools-extra] [clang] AST: fix getAs canonicalization of leaf types (PR #155028)

2025-08-22 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 approved this pull request. LGTM, but please wait for other reviewers as the change is really large. > The user expectation is that getAs only removes top level sugar nodes, > leaving all the type sugar on the returned node So suppose there are really some users who

[clang] [clang-tools-extra] [clang] AST: fix getAs canonicalization of leaf types (PR #155028)

2025-08-22 Thread Younan Zhang via cfe-commits
@@ -2922,8 +2931,31 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase { /// /// There are some specializations of this member template listed /// immediately following this class. + /// + /// If you are interested only in the canonical properties of

[clang] [clang-tools-extra] [clang] AST: fix getAs canonicalization of leaf types (PR #155028)

2025-08-22 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/155028 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Diagnose misplaced array bounds with non-identifier declarators. (PR #155064)

2025-08-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (keinflue) Changes ParseMisplacedBracketDeclarator assumed that declarators without associated identifier are ill-formed and already diagnosed previously. This didn't consider declarators using template-ids, constructors, destructors

[clang] [clang] Diagnose misplaced array bounds with non-identifier declarators. (PR #155064)

2025-08-22 Thread via cfe-commits
https://github.com/keinflue updated https://github.com/llvm/llvm-project/pull/155064 >From b8f51c5dbad044fdbaf90e3db84f3bbbfaee337a Mon Sep 17 00:00:00 2001 From: keinflue Date: Sat, 23 Aug 2025 04:50:28 +0200 Subject: [PATCH] [clang] Diagnose misplaced array bounds with non-identifier declara

[clang-tools-extra] [clang-tidy] performance-unnecessary-copy-initialization: Enhance the check for the scenario with MemberExpr initialization. (PR #151936)

2025-08-22 Thread via cfe-commits
https://github.com/movie-travel-code edited https://github.com/llvm/llvm-project/pull/151936 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-08-22 Thread Matheus Izvekov via cfe-commits
@@ -405,6 +405,10 @@ ArgType::matchesType(ASTContext &C, QualType argTy) const { argTy = PT->getPointeeType(); } + if (const OverflowBehaviorType *OBT = + dyn_cast(argTy.getCanonicalType())) +argTy = OBT->getUnderlyingType(); + mizvekov wro

[clang] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-08-22 Thread Matheus Izvekov via cfe-commits
@@ -74,6 +74,13 @@ QualType clang::desugarForDiagnostic(ASTContext &Context, QualType QT, QT = AT->desugar(); continue; } +// ... or an overflow behavior type. +if (const OverflowBehaviorType *OBT = dyn_cast(Ty)) { + if (!OBT->isSugared()) +

[clang] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-08-22 Thread Matheus Izvekov via cfe-commits
@@ -6660,6 +6672,51 @@ class BTFTagAttributedType : public Type, public llvm::FoldingSetNode { } }; +class OverflowBehaviorType : public Type, public llvm::FoldingSetNode { +public: + enum OverflowBehaviorKind { Wrap, NoWrap }; + +private: + friend class ASTContext; // AS

[clang] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-08-22 Thread Matheus Izvekov via cfe-commits
@@ -11710,6 +11809,48 @@ QualType ASTContext::mergeTagDefinitions(QualType LHS, QualType RHS) { return Ctx.IsEquivalent(LHS, RHS) ? LHS : QualType{}; } +std::optional ASTContext::tryMergeOverflowBehaviorTypes( +QualType LHS, QualType RHS, bool OfBlockPointer, bool Unqua

[clang] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-08-22 Thread Matheus Izvekov via cfe-commits
@@ -870,6 +870,42 @@ ASTContext::insertCanonicalTemplateTemplateParmDeclInternal( return CanonTTP; } +/// For the purposes of overflow pattern exclusion, does this match the +/// while(i--) pattern? +static bool matchesPostDecrInWhile(const UnaryOperator *UO, ASTContext &Ct

[clang] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-08-22 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/148914 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-08-22 Thread Matheus Izvekov via cfe-commits
@@ -649,6 +649,10 @@ template <> const CountAttributedType *Type::getAs() const { return getAsSugar(this); } +template <> const OverflowBehaviorType *Type::getAs() const { + return getAsSugar(this); +} mizvekov wrote: The `OverflowBehaviorType` is never a

[clang] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-08-22 Thread Matheus Izvekov via cfe-commits
@@ -14308,6 +14455,12 @@ static QualType getCommonNonSugarTypeNode(const ASTContext &Ctx, const Type *X, getCommonTypeKeyword(NX, NY, /*IsSame=*/true), getCommonQualifier(Ctx, NX, NY, /*IsSame=*/true), NX->getIdentifier()); } + case Type::OverflowBehavior: {

[clang] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-08-22 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov commented: Some comments, I will try a more through review later. https://github.com/llvm/llvm-project/pull/148914 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

[clang] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-08-22 Thread Matheus Izvekov via cfe-commits
@@ -3780,6 +3780,11 @@ void MicrosoftCXXNameMangler::mangleType(const HLSLInlineSpirvType *T, llvm_unreachable("HLSL uses Itanium name mangling"); } +void MicrosoftCXXNameMangler::mangleType(const OverflowBehaviorType *T, + Qualifiers

[clang-tools-extra] [clang-tidy] performance-unnecessary-copy-initialization: Enhance the check for the scenario with MemberExpr initialization. (PR #151936)

2025-08-22 Thread via cfe-commits
@@ -273,6 +273,18 @@ void UnnecessaryCopyInitialization::registerMatchers(MatchFinder *Finder) { Finder->addMatcher(LocalVarCopiedFrom(declRefExpr( to(varDecl(hasLocalStorage()).bind(OldVarDeclId, this); + + auto DeclRefToCo

[clang-tools-extra] [clang-tidy] performance-unnecessary-copy-initialization: Enhance the check for the scenario with MemberExpr initialization. (PR #151936)

2025-08-22 Thread via cfe-commits
https://github.com/movie-travel-code updated https://github.com/llvm/llvm-project/pull/151936 >From 9407d65c12f95e961354e39df4357db850dd2f4f Mon Sep 17 00:00:00 2001 From: wangliushuai Date: Mon, 4 Aug 2025 17:45:38 +0800 Subject: [PATCH 01/12] [clang-tidy] Enhance the check for unnecessary cop

[clang] [HLSL] Global resource arrays element access (PR #152454)

2025-08-22 Thread Shafik Yaghmour via cfe-commits
@@ -84,6 +85,111 @@ void addRootSignature(llvm::dxbc::RootSignatureVersion RootSigVer, RootSignatureValMD->addOperand(MDVals); } +// Find array variable declaration from nested array subscript AST nodes +static const ValueDecl *getArrayDecl(const ArraySubscriptExpr *ASE) {

[clang] [HLSL] Global resource arrays element access (PR #152454)

2025-08-22 Thread Shafik Yaghmour via cfe-commits
@@ -84,6 +85,111 @@ void addRootSignature(llvm::dxbc::RootSignatureVersion RootSigVer, RootSignatureValMD->addOperand(MDVals); } +// Find array variable declaration from nested array subscript AST nodes +static const ValueDecl *getArrayDecl(const ArraySubscriptExpr *ASE) {

[clang] [CIR] Add VTTAddrPointOp (PR #155048)

2025-08-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clangir Author: Andy Kaylor (andykaylor) Changes This adds the definition, verification, and lowering for CIR's VTTAddrPointOp. This is a bit ahead of the current codegen implementation, which doesn't yet have support for emitting VTT definitions, but

[clang] [CIR] Add VTTAddrPointOp (PR #155048)

2025-08-22 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor created https://github.com/llvm/llvm-project/pull/155048 This adds the definition, verification, and lowering for CIR's VTTAddrPointOp. This is a bit ahead of the current codegen implementation, which doesn't yet have support for emitting VTT definitions, but sinc

[clang] [WebKit checkers] Treat asm brk as trivial (PR #155046)

2025-08-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-static-analyzer-1 Author: Ryosuke Niwa (rniwa) Changes Like other functions which results in abort, treat asm brk instruction as trivial. --- Full diff: https://github.com/llvm/llvm-project/pull/155046.diff 2 Files Affected: - (modified) clang

[clang] [WebKit checkers] Treat asm brk as trivial (PR #155046)

2025-08-22 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa created https://github.com/llvm/llvm-project/pull/155046 Like other functions which results in abort, treat asm brk instruction as trivial. >From 9d3e26d1ef48d87d9a98969f74a2363c5039fe04 Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Fri, 22 Aug 2025 15:57:45 -0700

[clang] [clang] constexpr `__builtin_elementwise_abs` support (PR #152497)

2025-08-22 Thread via cfe-commits
@@ -876,3 +876,21 @@ static_assert(__builtin_elementwise_min(~0U, 0U) == 0U); static_assert(__builtin_bit_cast(unsigned, __builtin_elementwise_min((vector4char){1, -2, 3, -4}, (vector4char){4, -3, 2, -1})) == (LITTLE_END ? 0xFC02FD01 : 0x01FD02FC)); static_assert(__builtin_bit

[clang] [Clang] disallow # operators in attribute argument lists (PR #147308)

2025-08-22 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `openmp-offload-amdgpu-runtime-2` running on `rocm-worker-hw-02` while building `clang` at step 6 "test-openmp". Full details are available at: https://lab.llvm.org/buildbot/#/builders/10/builds/12034 Here is the relevant pi

[clang] [CIR] Add verifier for vtable initializer (PR #155031)

2025-08-22 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/155031 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add support for emitting multi-vtables (PR #155027)

2025-08-22 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/155027 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add BreakAfterOpenBracket* and BreakBeforeCloseBracket* (PR #108332)

2025-08-22 Thread Gedare Bloom via cfe-commits
gedare wrote: I don't know why the docs aren't building. https://github.com/llvm/llvm-project/pull/108332 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lldb] [UBSan][BoundsSafety] Implement support for more expressive "trap reasons" (PR #154618)

2025-08-22 Thread Dan Liew via cfe-commits
delcypher wrote: @Sirraide @ilovepi I've changed the implementation to use a `TrapReason` object to store the trap message and category. This allows cleaning up the `TrapDiagnosticBuilder` API (maybe it should be called `TrapReasonBuilder` now?) so it's much more similar to the `DiagnosticBui

[clang] [CIR] Add verifier for vtable initializer (PR #155031)

2025-08-22 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor updated https://github.com/llvm/llvm-project/pull/155031 >From fd0bd309c13adba6966cfafbc884cb378e0212c4 Mon Sep 17 00:00:00 2001 From: Andy Kaylor Date: Fri, 22 Aug 2025 14:23:50 -0700 Subject: [PATCH 1/2] [CIR] Add verifier for vtable initializer This adds verifi

[clang] [Clang] Enable constexpr handling for builtin elementwise fshl/fshr (PR #153572)

2025-08-22 Thread Chaitanya Koparkar via cfe-commits
ckoparkar wrote: The other PRs this required have been merged, this is ready for review again. https://github.com/llvm/llvm-project/pull/153572 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-

[clang] [CIR] Add verifier for vtable initializer (PR #155031)

2025-08-22 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 HEAD~1 HEAD --extensions h,cpp -- clang/include/clang/CIR/MissingFeatures.h clang/li

[clang] [clang-format] Add BreakAfterOpenBracket* and BreakBeforeCloseBracket* (PR #108332)

2025-08-22 Thread Gedare Bloom via cfe-commits
https://github.com/gedare edited https://github.com/llvm/llvm-project/pull/108332 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add verifier for vtable initializer (PR #155031)

2025-08-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clangir Author: Andy Kaylor (andykaylor) Changes This adds verification for the initializer, if present, of any global passed to the `cir.vtable.address_point` op. --- Full diff: https://github.com/llvm/llvm-project/pull/155031.diff 3 Files Affected:

[clang] [CIR] Add verifier for vtable initializer (PR #155031)

2025-08-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Andy Kaylor (andykaylor) Changes This adds verification for the initializer, if present, of any global passed to the `cir.vtable.address_point` op. --- Full diff: https://github.com/llvm/llvm-project/pull/155031.diff 3 Files Affected:

[clang] [CIR] Add verifier for vtable initializer (PR #155031)

2025-08-22 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor created https://github.com/llvm/llvm-project/pull/155031 This adds verification for the initializer, if present, of any global passed to the `cir.vtable.address_point` op. >From fd0bd309c13adba6966cfafbc884cb378e0212c4 Mon Sep 17 00:00:00 2001 From: Andy Kaylor D

[clang] [clang-tools-extra] [clang] Improve nested name specifier AST representation (PR #147835)

2025-08-22 Thread Matheus Izvekov via cfe-commits
@@ -2586,8 +2561,9 @@ bool CXXNameMangler::mangleUnresolvedTypeOrSimpleId(QualType Ty, } case Type::InjectedClassName: -mangleSourceNameWithAbiTags( -cast(Ty)->getDecl()); +mangleSourceNameWithAbiTags(cast(Ty) +->getOrig

[clang] [clang-tools-extra] [clang] AST: fix getAs canonicalization of leaf types (PR #155028)

2025-08-22 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/155028 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Enable constexpr handling for builtin elementwise fshl/fshr (PR #153572)

2025-08-22 Thread Chaitanya Koparkar via cfe-commits
https://github.com/ckoparkar updated https://github.com/llvm/llvm-project/pull/153572 >From 487266d5e53ff7d0aa57c26377c2443bc734b4fd Mon Sep 17 00:00:00 2001 From: Chaitanya Koparkar Date: Wed, 13 Aug 2025 08:13:03 -0400 Subject: [PATCH 1/2] [Clang] Enable constexpr handling for builtin element

[clang] [CIR][NFC] Fix build warning in getCIRSourceLanguage (PR #155029)

2025-08-22 Thread Andy Kaylor via cfe-commits
andykaylor wrote: @seven-mile This fixes a warning introduced in https://github.com/llvm/llvm-project/pull/152511 https://github.com/llvm/llvm-project/pull/155029 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/m

[clang] [CIR][NFC] Fix build warning in getCIRSourceLanguage (PR #155029)

2025-08-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Andy Kaylor (andykaylor) Changes The getCIRSourceLanguage wasn't returning a value if the source language was anything other than C or C++. This change updates that function to return a std::optional value and only adds the source languag

[clang] [CIR][NFC] Fix build warning in getCIRSourceLanguage (PR #155029)

2025-08-22 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor created https://github.com/llvm/llvm-project/pull/155029 The getCIRSourceLanguage wasn't returning a value if the source language was anything other than C or C++. This change updates that function to return a std::optional value and only adds the source language

[clang] [Clang](NFC) Add coverage for VTable debug info (PR #151818)

2025-08-22 Thread Carlos Alberto Enciso via cfe-commits
https://github.com/CarlosAlbertoEnciso edited https://github.com/llvm/llvm-project/pull/151818 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Enable constexpr handling for builtin elementwise fshl/fshr (PR #153572)

2025-08-22 Thread Chaitanya Koparkar via cfe-commits
https://github.com/ckoparkar updated https://github.com/llvm/llvm-project/pull/153572 >From 487266d5e53ff7d0aa57c26377c2443bc734b4fd Mon Sep 17 00:00:00 2001 From: Chaitanya Koparkar Date: Wed, 13 Aug 2025 08:13:03 -0400 Subject: [PATCH 1/2] [Clang] Enable constexpr handling for builtin element

[clang] [Clang] Enable constexpr handling for builtin elementwise fshl/fshr (PR #153572)

2025-08-22 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 HEAD~1 HEAD --extensions cpp -- clang/lib/AST/ByteCode/InterpBuiltin.cpp clang/lib/AS

[clang] [clang][PAC] Fix builtins that claim address discriminated types are bitwise compatible (PR #154490)

2025-08-22 Thread John McCall via cfe-commits
@@ -74,7 +74,7 @@ static_assert(__is_trivially_destructible(S3)); static_assert(!__is_trivially_copyable(S3)); static_assert(!__is_trivially_relocatable(S3)); // expected-warning{{deprecated}} //FIXME -static_assert(__builtin_is_cpp_trivially_relocatable(S3)); +static_assert(!

[clang] [clang-tools-extra] [clang] AST: fix getAs canonicalization of leaf types (PR #155028)

2025-08-22 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/155028 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Enable constexpr handling for builtin elementwise fshl/fshr (PR #153572)

2025-08-22 Thread Chaitanya Koparkar via cfe-commits
https://github.com/ckoparkar updated https://github.com/llvm/llvm-project/pull/153572 >From 487266d5e53ff7d0aa57c26377c2443bc734b4fd Mon Sep 17 00:00:00 2001 From: Chaitanya Koparkar Date: Wed, 13 Aug 2025 08:13:03 -0400 Subject: [PATCH 1/2] [Clang] Enable constexpr handling for builtin element

[clang] [Clang](NFC) Add coverage for VTable debug info (PR #151818)

2025-08-22 Thread Carlos Alberto Enciso via cfe-commits
https://github.com/CarlosAlbertoEnciso edited https://github.com/llvm/llvm-project/pull/151818 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang] AST: fix getAs canonicalization of leaf types (PR #155028)

2025-08-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-modules Author: Matheus Izvekov (mizvekov) Changes Before this patch, the application of getAs and castAs on a leaf type would always produce a canonical type, which is undesirable because some of these types can be sugared. The user expectation

[clang] [clang-tools-extra] [clang] AST: fix getAs canonicalization of leaf types (PR #155028)

2025-08-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Matheus Izvekov (mizvekov) Changes Before this patch, the application of getAs and castAs on a leaf type would always produce a canonical type, which is undesirable because some of these types can be sugared. The user expectation

[clang] [clang-tools-extra] [clang] AST: fix getAs canonicalization of leaf types (PR #155028)

2025-08-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-risc-v Author: Matheus Izvekov (mizvekov) Changes Before this patch, the application of getAs and castAs on a leaf type would always produce a canonical type, which is undesirable because some of these types can be sugared. The user expectatio

[clang] [clang-tools-extra] [clang] AST: fix getAs canonicalization of leaf types (PR #155028)

2025-08-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-mips Author: Matheus Izvekov (mizvekov) Changes Before this patch, the application of getAs and castAs on a leaf type would always produce a canonical type, which is undesirable because some of these types can be sugared. The user expectation

[clang] [clang-tools-extra] [clang] AST: fix getAs canonicalization of leaf types (PR #155028)

2025-08-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clangd Author: Matheus Izvekov (mizvekov) Changes Before this patch, the application of getAs and castAs on a leaf type would always produce a canonical type, which is undesirable because some of these types can be sugared. The user expectation is tha

[clang] [clang-tools-extra] [clang] AST: fix getAs canonicalization of leaf types (PR #155028)

2025-08-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Matheus Izvekov (mizvekov) Changes Before this patch, the application of getAs and castAs on a leaf type would always produce a canonical type, which is undesirable because some of these types can be sugared. The user expectation is that

[clang] [clang-tools-extra] [clang] AST: fix getAs canonicalization of leaf types (PR #155028)

2025-08-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-hexagon Author: Matheus Izvekov (mizvekov) Changes Before this patch, the application of getAs and castAs on a leaf type would always produce a canonical type, which is undesirable because some of these types can be sugared. The user expectati

[clang] [clang-tools-extra] [clang] AST: fix getAs canonicalization of leaf types (PR #155028)

2025-08-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-sparc Author: Matheus Izvekov (mizvekov) Changes Before this patch, the application of getAs and castAs on a leaf type would always produce a canonical type, which is undesirable because some of these types can be sugared. The user expectation

  1   2   3   4   5   >