[clang-tools-extra] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-12 Thread via cfe-commits
@@ -0,0 +1,31 @@ +.. title:: clang-tidy - readability-use-std-min-max + +readability-use-std-min-max +=== + +Replaces certain conditional statements with equivalent ``std::min`` or ``std::max`` expressions, +improving readability and promoting the use of

[clang-tools-extra] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-12 Thread via cfe-commits
@@ -0,0 +1,31 @@ +.. title:: clang-tidy - readability-use-std-min-max + +readability-use-std-min-max +=== + +Replaces certain conditional statements with equivalent ``std::min`` or ``std::max`` expressions, +improving readability and promoting the use of

[clang-tools-extra] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-12 Thread via cfe-commits
@@ -0,0 +1,31 @@ +.. title:: clang-tidy - readability-use-std-min-max + +readability-use-std-min-max +=== + +Replaces certain conditional statements with equivalent ``std::min`` or ``std::max`` expressions, +improving readability and promoting the use of

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-12 Thread Mark de Wever via cfe-commits
https://github.com/mordante updated https://github.com/llvm/llvm-project/pull/76451 >From f3f0db64da4d341f8e4a2054f9f25c87f8eda829 Mon Sep 17 00:00:00 2001 From: Mark de Wever Date: Wed, 27 Dec 2023 17:34:10 +0100 Subject: [PATCH 1/4] [clang][modules] Print library module manifest path. This i

