[clang] Pass -offload-lto instead of -lto for cuda/hip kernels (PR #125243)

2025-02-04 Thread Joseph Huber via cfe-commits
@@ -498,12 +498,16 @@ Expected clang(ArrayRef InputFiles, const ArgList &Args) { }; // Forward all of the `--offload-opt` and similar options to the device. - CmdArgs.push_back("-flto"); for (auto &Arg : Args.filtered(OPT_offload_opt_eq_minus, OPT_mllvm)) CmdArgs

[clang] [Clang] Fixed invalid virtual copy constructor assertion (PR #124819)

2025-02-04 Thread Erich Keane via cfe-commits
@@ -6697,6 +6697,10 @@ static bool canPassInRegisters(Sema &S, CXXRecordDecl *D, if (D->isDependentType() || D->isInvalidDecl()) return false; + for (const CXXMethodDecl *MD : D->methods()) { erichkeane wrote: I'm not sure where the RIGHT place for thi

[clang] Revert "[clang] fix P3310 overload resolution flag propagation" (PR #125710)

2025-02-04 Thread David Spickett via cfe-commits
https://github.com/DavidSpickett closed https://github.com/llvm/llvm-project/pull/125710 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Revert "[clang] fix P3310 overload resolution flag propagation" (PR #125710)

2025-02-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-modules Author: David Spickett (DavidSpickett) Changes Reverts llvm/llvm-project#125372 due to lldb builds failing: https://lab.llvm.org/buildbot/#/builders/59/builds/12223 We need to decide how to update LLDB's code. --- Patch is 231.75 KiB, tr

[clang] Adding diagnostics for unsupported option (PR #125643)

2025-02-04 Thread via cfe-commits
https://github.com/ShashwathiNavada updated https://github.com/llvm/llvm-project/pull/125643 >From 0aebcd7119fbcd51154c5d9706752e8ff3f041bc Mon Sep 17 00:00:00 2001 From: ShashwathiNavada Date: Tue, 4 Feb 2025 00:16:09 -0600 Subject: [PATCH 1/5] Adding diagnostics for unsupported option --- c

[clang] [clang] fix P3310 overload resolution flag propagation (PR #125372)

2025-02-04 Thread David Spickett via cfe-commits
DavidSpickett wrote: Might be as simple as a constant true or false, but I'm nearing the end of my work day so I've reverted it for now. In the meantime, @Michael137 might know if this is something LLDB should actually be tracking. Or in other words, is https://github.com/llvm/llvm-project/is

[clang] [Clang] Fixed invalid virtual copy constructor assertion (PR #124819)

2025-02-04 Thread Mariya Podchishchaeva via cfe-commits
https://github.com/Fznamznon commented: Hi, thank you for the fix! Could you please add a test checking that failing scenario has been fixed? Could you please also add a release note? https://github.com/llvm/llvm-project/pull/124819 ___ cfe-commits ma

[clang] Pass -offload-lto instead of -lto for cuda/hip kernels (PR #125243)

2025-02-04 Thread Omar Ahmed via cfe-commits
@@ -498,12 +498,16 @@ Expected clang(ArrayRef InputFiles, const ArgList &Args) { }; // Forward all of the `--offload-opt` and similar options to the device. - CmdArgs.push_back("-flto"); for (auto &Arg : Args.filtered(OPT_offload_opt_eq_minus, OPT_mllvm)) CmdArgs

[clang] [HLSL] Make memory representation of boolean vectors in HLSL, vectors of i32. Add support for boolean swizzling. (PR #123977)

2025-02-04 Thread Sarah Spall via cfe-commits
@@ -2016,8 +2016,9 @@ TypeInfo ASTContext::getTypeInfoImpl(const Type *T) const { case Type::Vector: { const auto *VT = cast(T); TypeInfo EltInfo = getTypeInfo(VT->getElementType()); -Width = VT->isExtVectorBoolType() ? VT->getNumElements() -

[clang] Pass -offload-lto instead of -lto for cuda/hip kernels (PR #125243)

2025-02-04 Thread Joseph Huber via cfe-commits
@@ -498,12 +498,16 @@ Expected clang(ArrayRef InputFiles, const ArgList &Args) { }; // Forward all of the `--offload-opt` and similar options to the device. - CmdArgs.push_back("-flto"); for (auto &Arg : Args.filtered(OPT_offload_opt_eq_minus, OPT_mllvm)) CmdArgs

[clang] [Clang][NFC] Clean up fetching the offloading toolchain (PR #125095)

2025-02-04 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 edited https://github.com/llvm/llvm-project/pull/125095 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Move rotate to CLC library; optimize (PR #125713)

2025-02-04 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/125713 This commit moves the rotate builtin to the CLC library. It also optimizes rotate(x, n) to generate the @llvm.fshl(x, x, n) intrinsic directly, for both scalar and vector types. The previous implementation

[clang] [clang] handle fp options in __builtin_convertvector (PR #125522)

2025-02-04 Thread Jakub Ficek via cfe-commits
https://github.com/ficol updated https://github.com/llvm/llvm-project/pull/125522 >From cb26d6a13e196bfc08221b7f6cd43ab45019e7d6 Mon Sep 17 00:00:00 2001 From: "Ficek, Jakub" Date: Mon, 3 Feb 2025 16:45:17 +0100 Subject: [PATCH 1/2] [clang] Handle fp options in __builtin_convertvector This pat

[clang] [clang] Parse warning-suppression-mapping after setting up diagengine (PR #125714)

2025-02-04 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet created https://github.com/llvm/llvm-project/pull/125714 We can emit diagnostics while parsing warning-suppression-mapping, make sure command line flags take affect when emitting those. From 84b5e22eb0a6ebf7cdeb73d5e01a583dfb46aa8a Mon Sep 17 00:00:00 2001 From: Kad

[clang] [clang] Parse warning-suppression-mapping after setting up diagengine (PR #125714)

2025-02-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: kadir çetinkaya (kadircet) Changes We can emit diagnostics while parsing warning-suppression-mapping, make sure command line flags take affect when emitting those. --- Full diff: https://github.com/llvm/llvm-project/pull/125714.diff 2 F

[clang] [clang] handle fp options in __builtin_convertvector (PR #125522)

2025-02-04 Thread Jakub Ficek via cfe-commits
@@ -248,4 +248,16 @@ __attribute__((optnone)) T func_22(T x, T y) { float func_23(float x, float y) { return func_22(x, y); -} \ No newline at end of file +} + +// CHECK-LABEL: FunctionDecl {{.*}} func_24 'vector2float (vector2double)' +// CHECK: CompoundStmt {{.*}}

[libclc] [libclc] Move rotate to CLC library; optimize (PR #125713)

2025-02-04 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck edited https://github.com/llvm/llvm-project/pull/125713 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] handle fp options in __builtin_convertvector (PR #125522)

2025-02-04 Thread Jakub Ficek via cfe-commits
https://github.com/ficol edited https://github.com/llvm/llvm-project/pull/125522 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Move rotate to CLC library; optimize (PR #125713)

2025-02-04 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: CC @rjodinchr - you might not need to custom replace rotate yourselves in clspv after this PR? https://github.com/llvm/llvm-project/pull/125713 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/m

[clang] [WIP][clang]: Implement a conditional lifetimebound_if builtin. (PR #125520)

2025-02-04 Thread Ilya Biryukov via cfe-commits
ilya-biryukov wrote: > w.r.t. ABI, I think the end state here would conceptually be most likely be > similar to __attribute__((diagnose_if(...))). Does that affect ABI? I believe it does not as it only produces warnings. However, having an way to query the presence of attributes in the code wo

[clang] [HLSL] Fix resrouce wrapper declaration (PR #125718)

2025-02-04 Thread Steven Perron via cfe-commits
https://github.com/s-perron created https://github.com/llvm/llvm-project/pull/125718 The resource wrapper should have internal linkage because it cotains a handle to the global resource, and it not the actual global. Makeing this changed exposed that we were zeroinitializing the resouce, which

[clang] [libcxx] Proxy ref (PR #125719)

2025-02-04 Thread via cfe-commits
https://github.com/2LoS created https://github.com/llvm/llvm-project/pull/125719 Fixed `Reference`'s copy and move assignment operators >From 3109461716e5e78b23bea7a2eb6aac3d34348612 Mon Sep 17 00:00:00 2001 From: LoS Date: Mon, 13 Jan 2025 11:21:46 +0100 Subject: [PATCH 1/3] Fixed some warn-ov

[clang] 91cb8f5 - [NVPTX] Add tcgen05 alloc/dealloc intrinsics (#124961)

2025-02-04 Thread via cfe-commits
Author: Durgadoss R Date: 2025-02-04T14:31:40+05:30 New Revision: 91cb8f5d3202870602c6bef807bc4c7ae8a32790 URL: https://github.com/llvm/llvm-project/commit/91cb8f5d3202870602c6bef807bc4c7ae8a32790 DIFF: https://github.com/llvm/llvm-project/commit/91cb8f5d3202870602c6bef807bc4c7ae8a32790.diff L

[clang] [llvm] [NVPTX] Add tcgen05 alloc/dealloc intrinsics (PR #124961)

2025-02-04 Thread Durgadoss R via cfe-commits
https://github.com/durga4github closed https://github.com/llvm/llvm-project/pull/124961 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [X86] Extend kCFI with a 3-bit arity indicator (PR #121070)

2025-02-04 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang approved this pull request. LGTM. https://github.com/llvm/llvm-project/pull/121070 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Force AttributedStmtClass to not be scope parents (PR #125370)

2025-02-04 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: Thank you for the fix! > Could you add a test case - check in clang/test to see if other tests for the > diagnostic text in the original bug, and add a test case for that nearby > (maybe the same file the diagnostic is already tested in)? Also, please add a more descriptiv

[clang] [llvm] [ARM] Ensure FPU Selection can select mode correctly (PR #124935)

2025-02-04 Thread Jack Styles via cfe-commits
Stylie777 wrote: I don't believe the above CI test failure to be related. This change targets ARM. This is an unchanged architecture. https://github.com/llvm/llvm-project/pull/124935 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://list

[clang] [experimental] Detect return-stack-addr using CFG (PR #124133)

2025-02-04 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 updated https://github.com/llvm/llvm-project/pull/124133 >From 22990789b61e9f9d22e88a6b008eb3166fd1cb56 Mon Sep 17 00:00:00 2001 From: Utkarsh Saxena Date: Thu, 23 Jan 2025 15:47:39 + Subject: [PATCH 1/3] [experimental] Detect return-stack-addr using CFG --- .../A

[clang] [OpenMP][ASan] Enable ASan Instrumentation for AMDGPUOpenMPToolChain. (PR #124754)

2025-02-04 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu approved this pull request. https://github.com/llvm/llvm-project/pull/124754 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Win/X86] Make _m_prefetch[w] builtins to avoid winnt.h conflicts (PR #115099)

2025-02-04 Thread Phoebe Wang via cfe-commits
@@ -138,6 +142,12 @@ let Attributes = [Const, NoThrow, RequiredVectorWidth<256>], Features = "avx" in } } +// PRFCHW +let Features = "prfchw", Header = "x86intrin.h", Attributes = [NoThrow, Const] in { + def _m_prefetch : X86LibBuiltin<"void(void *)">; ph

[clang] [analyzer] Remove some false negatives in StackAddrEscapeChecker (PR #125638)

2025-02-04 Thread Gábor Horváth via cfe-commits
@@ -247,45 +240,134 @@ void StackAddrEscapeChecker::checkPreCall(const CallEvent &Call, } } -void StackAddrEscapeChecker::checkPreStmt(const ReturnStmt *RS, - CheckerContext &C) const { - if (!ChecksEnabled[CK_StackAddrEscapeChecker

[clang] [analyzer] Remove some false negatives in StackAddrEscapeChecker (PR #125638)

2025-02-04 Thread Gábor Horváth via cfe-commits
https://github.com/Xazax-hun edited https://github.com/llvm/llvm-project/pull/125638 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Remove some false negatives in StackAddrEscapeChecker (PR #125638)

2025-02-04 Thread Gábor Horváth via cfe-commits
@@ -18,8 +18,8 @@ struct myfunction { myfunction create_func() { int n; auto c = [&n] {}; - return c; // expected-warning {{Address of stack memory associated with local variable 'n' is still referred to by a temporary object on the stack upon returning to the caller. T

[clang] [analyzer] Remove some false negatives in StackAddrEscapeChecker (PR #125638)

2025-02-04 Thread Gábor Horváth via cfe-commits
https://github.com/Xazax-hun commented: I think this is going in the right direction but I'd love to see more tests and some more thought about some scenarios. https://github.com/llvm/llvm-project/pull/125638 ___ cfe-commits mailing list cfe-commits@

[clang] 227b32f - [clang] Remove an incorrect assertion in ConstantFoldAttrs (#105789)

2025-02-04 Thread via cfe-commits
Author: Timm Baeder Date: 2025-02-04T12:58:44+01:00 New Revision: 227b32f6a1329c449f1222a42471190eededa433 URL: https://github.com/llvm/llvm-project/commit/227b32f6a1329c449f1222a42471190eededa433 DIFF: https://github.com/llvm/llvm-project/commit/227b32f6a1329c449f1222a42471190eededa433.diff L

[clang] [clang] Remove an incorrect assertion in ConstantFoldAttrs (PR #105789)

2025-02-04 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/105789 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][P1061] Consolidate ResolvedUnpexandedPackExpr into FunctionParmPackExpr (PR #125394)

2025-02-04 Thread Jason Rice via cfe-commits
https://github.com/ricejasonf edited https://github.com/llvm/llvm-project/pull/125394 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Diagnose the code with trailing comma in the function call. (PR #125232)

2025-02-04 Thread Haojian Wu via cfe-commits
hokein wrote: > @hokein feel free to merge :) Thanks for the ping. We have several instances of `func(1,);` in our internal codebase, and the number is not small unfortunately. I'm currently working on a cleanup, which will take some time. I plan to merge this patch as soon as the cleanup is

[clang] [Clang][P1061] Consolidate ResolvedUnpexandedPackExpr into FunctionParmPackExpr (PR #125394)

2025-02-04 Thread Jason Rice via cfe-commits
https://github.com/ricejasonf updated https://github.com/llvm/llvm-project/pull/125394 >From a323e058b2c8adf97f7f9a55a9187f74de9b8d17 Mon Sep 17 00:00:00 2001 From: Jason Rice Date: Sun, 2 Feb 2025 00:52:47 -0800 Subject: [PATCH 1/3] [Clang][P1061] Consolidate ResolvedUnexpandedPackExpr into F

[clang] [clang-format] Add BreakBeforeTemplateClose option (PR #118046)

2025-02-04 Thread Owen Pan via cfe-commits
@@ -11224,6 +11224,328 @@ TEST_F(FormatTest, WrapsTemplateDeclarationsWithComments) { Style); } +TEST_F(FormatTest, BreakBeforeTemplateCloser) { + FormatStyle Style = getLLVMStyle(); + // Begin with tests covering the case where there is no constraint on the + // col

[clang] [Clang] allow restrict qualifier for array types with pointer types as element types (PR #120896)

2025-02-04 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/120896 >From 295df258043ef5a87ae603eedd308b863bad7b59 Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Sun, 22 Dec 2024 15:14:30 +0200 Subject: [PATCH 1/4] [Clang] allow restrict qualifier for array types with poin

[clang] [clang-format] Add BreakBeforeTemplateClose option (PR #118046)

2025-02-04 Thread Owen Pan via cfe-commits
@@ -11224,6 +11224,328 @@ TEST_F(FormatTest, WrapsTemplateDeclarationsWithComments) { Style); } +TEST_F(FormatTest, BreakBeforeTemplateCloser) { + FormatStyle Style = getLLVMStyle(); + // Begin with tests covering the case where there is no constraint on the + // col

[clang] [clang-format] Add BreakBeforeTemplateClose option (PR #118046)

2025-02-04 Thread Owen Pan via cfe-commits
@@ -11224,6 +11224,328 @@ TEST_F(FormatTest, WrapsTemplateDeclarationsWithComments) { Style); } +TEST_F(FormatTest, BreakBeforeTemplateCloser) { + FormatStyle Style = getLLVMStyle(); + // Begin with tests covering the case where there is no constraint on the + // col

[clang] [clang-format] Add BreakBeforeTemplateClose option (PR #118046)

2025-02-04 Thread Owen Pan via cfe-commits
@@ -11224,6 +11224,328 @@ TEST_F(FormatTest, WrapsTemplateDeclarationsWithComments) { Style); } +TEST_F(FormatTest, BreakBeforeTemplateCloser) { + FormatStyle Style = getLLVMStyle(); + // Begin with tests covering the case where there is no constraint on the + // col

[clang-tools-extra] [clang-tidy] Add performance-redundant-lookup check (PR #125420)

2025-02-04 Thread Balazs Benics via cfe-commits
steakhal wrote: > I ran it on the Cppcheck codebase and there were several cases I would > consider false positives as well as some which are really awkward to fix (in > some cases leading to potentially unnecessary lookups). I will provide some > examples in the next few days. I ran it on cp

[clang] [analyzer] Add time-trace scopes for high-level analyzer steps (PR #125508)

2025-02-04 Thread Arseniy Zaostrovnykh via cfe-commits
necto wrote: > Does this also work when CSA is called through clang-tidy? The analyzer > profiling data in missing in the `--enable-check-profile` output - see #73673? As far as I know, it does not work out of the box with clang-tidy. Time tracing works only if you setup a profiler singleton i

[clang] [Clang] Do not try to transform invalid bindings (PR #125658)

2025-02-04 Thread via cfe-commits
cor3ntin wrote: > Oh actually, one thing to note is, how is this going to interact with #125394 > since that just deletes the entire if statement that this change is part of? Yeah, maybe it was not smart of me to work on that! I suspect the fix with Jason's change is similar. The other way to

[clang] [Clang] Do not try to transform invalid bindings (PR #125658)

2025-02-04 Thread via cfe-commits
Sirraide wrote: > But i think not transforming invalid binding deck is cleaner Yeah, I’d say so too https://github.com/llvm/llvm-project/pull/125658 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinf

[clang] [clang] Remove an incorrect assertion in ConstantFoldAttrs (PR #105789)

2025-02-04 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr edited https://github.com/llvm/llvm-project/pull/105789 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Remove an incorrect assertion in ConstantFoldAttrs (PR #105789)

2025-02-04 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/105789 >From 356b422c59615894767ad3d790d1e7e2f55868a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 23 Aug 2024 08:54:12 +0200 Subject: [PAT

[clang] [analyzer] Add time-trace scopes for high-level analyzer steps (PR #125508)

2025-02-04 Thread Arseniy Zaostrovnykh via cfe-commits
@@ -49,6 +49,127 @@ LLVM_DUMP_METHOD void ProgramPoint::dump() const { return printJson(llvm::errs()); } +const char *ProgramPoint::kindToStr(Kind K) { + switch (K) { + case BlockEdgeKind: +return "BlockEdge"; + case BlockEntranceKind: +return "BlockEntrance"; +

[clang] [analyzer] Add time-trace scopes for high-level analyzer steps (PR #125508)

2025-02-04 Thread Arseniy Zaostrovnykh via cfe-commits
@@ -0,0 +1,38 @@ += +Performance Investigation += + +Multiple factors contribute to the time it takes to analyze a file with Clang Static Analyzer. +A translation unit contains multiple entry points, each of which take multiple ste

[clang] [analyzer] Add time-trace scopes for high-level analyzer steps (PR #125508)

2025-02-04 Thread Arseniy Zaostrovnykh via cfe-commits
@@ -0,0 +1,38 @@ += +Performance Investigation += + +Multiple factors contribute to the time it takes to analyze a file with Clang Static Analyzer. +A translation unit contains multiple entry points, each of which take multiple ste

[clang] [analyzer] Add time-trace scopes for high-level analyzer steps (PR #125508)

2025-02-04 Thread Arseniy Zaostrovnykh via cfe-commits
@@ -49,6 +49,127 @@ LLVM_DUMP_METHOD void ProgramPoint::dump() const { return printJson(llvm::errs()); } +const char *ProgramPoint::kindToStr(Kind K) { necto wrote: Indeed, I changed the return type in a22ed13eae22 [NFC] Return StringRef instead of a raw ch

[clang] [analyzer] Add time-trace scopes for high-level analyzer steps (PR #125508)

2025-02-04 Thread Arseniy Zaostrovnykh via cfe-commits
@@ -49,6 +49,127 @@ LLVM_DUMP_METHOD void ProgramPoint::dump() const { return printJson(llvm::errs()); } +const char *ProgramPoint::kindToStr(Kind K) { + switch (K) { + case BlockEdgeKind: +return "BlockEdge"; + case BlockEntranceKind: +return "BlockEntrance"; +

[clang] [analyzer] Add time-trace scopes for high-level analyzer steps (PR #125508)

2025-02-04 Thread Arseniy Zaostrovnykh via cfe-commits
@@ -287,6 +288,35 @@ class PathDiagnosticBuilder : public BugReporterContext { const PathSensitiveBugReport *getBugReport() const { return R; } }; +std::string timeTraceName(const BugReportEquivClass &EQ) { + if (!llvm::timeTraceProfilerEnabled()) { necto w

[clang] [clang] fix P3310 overload resolution flag propagation (PR #125372)

2025-02-04 Thread via cfe-commits
https://github.com/cor3ntin approved this pull request. https://github.com/llvm/llvm-project/pull/125372 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Implement HLSL Flat casting (excluding splat cases) (PR #118842)

2025-02-04 Thread Justin Bogner via cfe-commits
@@ -6358,3 +6359,81 @@ RValue CodeGenFunction::EmitPseudoObjectRValue(const PseudoObjectExpr *E, LValue CodeGenFunction::EmitPseudoObjectLValue(const PseudoObjectExpr *E) { return emitPseudoObjectExpr(*this, E, true, AggValueSlot::ignored()).LV; } + +void CodeGenFunction::Fl

[clang] [HLSL] Implement HLSL Flat casting (excluding splat cases) (PR #118842)

2025-02-04 Thread Justin Bogner via cfe-commits
https://github.com/bogner edited https://github.com/llvm/llvm-project/pull/118842 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Fix wrong initialization kind when handling initializing structured bindings from an array with direct-list-initialization (PR #124793)

2025-02-04 Thread via cfe-commits
cor3ntin wrote: Can you add a changelog entry? https://github.com/llvm/llvm-project/pull/124793 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [WIP][clang]: Implement a conditional lifetimebound_if builtin. (PR #125520)

2025-02-04 Thread Ilya Biryukov via cfe-commits
ilya-biryukov wrote: In addition to the concerns raised above, I also wanted to highlight that as soon as we have the ability to inspect attributes (and I agree with @higher-performance that we want it to make this useful for cases like `emplace_back`) at compile time, we get into a slippery s

[clang] [HLSL] Fix resrouce wrapper declaration (PR #125718)

2025-02-04 Thread via cfe-commits
github-actions[bot] wrote: :warning: undef deprecator found issues in your code. :warning: You can test this locally with the following command: ``bash git diff -U0 --pickaxe-regex -S '([^a-zA-Z0-9#_-]undef[^a-zA-Z0-9_-]|UndefValue::get)' d5488f157c74332646d2b6e9d16c88e61d5a789e

[clang] [libcxx] Proxy ref (PR #125719)

2025-02-04 Thread via cfe-commits
https://github.com/2LoS closed https://github.com/llvm/llvm-project/pull/125719 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] Proxy ref (PR #125719)

2025-02-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: LoS (2LoS) Changes Fixed `Reference`'s copy and move assignment operators --- Patch is 36.65 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/125719.diff 10 Files Affected: - (renamed) clang/

[clang] [clang] Stop parsing warning suppression mappings in driver (PR #125722)

2025-02-04 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet created https://github.com/llvm/llvm-project/pull/125722 This gets rid of some extra IO from driver startup, and possiblity of emitting warnings twice. From 7dce959f33d828e4a06ba386715a3d92b7be34bf Mon Sep 17 00:00:00 2001 From: Kadir Cetinkaya Date: Tue, 4 Feb 202

[clang] [clang] Stop parsing warning suppression mappings in driver (PR #125722)

2025-02-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: kadir çetinkaya (kadircet) Changes This gets rid of some extra IO from driver startup, and possiblity of emitting warnings twice. --- Full diff: https://github.com/llvm/llvm-project/pull/125722.diff 1 Files Affected: - (modified) clang

[clang] [Sema] Migrate away from PointerUnion::dyn_cast (NFC) (PR #125630)

2025-02-04 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata closed https://github.com/llvm/llvm-project/pull/125630 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 1fba186 - [libclang] Migrate away from PointerUnion::dyn_cast (NFC) (#125631)

2025-02-04 Thread via cfe-commits
Author: Kazu Hirata Date: 2025-02-04T09:09:22-08:00 New Revision: 1fba1860984f4757d04922df63d5cc3d3dcf07be URL: https://github.com/llvm/llvm-project/commit/1fba1860984f4757d04922df63d5cc3d3dcf07be DIFF: https://github.com/llvm/llvm-project/commit/1fba1860984f4757d04922df63d5cc3d3dcf07be.diff L

[clang] [libclang] Migrate away from PointerUnion::dyn_cast (NFC) (PR #125631)

2025-02-04 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata closed https://github.com/llvm/llvm-project/pull/125631 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 63c59dd - [Sema] Migrate away from PointerUnion::dyn_cast (NFC) (#125630)

2025-02-04 Thread via cfe-commits
Author: Kazu Hirata Date: 2025-02-04T09:09:01-08:00 New Revision: 63c59dda436fef7ceb4e3a21a95d306435e42720 URL: https://github.com/llvm/llvm-project/commit/63c59dda436fef7ceb4e3a21a95d306435e42720 DIFF: https://github.com/llvm/llvm-project/commit/63c59dda436fef7ceb4e3a21a95d306435e42720.diff L

[clang] [llvm] [X86] Extend kCFI with a 3-bit arity indicator (PR #121070)

2025-02-04 Thread Scott Constable via cfe-commits
scottconstable wrote: @lvwr @maurer @rcvalle A gentle reminder to please review this PR. https://github.com/llvm/llvm-project/pull/121070 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit

[clang] [Clang] disallow attributes on void parameters (PR #124920)

2025-02-04 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/124920 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] disallow attributes on void parameters (PR #124920)

2025-02-04 Thread Shafik Yaghmour via cfe-commits
@@ -53,3 +53,14 @@ alignas(4) auto PR19252 = 0; // Check the diagnostic message class alignas(void) AlignasVoid {}; // expected-error {{invalid application of 'alignas' to an incomplete type 'void'}} + +namespace GH108819 { +void a([[maybe_unused]] void) {} //

[clang] [Clang] disallow attributes on void parameters (PR #124920)

2025-02-04 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: This makes sense but we should have been coverage in testing. https://github.com/llvm/llvm-project/pull/124920 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/

[clang] [HLSL] Fix resrouce wrapper declaration (PR #125718)

2025-02-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Steven Perron (s-perron) Changes The resource wrapper should have internal linkage because it cotains a handle to the global resource, and it not the actual global. Makeing this changed exposed that we were zeroinitializing the resouce, wh

[clang] [Clang][P1061] Consolidate ResolvedUnpexandedPackExpr into FunctionParmPackExpr (PR #125394)

2025-02-04 Thread Jason Rice via cfe-commits
ricejasonf wrote: > Can i merge this for you? @cor3ntin Whenever you think it is ready, yes please. I know Erich did not want the C-style cast. https://github.com/llvm/llvm-project/pull/125394 ___ cfe-commits mailing list cfe-commits@lists.llvm.org h

[clang] [WIP][clang]: Implement a conditional lifetimebound_if builtin. (PR #125520)

2025-02-04 Thread Gábor Horváth via cfe-commits
Xazax-hun wrote: > to forward some attributes only when they are applicable One question is whether the reflection proposal would address something like this. If it does, it might make more sense to invest in that than a custom solution. https://github.com/llvm/llvm-project/pull/125520 _

[clang] [Clang][P1061] Consolidate ResolvedUnpexandedPackExpr into FunctionParmPackExpr (PR #125394)

2025-02-04 Thread Jason Rice via cfe-commits
@@ -4278,25 +4276,21 @@ class DecompositionDecl final // Provide a flattened range to visit each binding. auto flat_bindings() const { llvm::ArrayRef Bindings = bindings(); -llvm::ArrayRef PackExprs; +llvm::ArrayRef PackBindings; // Split the bindings int

[clang] [clang][Sema] Improve template argument deduction diagnostic (PR #122754)

2025-02-04 Thread Aidan Goldfarb via cfe-commits
@@ -4870,14 +4870,16 @@ def note_ovl_candidate_inconsistent_deduction_types : Note< "candidate template ignored: deduced values %diff{" "of conflicting types for parameter %0 (%1 of type $ vs. %3 of type $)|" "%1 and %3 of conflicting types for parameter %0}2,4">;

[clang] [WIP][clang]: Implement a conditional lifetimebound_if builtin. (PR #125520)

2025-02-04 Thread via cfe-commits
higher-performance wrote: > There are other ways to achieve that and there are attributes that may change > behavior of the program and its meaning, so maybe some folks feel it is > acceptable. I feel this is probably a bad idea and we should stick to the > principle that attributes like lifet

[clang] [Clang][P1061] Consolidate ResolvedUnpexandedPackExpr into FunctionParmPackExpr (PR #125394)

2025-02-04 Thread Shafik Yaghmour via cfe-commits
@@ -124,6 +125,14 @@ void lambda_capture() { [&x...] { (void)sum(x...); }(); } +struct S2 { +int a, b, c; +}; + +auto X = [] () { shafik wrote: I feel like there are a bunch of varieties on this case we can test as well: https://godbolt.org/z/r9zxxfoW

[clang] [Clang][P1061] Consolidate ResolvedUnpexandedPackExpr into FunctionParmPackExpr (PR #125394)

2025-02-04 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/125394 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Make `-Xarch_` handling generic for all toolchains (PR #125421)

2025-02-04 Thread Artem Belevich via cfe-commits
Artem-B wrote: > Right now it works as I'd expect, it passes --offload-arch=sm_52 to the sm_52 > compilation, but no other architecture. What happens with that `--offload-arch=sm_52` when cc1 sees it? Ideally there should be either an unused argument warning, or an error is the option is not a

[clang] [Clang] Make `-Xarch_` handling generic for all toolchains (PR #125421)

2025-02-04 Thread Artem Belevich via cfe-commits
Artem-B wrote: > Right now if someone passes -Xarch_foo --offload-arch=gfx1030 and foo doesn't > match it's not passed and it will print something like this. I figured that's > good enough. This part SGTM, too. However, I don't think I've seen the answer what happens when we do pass --offloa

[clang] [clang] UEFI ABI fixes for X86_64 (PR #124992)

2025-02-04 Thread Reid Kleckner via cfe-commits
@@ -74,7 +74,7 @@ static CCMangling getCallingConvMangling(const ASTContext &Context, if (FD->isMain() && FD->getNumParams() == 2) return CCM_WasmMainArgcArgv; - if (!Triple.isOSWindows() || !Triple.isX86()) + if (!Triple.isOSWindowsOrUEFI() || !Triple.isX86()

[clang] [clang] UEFI ABI fixes for X86_64 (PR #124992)

2025-02-04 Thread Reid Kleckner via cfe-commits
@@ -5193,12 +5193,12 @@ bool Sema::CheckCallingConvAttr(const ParsedAttr &Attrs, CallingConv &CC, CC = CC_X86RegCall; break; case ParsedAttr::AT_MSABI: -CC = Context.getTargetInfo().getTriple().isOSWindows() ? CC_C : -

[clang] [clang][Sema] Fix type of an statement expression ending with an atomic type (PR #119711)

2025-02-04 Thread Aaron Ballman via cfe-commits
Alejandro =?utf-8?q?Álvarez_Ayllón?=, Alejandro =?utf-8?q?Álvarez_Ayllón?=, Alejandro =?utf-8?q?Álvarez_Ayllón?Message-ID: In-Reply-To: @@ -15919,10 +15919,17 @@ ExprResult Sema::ActOnStmtExprResult(ExprResult ER) { if (Cast && Cast->getCastKind() == CK_ARCConsumeObject)

[clang] [Clang][NFC] Clean up fetching the offloading toolchain (PR #125095)

2025-02-04 Thread Artem Belevich via cfe-commits
@@ -6601,6 +6573,72 @@ std::string Driver::GetClPchPath(Compilation &C, StringRef BaseName) const { return std::string(Output); } +const ToolChain &Driver::getOffloadToolChain( +const llvm::opt::ArgList &Args, const Action::OffloadKind Kind, +const llvm::Triple &Tar

[clang] [Clang][NFC] Clean up fetching the offloading toolchain (PR #125095)

2025-02-04 Thread Artem Belevich via cfe-commits
@@ -6601,6 +6573,72 @@ std::string Driver::GetClPchPath(Compilation &C, StringRef BaseName) const { return std::string(Output); } +const ToolChain &Driver::getOffloadToolChain( +const llvm::opt::ArgList &Args, const Action::OffloadKind Kind, +const llvm::Triple &Tar

[clang] [Clang] Make `-Xarch_` handling generic for all toolchains (PR #125421)

2025-02-04 Thread Artem Belevich via cfe-commits
Artem-B wrote: > --offload-arch= isn't an accepted -cc1 argument so it won't be forwarded at > all. Silently? That would be wrong, imo. It should be diagnosed somewhere. https://github.com/llvm/llvm-project/pull/125421 ___ cfe-commits mailing list cf

[clang] [llvm] [Clang][AArch64] Add support for SHF_AARCH64_PURECODE ELF section flag (2/3) (PR #125688)

2025-02-04 Thread Csanád Hajdú via cfe-commits
https://github.com/Il-Capitano created https://github.com/llvm/llvm-project/pull/125688 Add support for the new SHF_AARCH64_PURECODE ELF section flag: https://github.com/ARM-software/abi-aa/pull/304 The general implementation follows the existing one for ARM targets. Simlarly to ARM targets,

[clang] [Clang] Make `-Xarch_` handling generic for all toolchains (PR #125421)

2025-02-04 Thread Artem Belevich via cfe-commits
https://github.com/Artem-B commented: > > > --offload-arch= isn't an accepted -cc1 argument so it won't be forwarded > > > at all. > > > > > > Silently? That would be wrong, imo. It should be diagnosed somewhere. > > It's already an error if you pass it directly via -`Xclang` because it's not

[clang] [Clang] allow restrict qualifier for array types with pointer types as element types (PR #120896)

2025-02-04 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/120896 >From 295df258043ef5a87ae603eedd308b863bad7b59 Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Sun, 22 Dec 2024 15:14:30 +0200 Subject: [PATCH 1/5] [Clang] allow restrict qualifier for array types with poin

[clang] [Clang] Make `-Xarch_` handling generic for all toolchains (PR #125421)

2025-02-04 Thread Artem Belevich via cfe-commits
@@ -0,0 +1,44 @@ +// RUN: %clang -x cuda %s -Xarch_nvptx64 -O3 -S -nogpulib -nogpuinc -### 2>&1 | FileCheck -check-prefix=O3ONCE %s +// RUN: %clang -x cuda %s -Xarch_device -O3 -S -nogpulib -nogpuinc -### 2>&1 | FileCheck -check-prefix=O3ONCE %s +// RUN: %clang -x hip %s -Xarch_

[clang] [Clang] Make `-Xarch_` handling generic for all toolchains (PR #125421)

2025-02-04 Thread Artem Belevich via cfe-commits
https://github.com/Artem-B edited https://github.com/llvm/llvm-project/pull/125421 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Make `-Xarch_` handling generic for all toolchains (PR #125421)

2025-02-04 Thread Joseph Huber via cfe-commits
@@ -0,0 +1,44 @@ +// RUN: %clang -x cuda %s -Xarch_nvptx64 -O3 -S -nogpulib -nogpuinc -### 2>&1 | FileCheck -check-prefix=O3ONCE %s +// RUN: %clang -x cuda %s -Xarch_device -O3 -S -nogpulib -nogpuinc -### 2>&1 | FileCheck -check-prefix=O3ONCE %s +// RUN: %clang -x hip %s -Xarch_

[clang] [analyzer] Add option assume-one-iteration (PR #125494)

2025-02-04 Thread Balazs Benics via cfe-commits
@@ -294,6 +294,16 @@ ANALYZER_OPTION( bool, ShouldUnrollLoops, "unroll-loops", "Whether the analysis should try to unroll loops with known bounds.", false) +ANALYZER_OPTION( +bool, ShouldAssumeOneIteration, "assume-one-iteration", +"Whether the analyzer should

[clang] [Clang] Make `-Xarch_` handling generic for all toolchains (PR #125421)

2025-02-04 Thread Joseph Huber via cfe-commits
@@ -0,0 +1,44 @@ +// RUN: %clang -x cuda %s -Xarch_nvptx64 -O3 -S -nogpulib -nogpuinc -### 2>&1 | FileCheck -check-prefix=O3ONCE %s +// RUN: %clang -x cuda %s -Xarch_device -O3 -S -nogpulib -nogpuinc -### 2>&1 | FileCheck -check-prefix=O3ONCE %s +// RUN: %clang -x hip %s -Xarch_

[clang] [llvm] [clang-linker-wrapper] Add ELF packaging for spirv64-intel OpenMP images (PR #125737)

2025-02-04 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex updated https://github.com/llvm/llvm-project/pull/125737 >From d4b3358e1ccbae6889aaef280431f06a115102e0 Mon Sep 17 00:00:00 2001 From: "Sarnie, Nick" Date: Wed, 22 Jan 2025 08:35:49 -0800 Subject: [PATCH] [clang-linker-wrapper] Add ELF packaging for spirv64-intel Open

[clang] [Clang] Make `-Xarch_` handling generic for all toolchains (PR #125421)

2025-02-04 Thread Artem Belevich via cfe-commits
@@ -0,0 +1,44 @@ +// RUN: %clang -x cuda %s -Xarch_nvptx64 -O3 -S -nogpulib -nogpuinc -### 2>&1 | FileCheck -check-prefix=O3ONCE %s +// RUN: %clang -x cuda %s -Xarch_device -O3 -S -nogpulib -nogpuinc -### 2>&1 | FileCheck -check-prefix=O3ONCE %s +// RUN: %clang -x hip %s -Xarch_

<    1   2   3   4   5   6   >