[clang] [clang][ASTImporter] Improve structural equivalence of overloadable operators. (PR #72242)

2024-01-12 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/72242 From 5300f979c96eb2f88c298872f0519e274c155cfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Tue, 14 Nov 2023 11:53:20 +0100 Subject: [PATCH 1/3] [clang][ASTImporter] Improve structural

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-12 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 8cf6bcf5a30673dd8a234ae3ef4ab4c1e63786b1 a8f9dc9edd98416a84d524ca6b233a27882f5085 --

[clang] [clang][ASTImporter] Improve structural equivalence of overloadable operators. (PR #72242)

2024-01-12 Thread Balázs Kéri via cfe-commits
@@ -2252,6 +2252,176 @@ TEST_F(StructuralEquivalenceStmtTest, UnaryOperatorDifferentOps) { EXPECT_FALSE(testStructuralMatch(t)); } +TEST_F(StructuralEquivalenceStmtTest, + CXXOperatorCallExprVsUnaryBinaryOperator) { + auto t = makeNamedDecls( + R"( + templa

[clang] [clang] Add test for CWG1807 (PR #77637)

2024-01-12 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/77637 >From 545ee4900e48b186e1c9fff93dc62a459ee19754 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Wed, 10 Jan 2024 20:27:53 +0300 Subject: [PATCH 1/7] [clang] Add test for CWG1807 The test checks that objec

[llvm] [clang] [PowerPC][X86] Make cpu id builtins target independent and lower for PPC (PR #68919)

2024-01-12 Thread via cfe-commits
@@ -16086,6 +16086,41 @@ Value *CodeGenFunction::EmitPPCBuiltinExpr(unsigned BuiltinID, switch (BuiltinID) { default: return nullptr; + case Builtin::BI__builtin_cpu_is: { +const Expr *CPUExpr = E->getArg(0)->IgnoreParenCasts(); +StringRef CPUStr = cast(CPUExpr)-

[clang] [clang][ASTImporter] Fix import of variable template redeclarations. (PR #72841)

2024-01-12 Thread Balázs Kéri via cfe-commits
@@ -6245,17 +6245,21 @@ ExpectedDecl ASTNodeImporter::VisitVarTemplateDecl(VarTemplateDecl *D) { D->getTemplatedDecl())) continue; if (IsStructuralMatch(D, FoundTemplate)) { -// The Decl in the "From" context

[clang] [clang] Add test for CWG1807 (PR #77637)

2024-01-12 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: Following the suggestion from @nikic, I prepared two variants of the same test, one hard-written, and one using `update_cc_test_checks.py` (with heavy manual editing afterwards). Hand-written: ``` // CHECK-LABEL: define dso_local void @dr1807::f() // CHECK: invo

[clang-tools-extra] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-12 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy updated https://github.com/llvm/llvm-project/pull/77816 >From 1883d987b2f83adaef05fdb47ae25c7b06582a64 Mon Sep 17 00:00:00 2001 From: 11happy Date: Fri, 12 Jan 2024 00:02:46 +0530 Subject: [PATCH 01/13] Add readability check to suggest replacement of conditional stat

[clang] [llvm] [AArch64][SME2] Refine fcvtu/fcvts/scvtf/ucvtf (PR #77947)

2024-01-12 Thread Matthew Devereau via cfe-commits
https://github.com/MDevereau created https://github.com/llvm/llvm-project/pull/77947 Rename intrinsics for fcvtu to fcvtzu and fcvts to fcvtzs. Use llvm_anyvector_ty for both multi vector returns and operands, therefore the return and operands can be specified in the intrinsic call, e.g. @llv

[clang] [llvm] [AArch64][SME2] Refine fcvtu/fcvts/scvtf/ucvtf (PR #77947)

2024-01-12 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-llvm-ir @llvm/pr-subscribers-clang-codegen @llvm/pr-subscribers-backend-aarch64 Author: Matthew Devereau (MDevereau) Changes Rename intrinsics for fcvtu to fcvtzu and fcvts to fcvtzs. Use llvm_anyvector_ty for both multi vector returns and operands, the

[clang-tools-extra] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-12 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,31 @@ +.. title:: clang-tidy - readability-use-std-min-max + +readability-use-std-min-max +=== + +Replaces certain conditional statements with equivalent ``std::min`` or ``std::max`` expressions, +improving readability and promoting the use of

[clang] [clang] Add test for CWG1807 (PR #77637)

2024-01-12 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > This brings me to conclusion that hand-written style of codegen tests > presented above is a better fit for purposes of C++ defect report codegen > tests. I share that conclusion. I think the hand-written IR is easier for people to reason because it strips out unrelated

[clang] [RISCV] Support __riscv_v_fixed_vlen for vbool types. (PR #76551)

2024-01-12 Thread Craig Topper via cfe-commits
topperc wrote: Ping https://github.com/llvm/llvm-project/pull/76551 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[flang] [llvm] [compiler-rt] [lld] [libcxx] [clang] [mlir] [lldb] [clang-tools-extra] [DWARFLinker][NFC] Decrease DWARFLinker dependence on DwarfStreamer. (PR #77932)

2024-01-12 Thread Alexey Lapshin via cfe-commits
https://github.com/avl-llvm updated https://github.com/llvm/llvm-project/pull/77932 >From 30a603f6d37afecdb2cb150bd98acd27c8d8baf5 Mon Sep 17 00:00:00 2001 From: Alexey Lapshin Date: Fri, 12 Jan 2024 13:07:33 +0300 Subject: [PATCH] [DWARFLinker][NFC] Decrease DWARFLinker dependence on DwarfStr

[clang] [APINotes] Upstream Sema logic to apply API Notes to decls (PR #73017)

2024-01-12 Thread Saleem Abdulrasool via cfe-commits
@@ -2622,6 +2641,31 @@ def SwiftPrivate : InheritableAttr { let SimpleHandler = 1; } +def SwiftVersioned : Attr { + // This attribute has no spellings as it is only ever created implicitly + // from API notes. + let Spellings = []; + let Args = [VersionArgument<"Version"

[clang] [APINotes] Upstream Sema logic to apply API Notes to decls (PR #73017)

2024-01-12 Thread Saleem Abdulrasool via cfe-commits
@@ -301,6 +301,9 @@ class VariadicEnumArgument values, bit IsExternalType = isExternalType; } +// Represents an attribute wrapped by another attribute. +class AttrArgument : Argument; compnerd wrote: Does it make sense to name this `WrappedAttribute` instea

[clang] [APINotes] Upstream Sema logic to apply API Notes to decls (PR #73017)

2024-01-12 Thread Saleem Abdulrasool via cfe-commits
@@ -2601,6 +2604,22 @@ def SwiftError : InheritableAttr { let Documentation = [SwiftErrorDocs]; } +def SwiftImportAsNonGeneric : InheritableAttr { compnerd wrote: Wasn't this attribute dropped? I thought that the last usage of this was removed from the SD

[clang] [APINotes] Upstream Sema logic to apply API Notes to decls (PR #73017)

2024-01-12 Thread Saleem Abdulrasool via cfe-commits
@@ -2622,6 +2641,31 @@ def SwiftPrivate : InheritableAttr { let SimpleHandler = 1; } +def SwiftVersioned : Attr { compnerd wrote: I think that we should name this `SwiftVersionedAddition` to match the `SwiftVersionedRemoval`. https://github.com/llvm/llvm-

[clang] [libcxx] [SemaCXX] Implement CWG2137 (list-initialization from objects of the same type) (PR #77768)

2024-01-12 Thread Mark de Wever via cfe-commits
https://github.com/mordante approved this pull request. Thanks @cor3ntin. The patch still looks fine from libc++'s PoV. https://github.com/llvm/llvm-project/pull/77768 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-b

[clang-tools-extra] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-12 Thread via cfe-commits
@@ -0,0 +1,31 @@ +.. title:: clang-tidy - readability-use-std-min-max + +readability-use-std-min-max +=== + +Replaces certain conditional statements with equivalent ``std::min`` or ``std::max`` expressions, +improving readability and promoting the use of

[clang-tools-extra] 3af6ae0 - [clang-tidy] Fix false-positives in misc-static-assert caused by non-constexpr variables (#77203)

2024-01-12 Thread via cfe-commits
Author: Piotr Zegar Date: 2024-01-12T18:33:49+01:00 New Revision: 3af6ae0fbea40097e159c11893ee7ab57d00480c URL: https://github.com/llvm/llvm-project/commit/3af6ae0fbea40097e159c11893ee7ab57d00480c DIFF: https://github.com/llvm/llvm-project/commit/3af6ae0fbea40097e159c11893ee7ab57d00480c.diff L

[clang-tools-extra] [clang-tidy] Fix false-positives in misc-static-assert caused by non-constexpr variables (PR #77203)

2024-01-12 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/77203 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [compiler-rt] [flang] [llvm] [clang] Add test for CWG1807 (PR #77637)

2024-01-12 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/77637 >From 545ee4900e48b186e1c9fff93dc62a459ee19754 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Wed, 10 Jan 2024 20:27:53 +0300 Subject: [PATCH 1/7] [clang] Add test for CWG1807 The test checks that objec

[llvm] [clang] [clang-tools-extra] [flang] [compiler-rt] [clang] Add test for CWG1807 (PR #77637)

2024-01-12 Thread Erich Keane via cfe-commits
erichkeane wrote: > > This brings me to conclusion that hand-written style of codegen tests > > presented above is a better fit for purposes of C++ defect report codegen > > tests. > > I share that conclusion. I think the hand-written IR is easier for people to > reason because it strips out

[clang-tools-extra] [clang-tid]fix modernize-use-auto incorrect fix hints for pointer (PR #77943)

2024-01-12 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL requested changes to this pull request. Missing tests for arrays and function pointers to confirm that fix work. + some nits or possible improvments https://github.com/llvm/llvm-project/pull/77943 ___ cfe-commits mailing lis

[clang-tools-extra] [clang-tid]fix modernize-use-auto incorrect fix hints for pointer (PR #77943)

2024-01-12 Thread Piotr Zegar via cfe-commits
@@ -333,6 +335,26 @@ void UseAutoCheck::replaceIterators(const DeclStmt *D, ASTContext *Context) { << FixItHint::CreateReplacement(Range, "auto"); } +namespace { + +void ignoreTypeLocClasses( PiotrZSL wrote: use static instead of anonymous namespace h

[clang-tools-extra] [clang-tid]fix modernize-use-auto incorrect fix hints for pointer (PR #77943)

2024-01-12 Thread Piotr Zegar via cfe-commits
@@ -333,6 +335,26 @@ void UseAutoCheck::replaceIterators(const DeclStmt *D, ASTContext *Context) { << FixItHint::CreateReplacement(Range, "auto"); } +namespace { + +void ignoreTypeLocClasses( +TypeLoc &Loc, llvm::SmallVector const &LocClasses) { + while (llvm::is_c

[clang-tools-extra] [clang-tid]fix modernize-use-auto incorrect fix hints for pointer (PR #77943)

2024-01-12 Thread Piotr Zegar via cfe-commits
@@ -405,12 +421,20 @@ void UseAutoCheck::replaceExpr( auto Diag = diag(Range.getBegin(), Message); + bool ShouldReplenishVariableName = isMutliLevelPointerToTypeLocClasses( + FirstDecl->getTypeSourceInfo()->getTypeLoc(), PiotrZSL wrote: Would be nice

[clang-tools-extra] [clang-tid]fix modernize-use-auto incorrect fix hints for pointer (PR #77943)

2024-01-12 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/77943 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tid]fix modernize-use-auto incorrect fix hints for pointer (PR #77943)

2024-01-12 Thread Piotr Zegar via cfe-commits
@@ -333,6 +335,26 @@ void UseAutoCheck::replaceIterators(const DeclStmt *D, ASTContext *Context) { << FixItHint::CreateReplacement(Range, "auto"); } +namespace { + +void ignoreTypeLocClasses( +TypeLoc &Loc, llvm::SmallVector const &LocClasses) { + while (llvm::is_c

[clang-tools-extra] [clang-tid]fix modernize-use-auto incorrect fix hints for pointer (PR #77943)

2024-01-12 Thread Piotr Zegar via cfe-commits
@@ -333,6 +335,26 @@ void UseAutoCheck::replaceIterators(const DeclStmt *D, ASTContext *Context) { << FixItHint::CreateReplacement(Range, "auto"); } +namespace { + +void ignoreTypeLocClasses( +TypeLoc &Loc, llvm::SmallVector const &LocClasses) { Pio

[clang-tools-extra] [clang-tid]fix modernize-use-auto incorrect fix hints for pointer (PR #77943)

2024-01-12 Thread Piotr Zegar via cfe-commits
@@ -405,12 +421,20 @@ void UseAutoCheck::replaceExpr( auto Diag = diag(Range.getBegin(), Message); + bool ShouldReplenishVariableName = isMutliLevelPointerToTypeLocClasses( + FirstDecl->getTypeSourceInfo()->getTypeLoc(), + {TypeLoc::FunctionProto, TypeLoc::Consta

[clang] [BoundsSafety] Initial documentation for -fbounds-safety (PR #70749)

2024-01-12 Thread Yeoul Na via cfe-commits
rapidsna wrote: > Thank you for the updates; the changes LGTM! @AaronBallman Thanks for your review and insightful feedback! https://github.com/llvm/llvm-project/pull/70749 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org

[clang-tools-extra] [clang-tidy] Fix false-positives in readability-container-size-empty (PR #74140)

2024-01-12 Thread Justin Cady via cfe-commits
https://github.com/justincady approved this pull request. [Context](https://github.com/llvm/llvm-project/pull/77203#pullrequestreview-1818501835). LGTM. https://github.com/llvm/llvm-project/pull/74140 ___ cfe-commits mailing list cfe-commits@lists.llv

[clang] [llvm] [X86] Add "Ws" constraint and "p" modifier for symbolic address/label reference (PR #77886)

2024-01-12 Thread Fangrui Song via cfe-commits
@@ -5336,6 +5336,7 @@ X86: operand in a SSE register. If AVX is also enabled, can also be a 256-bit vector operand in an AVX register. If AVX-512 is also enabled, can also be a 512-bit vector operand in an AVX512 register. Otherwise, an error. +- ``Ws``: A symbolic refere

[llvm] [clang-tools-extra] [libclc] [libc] [lld] [lldb] [clang] [libcxx] [libcxxabi] [flang] [libunwind] [compiler-rt] [builtins] Generate __multc3 for z/OS (PR #77554)

2024-01-12 Thread Alexander Richardson via cfe-commits
@@ -374,10 +376,10 @@ static __inline fp_t __compiler_rt_fmax(fp_t x, fp_t y) { #endif } -#elif defined(QUAD_PRECISION) && defined(CRT_HAS_TF_MODE) +#elif defined(QUAD_PRECISION) arichardson wrote: Looks like this was actually required. Probably needs to be c

[clang] [Clang][SME] Detect always_inline used with mismatched streaming attributes (PR #77936)

2024-01-12 Thread Jon Roelofs via cfe-commits
@@ -812,6 +819,23 @@ Address AArch64ABIInfo::EmitMSVAArg(CodeGenFunction &CGF, Address VAListAddr, /*allowHigherAlign*/ false); } +void AArch64TargetCodeGenInfo::checkFunctionCallABI( +CodeGenModule &CGM, SourceLocation CallLoc, const FunctionDec

[clang] [Clang][SME] Detect always_inline used with mismatched streaming attributes (PR #77936)

2024-01-12 Thread Jon Roelofs via cfe-commits
https://github.com/jroelofs edited https://github.com/llvm/llvm-project/pull/77936 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 3bbc912 - [Driver,test] Update sanitizer test after RequiresPIE removal #77689

2024-01-12 Thread Fangrui Song via cfe-commits
Author: Fangrui Song Date: 2024-01-12T10:09:53-08:00 New Revision: 3bbc912d37f03d9ad3be330b81d91c2eaf6c37f2 URL: https://github.com/llvm/llvm-project/commit/3bbc912d37f03d9ad3be330b81d91c2eaf6c37f2 DIFF: https://github.com/llvm/llvm-project/commit/3bbc912d37f03d9ad3be330b81d91c2eaf6c37f2.diff

[llvm] [clang-tools-extra] [lldb] [libcxx] [clang] [flang] [mlir] [X86] Add "Ws" constraint and "p" modifier for symbolic address/label reference (PR #77886)

2024-01-12 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay updated https://github.com/llvm/llvm-project/pull/77886 >From f5a33f9e6893250e3584a77630b771ee76693c20 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Thu, 11 Jan 2024 23:42:38 -0800 Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?= =?UTF

[llvm] [clang-tools-extra] [lldb] [libcxx] [clang] [flang] [mlir] [X86] Add "Ws" constraint and "p" modifier for symbolic address/label reference (PR #77886)

2024-01-12 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,34 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc -mtriple=i686 < %s | FileCheck %s +; RUN: llc -mtriple=x86_64 < %s | FileCheck %s + +@var = external dso_local global i32, align 4 + +define dso_local void @test() { +; CHEC

[llvm] [clang-tools-extra] [lldb] [libcxx] [clang] [flang] [mlir] [X86] Add "Ws" constraint and "p" modifier for symbolic address/label reference (PR #77886)

2024-01-12 Thread Fangrui Song via cfe-commits
@@ -56966,6 +56965,17 @@ void X86TargetLowering::LowerAsmOperandForConstraint(SDValue Op, } return; } + case 'W': { +assert(Constraint[1] == 's'); +if (const auto *GA = dyn_cast(Op)) { + Ops.push_back(DAG.getTargetGlobalAddress(GA->getGlobal(), SDLoc(Op

[clang] [Format] Fix isStartOfName to recognize attributes (PR #76804)

2024-01-12 Thread Owen Pan via cfe-commits
https://github.com/owenca approved this pull request. https://github.com/llvm/llvm-project/pull/76804 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenACC} Improve diagnostics for 'tag's on clauses/directives (PR #77957)

2024-01-12 Thread Erich Keane via cfe-commits
https://github.com/erichkeane created https://github.com/llvm/llvm-project/pull/77957 The 'cache' directive and various clauses have a 'tag' name that is optional. This patch cleans up the use of the 'cache' version so that we get a nicer diagnostic, and enables us to do the same with clauses

[clang] [OpenACC} Improve diagnostics for 'tag's on clauses/directives (PR #77957)

2024-01-12 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Erich Keane (erichkeane) Changes The 'cache' directive and various clauses have a 'tag' name that is optional. This patch cleans up the use of the 'cache' version so that we get a nicer diagnostic, and enables us to do the same with clau

[clang] [clang] Adjust -mlarge-data-threshold handling (PR #77958)

2024-01-12 Thread Arthur Eubanks via cfe-commits
https://github.com/aeubanks created https://github.com/llvm/llvm-project/pull/77958 Make it apply to x86-64 medium and large code models since that's what the backend does. Warn if it's used for x86-32. Default to 0, let the driver set it to 65536 for the medium code model if one is not passe

[clang] [BoundsSafety] Initial documentation for -fbounds-safety (PR #70749)

2024-01-12 Thread Yeoul Na via cfe-commits
rapidsna wrote: Rebased https://github.com/llvm/llvm-project/pull/70749 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Adjust -mlarge-data-threshold handling (PR #77958)

2024-01-12 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang @llvm/pr-subscribers-clang-driver Author: Arthur Eubanks (aeubanks) Changes Make it apply to x86-64 medium and large code models since that's what the backend does. Warn if it's used for x86-32. Default to 0, let the driver set it to 65536 for t

[clang] [OpenACC} Improve diagnostics for 'tag's on clauses/directives (PR #77957)

2024-01-12 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 e4d01bb2273804355cf84a8a560e578735590ac2 12f5f321bc47bffb2d1694e605288c59976022e6 --

[clang] [APINotes] Upstream Sema logic to apply API Notes to decls (PR #73017)

2024-01-12 Thread Saleem Abdulrasool via cfe-commits
@@ -15139,6 +15139,37 @@ void Sema::DiagnoseSizeOfParametersAndReturnValue( } } +QualType Sema::AdjustParameterTypeForObjCAutoRefCount(QualType T, + SourceLocation NameLoc, +

[clang] [APINotes] Upstream Sema logic to apply API Notes to decls (PR #73017)

2024-01-12 Thread Saleem Abdulrasool via cfe-commits
@@ -7539,74 +7559,65 @@ static NullabilityKind mapNullabilityAttrKind(ParsedAttr::Kind kind) { } } -/// Applies a nullability type specifier to the given type, if possible. -/// -/// \param state The type processing state. -/// -/// \param type The type to which the nullabi

[clang] [APINotes] Upstream Sema logic to apply API Notes to decls (PR #73017)

2024-01-12 Thread Saleem Abdulrasool via cfe-commits
@@ -15139,6 +15139,37 @@ void Sema::DiagnoseSizeOfParametersAndReturnValue( } } +QualType Sema::AdjustParameterTypeForObjCAutoRefCount(QualType T, + SourceLocation NameLoc, +

[clang] [APINotes] Upstream Sema logic to apply API Notes to decls (PR #73017)

2024-01-12 Thread Saleem Abdulrasool via cfe-commits
@@ -7519,6 +7519,26 @@ static bool HandleWebAssemblyFuncrefAttr(TypeProcessingState &State, return false; } +/// Rebuild an attributed type without the nullability attribute on it. +static QualType rebuildAttributedTypeWithoutNullability(ASTContext &Ctx, +

[clang] [APINotes] Upstream Sema logic to apply API Notes to decls (PR #73017)

2024-01-12 Thread Saleem Abdulrasool via cfe-commits
@@ -7539,74 +7559,65 @@ static NullabilityKind mapNullabilityAttrKind(ParsedAttr::Kind kind) { } } -/// Applies a nullability type specifier to the given type, if possible. -/// -/// \param state The type processing state. -/// -/// \param type The type to which the nullabi

[clang] [APINotes] Upstream Sema logic to apply API Notes to decls (PR #73017)

2024-01-12 Thread Saleem Abdulrasool via cfe-commits
@@ -7519,6 +7519,26 @@ static bool HandleWebAssemblyFuncrefAttr(TypeProcessingState &State, return false; } +/// Rebuild an attributed type without the nullability attribute on it. +static QualType rebuildAttributedTypeWithoutNullability(ASTContext &Ctx, +

[lldb] [clang] [clang-tools-extra] [llvm] [lldb][test] Add tests for target.max-string-summary-length setting (PR #77920)

2024-01-12 Thread Michael Buch via cfe-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/77920 >From 4de3716b55a22dc8b7dda621889089f390026739 Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Fri, 12 Jan 2024 12:34:16 + Subject: [PATCH 1/2] [lldb][test] Add tests for target.max-string-summary-lengt

[clang] 97a9dbb - [clang-format] Handle possible crash in `getCells` (#77723)

2024-01-12 Thread via cfe-commits
Author: XDeme Date: 2024-01-12T10:20:44-08:00 New Revision: 97a9dbb64919fe71379cda5f043633cbeb6438e5 URL: https://github.com/llvm/llvm-project/commit/97a9dbb64919fe71379cda5f043633cbeb6438e5 DIFF: https://github.com/llvm/llvm-project/commit/97a9dbb64919fe71379cda5f043633cbeb6438e5.diff LOG: [c

[clang] [clang-format] Handle possible crash in `getCells` (PR #77723)

2024-01-12 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/77723 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Adjust -mlarge-data-threshold handling (PR #77958)

2024-01-12 Thread Fangrui Song via cfe-commits
@@ -5752,20 +5752,29 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, } } - if (Arg *A = Args.getLastArg(options::OPT_mlarge_data_threshold_EQ)) { -if (!Triple.isX86()) { - D.Diag(diag::err_drv_unsupported_opt_for_target) - << A->getOp

[clang] [clang] Adjust -mlarge-data-threshold handling (PR #77958)

2024-01-12 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/77958 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenACC} Improve diagnostics for 'tag's on clauses/directives (PR #77957)

2024-01-12 Thread Alexey Bataev via cfe-commits
@@ -164,6 +164,49 @@ bool isOpenACCSpecialToken(OpenACCSpecialTokenKind Kind, Token Tok) { llvm_unreachable("Unknown 'Kind' Passed"); } +// Used for cases where we have a token we want to check against an +// 'identifier-like' token, but don't want to give awkward error mes

[clang] [OpenMP][USM] Adds test for -fopenmp-force-usm flag (PR #75467)

2024-01-12 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert approved this pull request. https://github.com/llvm/llvm-project/pull/75467 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AMDGPU] Add global_load_tr for GFX12 (PR #77772)

2024-01-12 Thread Changpeng Fang via cfe-commits
@@ -18178,6 +18178,51 @@ Value *CodeGenFunction::EmitAMDGPUBuiltinExpr(unsigned BuiltinID, llvm::Function *F = CGM.getIntrinsic(IID, {ArgTy}); return Builder.CreateCall(F, {Addr, Val, ZeroI32, ZeroI32, ZeroI1}); } + case AMDGPU::BI__builtin_amdgcn_global_load_tr_b64

[clang] [clang] Fix behavior of `__is_trivially_relocatable(volatile int)` (PR #77092)

2024-01-12 Thread John McCall via cfe-commits
@@ -2669,6 +2669,8 @@ bool QualType::isTriviallyRelocatableType(const ASTContext &Context) const { return false; } else if (const auto *RD = BaseElementType->getAsRecordDecl()) { return RD->canPassInRegisters(); + } else if (BaseElementType.isTriviallyCopyableType(C

[clang] [OpenACC} Improve diagnostics for 'tag's on clauses/directives (PR #77957)

2024-01-12 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/77957 >From 12f5f321bc47bffb2d1694e605288c59976022e6 Mon Sep 17 00:00:00 2001 From: erichkeane Date: Fri, 12 Jan 2024 09:30:54 -0800 Subject: [PATCH 1/3] [OpenACC} Improve diagnostics for 'tag's on clauses/directiv

[clang] [llvm] [LLVM][DWARF] Fix accelerator table switching between CU and TU (PR #77511)

2024-01-12 Thread Vitaly Buka via cfe-commits
vitalybuka wrote: Could this be caused by the patch https://lab.llvm.org/buildbot/#/builders/236/builds/8673 ? https://github.com/llvm/llvm-project/pull/77511 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailm

[clang] [OpenACC} Improve diagnostics for 'tag's on clauses/directives (PR #77957)

2024-01-12 Thread Alexey Bataev via cfe-commits
https://github.com/alexey-bataev edited https://github.com/llvm/llvm-project/pull/77957 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenACC} Improve diagnostics for 'tag's on clauses/directives (PR #77957)

2024-01-12 Thread Alexey Bataev via cfe-commits
https://github.com/alexey-bataev approved this pull request. LG with a nit https://github.com/llvm/llvm-project/pull/77957 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenACC} Improve diagnostics for 'tag's on clauses/directives (PR #77957)

2024-01-12 Thread Alexey Bataev via cfe-commits
@@ -164,6 +164,48 @@ bool isOpenACCSpecialToken(OpenACCSpecialTokenKind Kind, Token Tok) { llvm_unreachable("Unknown 'Kind' Passed"); } +// Used for cases where we have a token we want to check against an +// 'identifier-like' token, but don't want to give awkward error mes

[clang] [OpenACC} Improve diagnostics for 'tag's on clauses/directives (PR #77957)

2024-01-12 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/77957 >From 12f5f321bc47bffb2d1694e605288c59976022e6 Mon Sep 17 00:00:00 2001 From: erichkeane Date: Fri, 12 Jan 2024 09:30:54 -0800 Subject: [PATCH 1/4] [OpenACC} Improve diagnostics for 'tag's on clauses/directiv

[clang] [OpenACC} Improve diagnostics for 'tag's on clauses/directives (PR #77957)

2024-01-12 Thread Erich Keane via cfe-commits
erichkeane wrote: > LG with a nit Thanks for the super quick reviews! https://github.com/llvm/llvm-project/pull/77957 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][C++26] Implement Pack Indexing (P2662R3). (PR #72644)

2024-01-12 Thread Erich Keane via cfe-commits
@@ -4344,6 +4344,108 @@ class SizeOfPackExpr final } }; +class PackIndexingExpr final +: public Expr, + private llvm::TrailingObjects { + friend class ASTStmtReader; + friend class ASTStmtWriter; + friend TrailingObjects; + + SourceLocation EllipsisLoc; + + //

[clang] [Clang][C++26] Implement Pack Indexing (P2662R3). (PR #72644)

2024-01-12 Thread Erich Keane via cfe-commits
@@ -4344,6 +4344,108 @@ class SizeOfPackExpr final } }; +class PackIndexingExpr final +: public Expr, + private llvm::TrailingObjects { + friend class ASTStmtReader; + friend class ASTStmtWriter; + friend TrailingObjects; + + SourceLocation EllipsisLoc; + + //

[clang] [Clang][C++26] Implement Pack Indexing (P2662R3). (PR #72644)

2024-01-12 Thread Erich Keane via cfe-commits
@@ -1665,6 +1665,43 @@ NonTypeTemplateParmDecl *SubstNonTypeTemplateParmExpr::getParameter() const { getReplacedTemplateParameterList(getAssociatedDecl())->asArray()[Index]); } +PackIndexingExpr *PackIndexingExpr::Create(ASTContext &Context, +

[clang] [Clang][C++26] Implement Pack Indexing (P2662R3). (PR #72644)

2024-01-12 Thread Erich Keane via cfe-commits
@@ -3767,6 +3767,57 @@ void DependentDecltypeType::Profile(llvm::FoldingSetNodeID &ID, E->Profile(ID, Context, true); } +PackIndexingType::PackIndexingType(const ASTContext &Context, + QualType Canonical, QualType Pattern, +

[clang] [libcxx] [SemaCXX] Implement CWG2137 (list-initialization from objects of the same type) (PR #77768)

2024-01-12 Thread Vlad Serebrennikov via cfe-commits
@@ -132,6 +142,36 @@ namespace dr2126 { // dr2126: 12 #endif } +namespace dr2137 { // dr2137: 18 +#if __cplusplus >= 201103L + struct Q { +Q(); +Q(Q&&); +Q(std::initializer_list) = delete; // since-cxx11-note 2 {{has been explicitly marked deleted here}} + }; +

[libcxx] [clang] [SemaCXX] Implement CWG2137 (list-initialization from objects of the same type) (PR #77768)

2024-01-12 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll requested changes to this pull request. https://github.com/llvm/llvm-project/pull/77768 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libcxx] [clang] [SemaCXX] Implement CWG2137 (list-initialization from objects of the same type) (PR #77768)

2024-01-12 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/77768 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[openmp] [libcxx] [llvm] [mlir] [lld] [clang] [libc++] Deprecate the _LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS macro (PR #77692)

2024-01-12 Thread James Y Knight via cfe-commits
jyknight wrote: My suggestion on #69994 had been to stop implying `_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS` from `_LIBCPP_ENABLE_CXX20_REMOVED_FEATURES` in LLVM 18 at the same time as deprecating it. Did you intend to _not_ do that, or was it just missed? https://github.com/llvm/llvm-p

[clang] [clang] Adjust -mlarge-data-threshold handling (PR #77958)

2024-01-12 Thread Arthur Eubanks via cfe-commits
https://github.com/aeubanks updated https://github.com/llvm/llvm-project/pull/77958 >From 3a54757173faffe07da55223c52621691afad54d Mon Sep 17 00:00:00 2001 From: Arthur Eubanks Date: Fri, 12 Jan 2024 18:13:06 + Subject: [PATCH 1/2] [clang] Adjust -mlarge-data-threshold handling Make it app

[llvm] [clang] [CMake][PGO] Build Sema.cpp to generate profdata for PGO builds (PR #77347)

2024-01-12 Thread Tom Stellard via cfe-commits
@@ -26,9 +30,23 @@ if(LLVM_BUILD_INSTRUMENTED) message(STATUS "To enable merging PGO data LLVM_PROFDATA has to point to llvm-profdata") else() add_custom_target(generate-profdata - COMMAND "${Python3_EXECUTABLE}" ${CMAKE_CURRENT_SOURCE_DIR}/perf-helper.py merge

[clang] [AMDGPU] add function attrbute amdgpu-lib-fun (PR #74737)

2024-01-12 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > > An AMDGPU library function is not internalized and can be used to fullfill > > calls generated by LLVM passes or instruction selection. > > I am confused by the description of "internalized". Do you refer to LTO > internalization? You can leverage `llvm.used` to disable LTO

[clang] [llvm] [LLVM][DWARF] Fix accelerator table switching between CU and TU (PR #77511)

2024-01-12 Thread Alexander Yermolovich via cfe-commits
ayermolo wrote: > Could this be caused by the patch > https://lab.llvm.org/buildbot/#/builders/236/builds/8673 ? Passes for me locally. Also patch impacts .debug_names for DWARF. So highly unlikely it would cause this test to fail. https://github.com/llvm/llvm-project/pull/77511 _

[clang] [llvm] [clang-tools-extra] [AArch64][SVE2] Lower OR to SLI/SRI (PR #77555)

2024-01-12 Thread Usman Nadeem via cfe-commits
https://github.com/UsmanNadeem closed https://github.com/llvm/llvm-project/pull/77555 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [PowerPC][X86] Make cpu id builtins target independent and lower for PPC (PR #68919)

2024-01-12 Thread Amy Kwan via cfe-commits
https://github.com/amy-kwan edited https://github.com/llvm/llvm-project/pull/68919 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [PowerPC][X86] Make cpu id builtins target independent and lower for PPC (PR #68919)

2024-01-12 Thread Amy Kwan via cfe-commits
@@ -1,11 +1,16 @@ -// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -emit-llvm < %s| FileCheck %s +// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -emit-llvm < %s | FileCheck %s \ +// RUN: --check-prefix=CHECK-X86 +// RUN: %clang_cc1 -triple ppc64le-linux-gnu -emit-llvm < %s | File

[llvm] [clang] [PowerPC][X86] Make cpu id builtins target independent and lower for PPC (PR #68919)

2024-01-12 Thread Amy Kwan via cfe-commits
https://github.com/amy-kwan commented: I think I primarily have minor nit comments. Thank you for the update, Nemanja. https://github.com/llvm/llvm-project/pull/68919 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bi

[clang] [llvm] [PowerPC][X86] Make cpu id builtins target independent and lower for PPC (PR #68919)

2024-01-12 Thread Amy Kwan via cfe-commits
@@ -210,6 +210,15 @@ let TargetPrefix = "ppc" in { // All intrinsics start with "llvm.ppc.". [llvm_float_ty], [llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_vararg_ty], [IntrNoMem]>; + // Load of a value provided by the system library

[clang] [clang-format] Handle templated elaborated type specifier in function… (PR #77013)

2024-01-12 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/77013 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AMDGPU] add function attrbute amdgpu-lib-fun (PR #74737)

2024-01-12 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > > > An AMDGPU library function is not internalized and can be used to > > > fullfill calls generated by LLVM passes or instruction selection. > > > > > > I am confused by the description of "internalized". Do you refer to LTO > > internalization? You can leverage `llvm.used`

[clang] [llvm] New calling convention preserve_none (PR #76868)

2024-01-12 Thread via cfe-commits
https://github.com/weiguozhi updated https://github.com/llvm/llvm-project/pull/76868 >From 90e14918a0eb13e2187f8548416ac72491d966c1 Mon Sep 17 00:00:00 2001 From: Guozhi Wei Date: Thu, 21 Dec 2023 19:04:44 + Subject: [PATCH 1/3] New calling convention preserve_none The new calling conventi

[clang] [clang-format] Add SpacesInParensOption for attributes and filtering for repeated parens (PR #77522)

2024-01-12 Thread Björn Schäpers via cfe-commits
@@ -4007,26 +3992,45 @@ bool TokenAnnotator::spaceRequiredBetween(const AnnotatedLine &Line, return true; } - // TODO: check consecutive parens if (Left.is(tok::l_paren) || Right.is(tok::r_paren)) { -if (Right.is(TT_CastRParen) || -(Left.MatchingParen &&

[clang] [clang-format] Add SpacesInParensOption for attributes and filtering for repeated parens (PR #77522)

2024-01-12 Thread Björn Schäpers via cfe-commits
@@ -17016,6 +17056,158 @@ TEST_F(FormatTest, ConfigurableSpacesInParens) { verifyFormat("size_t idx = (a->foo)(a - 1);", Spaces); verifyFormat("size_t idx = (*foo)(a - 1);", Spaces); verifyFormat("size_t idx = (*(foo))(a - 1);", Spaces); + + // Check NonConsecutive space

[clang] [clang-format] Add SpacesInParensOption for attributes and filtering for repeated parens (PR #77522)

2024-01-12 Thread Björn Schäpers via cfe-commits
@@ -17001,6 +17056,158 @@ TEST_F(FormatTest, ConfigurableSpacesInParens) { verifyFormat("size_t idx = (a->foo)(a - 1);", Spaces); verifyFormat("size_t idx = (*foo)(a - 1);", Spaces); verifyFormat("size_t idx = (*(foo))(a - 1);", Spaces); + + // Check NonConsecutive space

[clang] [clang-format] Add SpacesInParensOption for attributes and filtering for repeated parens (PR #77522)

2024-01-12 Thread Björn Schäpers via cfe-commits
@@ -17016,6 +17056,158 @@ TEST_F(FormatTest, ConfigurableSpacesInParens) { verifyFormat("size_t idx = (a->foo)(a - 1);", Spaces); verifyFormat("size_t idx = (*foo)(a - 1);", Spaces); verifyFormat("size_t idx = (*(foo))(a - 1);", Spaces); + + // Check NonConsecutive space

[clang] [llvm] [AMDGPU] Add global_load_tr for GFX12 (PR #77772)

2024-01-12 Thread Changpeng Fang via cfe-commits
@@ -2496,6 +2496,26 @@ def int_amdgcn_flat_atomic_fmax_num : AMDGPUAtomicRtn; def int_amdgcn_global_atomic_fmin_num : AMDGPUAtomicRtn; def int_amdgcn_global_atomic_fmax_num : AMDGPUAtomicRtn; +class AMDGPUGlobalLoadTr : + Intrinsic< +[data_ty], +[global_ptr_ty], +

<    1   2   3   4   5   >