[clang-tools-extra] [clang-tidy] support query based custom check (PR #131804)

2025-06-13 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/131804 >From a686695e6691fcb824b2055c3dfa8f0fd3727355 Mon Sep 17 00:00:00 2001 From: DeNiCoN Date: Mon, 17 Mar 2025 08:04:32 + Subject: [PATCH 01/13] origin pr --- clang-tools-extra/clang-tidy/CMakeLists.txt

[clang] [clang-tools-extra] [clang-tidy] Warn about misuse of sizeof operator in loops. (PR #143205)

2025-06-13 Thread Baranov Victor via cfe-commits
@@ -353,6 +367,19 @@ void SizeofExpressionCheck::check(const MatchFinder::MatchResult &Result) { diag(E->getBeginLoc(), "suspicious usage of 'sizeof(char*)'; do you mean 'strlen'?") << E->getSourceRange(); + } else if (const auto *E = Result.Nodes.getNode

[clang-tools-extra] [clang-tidy] support query based custom check (PR #131804)

2025-06-13 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 ready_for_review https://github.com/llvm/llvm-project/pull/131804 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang-tidy] Warn about misuse of sizeof operator in loops. (PR #143205)

2025-06-13 Thread Baranov Victor via cfe-commits
@@ -164,6 +164,53 @@ int Test2(MyConstChar* A) { return sum; } +struct A { + int array[10]; +}; + +struct B { + struct A a; +}; + +void loop_access_elements(int num, struct B b) { +struct A arr[10]; +char buf[20]; + +// CHECK-MESSAGES: :[[@LINE+1]]:5: warning:

[clang] [clang-tools-extra] [clang-tidy] Warn about misuse of sizeof operator in loops. (PR #143205)

2025-06-13 Thread Baranov Victor via cfe-commits
@@ -316,3 +316,11 @@ Options When `true`, the check will warn on pointer arithmetic where the element count is obtained from a division with ``sizeof(...)``, e.g., ``Ptr + Bytes / sizeof(*T)``. Default is `true`. + +.. option:: WarnOnSizeOfInLoopTermination + + When

[clang] [clang-tools-extra] [clang-tidy] Warn about misuse of sizeof operator in loops. (PR #143205)

2025-06-13 Thread Baranov Victor via cfe-commits
@@ -353,6 +367,19 @@ void SizeofExpressionCheck::check(const MatchFinder::MatchResult &Result) { diag(E->getBeginLoc(), "suspicious usage of 'sizeof(char*)'; do you mean 'strlen'?") << E->getSourceRange(); + } else if (const auto *E = Result.Nodes.getNode

[clang] [clang-tools-extra] [clang-tidy] Warn about misuse of sizeof operator in loops. (PR #143205)

2025-06-13 Thread Baranov Victor via cfe-commits
@@ -219,6 +219,12 @@ Changes in existing checks tolerating fix-it breaking compilation when functions is used as pointers to avoid matching usage of functions within the current compilation unit. +- Improved :doc: `bugprone-sizeof-expression + ` check. + + Introduced WarnO

[clang] [clang-tools-extra] [clang-tidy] Warn about misuse of sizeof operator in loops. (PR #143205)

2025-06-13 Thread Baranov Victor via cfe-commits
@@ -164,6 +164,53 @@ int Test2(MyConstChar* A) { return sum; } +struct A { + int array[10]; +}; + +struct B { + struct A a; +}; + +void loop_access_elements(int num, struct B b) { +struct A arr[10]; +char buf[20]; + +// CHECK-MESSAGES: :[[@LINE+1]]:5: warning:

[clang-tools-extra] [clang-tidy] support query based custom check (PR #131804)

2025-06-13 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 edited https://github.com/llvm/llvm-project/pull/131804 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] support query based custom check (PR #131804)

2025-06-13 Thread Congcong Cai via cfe-commits
HerrCai0907 wrote: > This feature request requires adding _a lot_ of things in the config file. > And once it's in, people will want _more_ things in it (eventually they will > want exactly the same functionality as can be achieved by regular checks). So > I see this feature growing without po

[clang] [clang-format] Fix an off-by-1 bug with -length option (PR #143302)

2025-06-13 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/143302 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-06-13 Thread Nikolas Klauser via cfe-commits
@@ -1547,6 +1547,58 @@ ExprResult Sema::ActOnTypeTrait(TypeTrait Kind, SourceLocation KWLoc, return BuildTypeTrait(Kind, KWLoc, ConvertedArgs, RParenLoc); } +bool Sema::BuiltinIsBaseOf(SourceLocation RhsTLoc, QualType LhsT, + QualType RhsT) { + //

[clang] 1fae591 - [clang-format] Fix an off-by-1 bug with -length option (#143302)

2025-06-13 Thread via cfe-commits
Author: Owen Pan Date: 2025-06-13T00:45:52-07:00 New Revision: 1fae5918b3d6fbed8ce6d8a2edf31bdf304ca8db URL: https://github.com/llvm/llvm-project/commit/1fae5918b3d6fbed8ce6d8a2edf31bdf304ca8db DIFF: https://github.com/llvm/llvm-project/commit/1fae5918b3d6fbed8ce6d8a2edf31bdf304ca8db.diff LOG:

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-06-13 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/116709 >From e0bb550672326e21a556ac727f2e2a6ef65f0469 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Tue, 1 Oct 2024 11:08:02 +0200 Subject: [PATCH 1/7] [Clang] Add __builtin_invoke and recognize std::invoke a

[clang] [-Wunterminated-string-initialization] Handle C string literals ending with explicit '\0' (PR #143487)

2025-06-13 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 updated https://github.com/llvm/llvm-project/pull/143487 >From 5825b324e47c78a939d8e62d1101e1574fd04638 Mon Sep 17 00:00:00 2001 From: Ziqing Luo Date: Tue, 10 Jun 2025 15:50:10 +0800 Subject: [PATCH 1/6] [-Wunterminated-string-initialization] Handle C string li

[clang] 02b6ed0 - [Clang] Added explanation why `is_constructible` evaluated to false. (#143309)

2025-06-13 Thread via cfe-commits
Author: Shamshura Egor Date: 2025-06-13T09:53:15+02:00 New Revision: 02b6ed0bf139518c704a2996418e66f3a93260a1 URL: https://github.com/llvm/llvm-project/commit/02b6ed0bf139518c704a2996418e66f3a93260a1 DIFF: https://github.com/llvm/llvm-project/commit/02b6ed0bf139518c704a2996418e66f3a93260a1.diff

[clang] [Clang] Added explanation why `is_constructible` evaluated to false. (PR #143309)

2025-06-13 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin closed https://github.com/llvm/llvm-project/pull/143309 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Implement LSP 3.17 positionEncoding (PR #142903)

2025-06-13 Thread via cfe-commits
https://github.com/someoneinjd updated https://github.com/llvm/llvm-project/pull/142903 >From 398978803ba789efc5eb472e245acbf9a7c65540 Mon Sep 17 00:00:00 2001 From: someoneinjd Date: Thu, 5 Jun 2025 13:51:40 +0800 Subject: [PATCH] [clangd] Implement LSP 3.17 positionEncoding --- clang-tools-

[clang-tools-extra] [clangd] Implement LSP 3.17 positionEncoding (PR #142903)

2025-06-13 Thread via cfe-commits
@@ -497,6 +497,12 @@ bool fromJSON(const llvm::json::Value &Params, ClientCapabilities &R, if (auto Cancel = StaleRequestSupport->getBoolean("cancel")) R.CancelsStaleRequests = *Cancel; } +if (auto *OffsetEncoding = General->get("positionEncodings")) { +

[clang-tools-extra] [clangd] Implement LSP 3.17 positionEncoding (PR #142903)

2025-06-13 Thread via cfe-commits
https://github.com/someoneinjd updated https://github.com/llvm/llvm-project/pull/142903 >From 396f36808ef2b5eee28d963bad1afba1eb4f927a Mon Sep 17 00:00:00 2001 From: someoneinjd Date: Thu, 5 Jun 2025 13:51:40 +0800 Subject: [PATCH] [clangd] Implement LSP 3.17 positionEncoding --- clang-tools-

[clang] [clang] Reset FileID based diag state mappings (PR #143695)

2025-06-13 Thread kadir çetinkaya via cfe-commits
kadircet wrote: hi @nathanchance, I can't seem to reproduce the failure, and I couldn't find any buildbots with this failure (also the assertion you're seeing conceptually shouldn't be triggered by state in diagnostics engine). I am not sure how to proceed here but can you at least verify if t

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-06-13 Thread Timm Baeder via cfe-commits
@@ -4272,6 +4272,12 @@ def MoveIfNsoexcept : CxxLibBuiltin<"utility"> { let Namespace = "std"; } +def Invoke : Builtin { + let Spellings = ["__builtin_invoke"]; + let Attributes = [CustomTypeChecking, Constexpr]; tbaederr wrote: There are no changes to `E

[clang] Add missing intrinsics to cuda headers (PR #143664)

2025-06-13 Thread via cfe-commits
https://github.com/vitor1001 updated https://github.com/llvm/llvm-project/pull/143664 >From 079672a23dd5ef832f4fa9b974b3b23b2b48a207 Mon Sep 17 00:00:00 2001 From: Vitor Sessak Date: Wed, 11 Jun 2025 08:21:48 + Subject: [PATCH] Add missing intrinsics to cuda headers. LLVM prevents the sm_3

[clang-tools-extra] [clang-tidy][performance-unnecessary-value-param] Avoid in coroutines (PR #140912)

2025-06-13 Thread Dmitry Polukhin via cfe-commits
dmpolukhin wrote: @vbvictor please take another look, all comments resolved. https://github.com/llvm/llvm-project/pull/140912 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] Added SanitizerHandler mapping, trap messages in debug info, and corresponding test cases. (PR #143758)

2025-06-13 Thread Michael Buch via cfe-commits
@@ -4041,7 +4133,8 @@ void CodeGenFunction::EmitUnreachable(SourceLocation Loc) { void CodeGenFunction::EmitTrapCheck(llvm::Value *Checked, SanitizerHandler CheckHandlerID, -bool NoMerge) { +

[clang] [clang][CodeGen] Added SanitizerHandler mapping, trap messages in debug info, and corresponding test cases. (PR #143758)

2025-06-13 Thread Michael Buch via cfe-commits
https://github.com/Michael137 edited https://github.com/llvm/llvm-project/pull/143758 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add missing intrinsics to cuda headers (PR #143664)

2025-06-13 Thread via cfe-commits
vitor1001 wrote: Thanks, good suggestions, all done. https://github.com/llvm/llvm-project/pull/143664 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] Added SanitizerHandler mapping, trap messages in debug info, and corresponding test cases. (PR #143758)

2025-06-13 Thread Michael Buch via cfe-commits
@@ -4051,6 +4144,14 @@ void CodeGenFunction::EmitTrapCheck(llvm::Value *Checked, llvm::BasicBlock *&TrapBB = TrapBBs[CheckHandlerID]; + llvm::DILocation *TrapLocation = Builder.getCurrentDebugLocation(); + llvm::StringRef Category = GetTrapMessageForHandler(CheckHandlerID

[clang] [clang][CodeGen] Added SanitizerHandler mapping, trap messages in debug info, and corresponding test cases. (PR #143758)

2025-06-13 Thread Michael Buch via cfe-commits
https://github.com/Michael137 edited https://github.com/llvm/llvm-project/pull/143758 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] Added SanitizerHandler mapping, trap messages in debug info, and corresponding test cases. (PR #143758)

2025-06-13 Thread Michael Buch via cfe-commits
@@ -0,0 +1,16 @@ +// RUN: %clang -O0 -g -debug-info-kind=standalone -dwarf-version=5 -fsanitize=undefined \ +// RUN: -fsanitize-trap=undefined -emit-llvm -S -c %s -o - | FileCheck %s + +void target() { } + +int function_type_mismatch() { +int (*fp_int)(int); + +fp_int = (

[clang] [llvm] [AArch64] Add support for -mlong-calls code generation (PR #142982)

2025-06-13 Thread Peter Smith via cfe-commits
smithp35 wrote: > Thanks @smithp35 for your solution! I would like to kindly ask for your > expertise in reviewing the following code, which implements backend support > for -mlong-calls on AArch64 targets. It might not need to be merged, just > considering it as an optional approach. Thank yo

[clang] [Driver] Add support for GCC installation detection in Baremetal toolchain (PR #121829)

2025-06-13 Thread Peter Smith via cfe-commits
@@ -110,56 +145,113 @@ static std::string computeBaseSysRoot(const Driver &D, bool IncludeTriple) { return std::string(SysRootDir); } -BareMetal::BareMetal(const Driver &D, const llvm::Triple &Triple, - const ArgList &Args) -: ToolChain(D, Triple, Ar

[clang-tools-extra] [clang-tidy][performance-unnecessary-value-param] Avoid in coroutines (PR #140912)

2025-06-13 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin edited https://github.com/llvm/llvm-project/pull/140912 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][performance-unnecessary-value-param] Avoid in coroutines (PR #140912)

2025-06-13 Thread Dmitry Polukhin via cfe-commits
@@ -0,0 +1,65 @@ +// RUN: %check_clang_tidy -std=c++20-or-later %s performance-unnecessary-value-param %t -- -fix-errors dmpolukhin wrote: I prefer to have 3 command to also test the default value for the flag. https://github.com/llvm/llvm-project/pull/140912 _

[clang-tools-extra] [clang-tidy][performance-unnecessary-value-param] Avoid in coroutines (PR #140912)

2025-06-13 Thread Dmitry Polukhin via cfe-commits
@@ -63,7 +65,11 @@ void UnnecessaryValueParamCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher( traverse( TK_AsIs, - functionDecl(hasBody(stmt()), isDefinition(), unless(isImplicit()), + functionDecl(hasBody(IsAllowedInCorout

[clang] [Driver] Add support for GCC installation detection in Baremetal toolchain (PR #121829)

2025-06-13 Thread Peter Smith via cfe-commits
https://github.com/smithp35 approved this pull request. I've rechecked the toolchain with the latest change and I can now build with `--target=arm-none-eabi -march=armv7-m` with a GCC toolchain in `/usr/lib/arm-none-eabi` Putting the approve back on. https://github.com/llvm/llvm-project/pul

[clang] [clang-tools-extra] [clang-tidy] Warn about misuse of sizeof operator in loops. (PR #143205)

2025-06-13 Thread Baranov Victor via cfe-commits
@@ -164,6 +164,53 @@ int Test2(MyConstChar* A) { return sum; } +struct A { + int array[10]; +}; + +struct B { + struct A a; +}; + +void loop_access_elements(int num, struct B b) { +struct A arr[10]; +char buf[20]; + +// CHECK-MESSAGES: :[[@LINE+1]]:5: warning:

[clang] [clang-tools-extra] [clang-tidy] Warn about misuse of sizeof operator in loops. (PR #143205)

2025-06-13 Thread Baranov Victor via cfe-commits
@@ -353,6 +367,19 @@ void SizeofExpressionCheck::check(const MatchFinder::MatchResult &Result) { diag(E->getBeginLoc(), "suspicious usage of 'sizeof(char*)'; do you mean 'strlen'?") << E->getSourceRange(); + } else if (const auto *E = Result.Nodes.getNode

[clang] [llvm] [RISCV] Remove B and Zbc extension from Andes series cpus. (PR #144022)

2025-06-13 Thread Pengcheng Wang via cfe-commits
wangpc-pp wrote: Not related to this PR, but I'd like to raise the question here: For configurable cores, what is the best way to specify the features? `-mcpu` is meant to support the base configuration, but how can we specify the additional optional extensions? Apparently, failing back to `-m

[clang] [clang-tools-extra] [clang-tidy] Warn about misuse of sizeof operator in loops. (PR #143205)

2025-06-13 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor deleted https://github.com/llvm/llvm-project/pull/143205 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang-tidy] Warn about misuse of sizeof operator in loops. (PR #143205)

2025-06-13 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor deleted https://github.com/llvm/llvm-project/pull/143205 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang-tidy] Warn about misuse of sizeof operator in loops. (PR #143205)

2025-06-13 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/143205 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang-tidy] Warn about misuse of sizeof operator in loops. (PR #143205)

2025-06-13 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor deleted https://github.com/llvm/llvm-project/pull/143205 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][performance-unnecessary-value-param] Avoid in coroutines (PR #140912)

2025-06-13 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/140912 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][performance-unnecessary-value-param] Avoid in coroutines (PR #140912)

2025-06-13 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor approved this pull request. LGTM, with minor suggestions https://github.com/llvm/llvm-project/pull/140912 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][performance-unnecessary-value-param] Avoid in coroutines (PR #140912)

2025-06-13 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,65 @@ +// RUN: %check_clang_tidy -std=c++20-or-later %s performance-unnecessary-value-param %t -- -fix-errors vbvictor wrote: Do we need to have all 3 run commands? I suppose only 2 are needed, for `Coroutines = true` and `Coroutines = false` https:

[clang] 8ba62fd - [CIR] Function calls with aggregate arguments and return values (#143377)

2025-06-13 Thread via cfe-commits
Author: Sirui Mu Date: 2025-06-13T16:47:56+08:00 New Revision: 8ba62fdb3d2da2f5f199ee7a07222620a451293f URL: https://github.com/llvm/llvm-project/commit/8ba62fdb3d2da2f5f199ee7a07222620a451293f DIFF: https://github.com/llvm/llvm-project/commit/8ba62fdb3d2da2f5f199ee7a07222620a451293f.diff LOG:

[clang] [CIR] Function calls with aggregate arguments and return values (PR #143377)

2025-06-13 Thread Sirui Mu via cfe-commits
https://github.com/Lancern closed https://github.com/llvm/llvm-project/pull/143377 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix crash with delayed typo correction (PR #140571)

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

[clang] Fix crash with delayed typo correction (PR #140571)

2025-06-13 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: These changes are no longer necessary after 9eef4d1c5fa6b1bcbbe675c14ca8301d5d346f7b so closing the PR https://github.com/llvm/llvm-project/pull/140571 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[clang-tools-extra] [clangd] Add tweak to override pure virtuals (PR #139348)

2025-06-13 Thread Marco Maia via cfe-commits
marcogmaia wrote: Ping https://github.com/llvm/llvm-project/pull/139348 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clangd] Collect references in array designators (PR #140356)

2025-06-13 Thread Aleksandr Platonov via cfe-commits
https://github.com/ArcsinX updated https://github.com/llvm/llvm-project/pull/140356 >From 382ac0f0147cfefef9ef1e9b4745178c0b001e00 Mon Sep 17 00:00:00 2001 From: Aleksandr Platonov Date: Sat, 17 May 2025 08:05:21 +0300 Subject: [PATCH] [clangd] Collect references in array designators --- clan

[clang] [Clang][Sema] Apply CWG400 'Using-declarations and the "struct hack"' to C++98 mode (PR #143492)

2025-06-13 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: What is being fixed here? We already issue a diagnostic: https://godbolt.org/z/EsYaM https://github.com/llvm/llvm-project/pull/143492 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailma

[clang-tools-extra] [clang-tidy][performance-unnecessary-value-param] Avoid in coroutines (PR #140912)

2025-06-13 Thread Baranov Victor via cfe-commits
@@ -63,7 +65,11 @@ void UnnecessaryValueParamCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher( traverse( TK_AsIs, - functionDecl(hasBody(stmt()), isDefinition(), unless(isImplicit()), + functionDecl(hasBody(IsAllowedInCorout

[clang-tools-extra] [clang-tidy][performance-unnecessary-value-param] Avoid in coroutines (PR #140912)

2025-06-13 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/140912 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][performance-unnecessary-value-param] Avoid in coroutines (PR #140912)

2025-06-13 Thread Baranov Victor via cfe-commits
@@ -63,7 +65,11 @@ void UnnecessaryValueParamCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher( traverse( TK_AsIs, - functionDecl(hasBody(stmt()), isDefinition(), unless(isImplicit()), + functionDecl(hasBody(IsAllowedInCorout

[clang] [clang-tools-extra] [clangd] Collect references in array designators (PR #140356)

2025-06-13 Thread Aleksandr Platonov via cfe-commits
https://github.com/ArcsinX updated https://github.com/llvm/llvm-project/pull/140356 >From 516384ea52abe3409b0e8340a73d7395f19b9bf5 Mon Sep 17 00:00:00 2001 From: Aleksandr Platonov Date: Fri, 13 Jun 2025 14:23:51 +0300 Subject: [PATCH] [clangd] Collect references in array designators --- clan

[clang] 30725ef - Fix build after removing delayed typo expression

2025-06-13 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2025-06-13T07:12:41-04:00 New Revision: 30725efe671bc82bf9095a575aece60fc40fbef5 URL: https://github.com/llvm/llvm-project/commit/30725efe671bc82bf9095a575aece60fc40fbef5 DIFF: https://github.com/llvm/llvm-project/commit/30725efe671bc82bf9095a575aece60fc40fbef5.diff

[clang] [Clang] Added explanation why `is_constructible` evaluated to false. (PR #143309)

2025-06-13 Thread Mikael Holmén via cfe-commits
mikaelholmen wrote: Hi @egorshamshura and @cor3ntin It seems like a bunch of libc++ testcases start failing with this patch: ``` Failed Tests (9): llvm-libc++-shared.cfg.in :: libcxx/selftest/dsl/dsl.sh.py llvm-libc++-shared.cfg.in :: libcxx/utilities/expected/expected.expected/and_then.man

[clang-tools-extra] [clang-tidy] Added bugprone-unsequenced-global-accesses check (PR #130421)

2025-06-13 Thread Baranov Victor via cfe-commits
vbvictor wrote: Thank you for your long and detailed answer! Indeed, the check can benefit a lot from path-sensitive analysis: - Easier traversing with less boilerplate code. - Easier handling of edge-cases like struct fields and unions, support of local variables. - Fewer false-positives with

[clang] [Clang] fix missing source location for errors in macro-expanded (PR #143460)

2025-06-13 Thread Ross Kirsling via cfe-commits
@@ -832,10 +832,13 @@ StmtResult Parser::ParseCaseStatement(ParsedStmtContext StmtCtx, << "'case'" << tok::colon << FixItHint::CreateReplacement(ColonLoc, ":"); } else { - SourceLocation ExpectedLoc = PP.getLocForEndOfToken(PrevTokLocation); +

[clang] [Clang] fix missing source location for errors in macro-expanded (PR #143460)

2025-06-13 Thread Oleksandr T. via cfe-commits
@@ -832,10 +832,13 @@ StmtResult Parser::ParseCaseStatement(ParsedStmtContext StmtCtx, << "'case'" << tok::colon << FixItHint::CreateReplacement(ColonLoc, ":"); } else { - SourceLocation ExpectedLoc = PP.getLocForEndOfToken(PrevTokLocation); +

[clang] [llvm] [RISCV] Fix incorrect predicates for fp16 permutation intrinsics (PR #144063)

2025-06-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-risc-v Author: Jim Lin (tclin914) Changes vrgatherei16, vslideup and vslidedown should be supported with fp16 type for Zvfhmin. Fixes https://github.com/llvm/llvm-project/issues/143975. --- Full diff: https://github.com/llvm/llvm-project/pull/

[clang] [llvm] [RISCV] Fix incorrect predicates for fp16 permutation intrinsics (PR #144063)

2025-06-13 Thread Jim Lin via cfe-commits
https://github.com/tclin914 created https://github.com/llvm/llvm-project/pull/144063 vrgatherei16, vslideup and vslidedown should be supported with fp16 type for Zvfhmin. Fixes https://github.com/llvm/llvm-project/issues/143975. >From 2efc3784e8a253c5e6c4737d11758a5597a8cff2 Mon Sep 17 00:00:

[clang] [Clang] fix missing source location for errors in macro-expanded (PR #143460)

2025-06-13 Thread Ross Kirsling via cfe-commits
@@ -832,10 +832,13 @@ StmtResult Parser::ParseCaseStatement(ParsedStmtContext StmtCtx, << "'case'" << tok::colon << FixItHint::CreateReplacement(ColonLoc, ":"); } else { - SourceLocation ExpectedLoc = PP.getLocForEndOfToken(PrevTokLocation); +

[clang] [Preprocessor] Do not expand macros if the input is already preprocessed (PR #137665)

2025-06-13 Thread Juan Manuel Martinez Caamaño via cfe-commits
@@ -84,6 +84,8 @@ class FrontendAction { /// \return True on success; on failure ExecutionAction() and /// EndSourceFileAction() will not be called. virtual bool BeginSourceFileAction(CompilerInstance &CI) { +if (CurrentInput.isPreprocessed()) + CI.getPreprocesso

[clang] [clang-tools-extra] [clangd] Collect references in array designators (PR #140356)

2025-06-13 Thread Aleksandr Platonov via cfe-commits
https://github.com/ArcsinX updated https://github.com/llvm/llvm-project/pull/140356 >From c4431805e366c7b22afaf36f4dadbdb317faee59 Mon Sep 17 00:00:00 2001 From: Aleksandr Platonov Date: Fri, 13 Jun 2025 14:23:51 +0300 Subject: [PATCH] [clangd] Collect references in array designators --- clan

[clang] [clang] Reset FileID based diag state mappings (PR #143695)

2025-06-13 Thread kadir çetinkaya via cfe-commits
kadircet wrote: ok so I did a little more investigation here, and tl;dr is: - LLVM's target registry mechanism relies on static initialization of variables by the main driver program (usually clang driver takes care of this for real world runs). - There are some tests (especially the ones that

[clang] [clang] Merge gtest binaries into AllClangUnitTests (PR #134196)

2025-06-13 Thread kadir çetinkaya via cfe-commits
kadircet wrote: hi folks, this change triggered some other failures in a distance, you can see detailed analysis in https://github.com/llvm/llvm-project/pull/143695#issuecomment-2970691063. but tl;dr; LLVM shares some state throughout a process. This isn't something new with this change, unit

[clang] [Clang] Explain why is_standard_layout evaluated to false (PR #143722)

2025-06-13 Thread Samarth Narang via cfe-commits
https://github.com/snarang181 updated https://github.com/llvm/llvm-project/pull/143722 >From e96c9c940bbfaf9da752c3537ea8bd023b8b15aa Mon Sep 17 00:00:00 2001 From: Samarth Narang Date: Mon, 2 Jun 2025 19:30:39 -0400 Subject: [PATCH 1/2] Add std layout diagnostics Add diagnostic test cases ---

[clang] [flang] [llvm] [mlir] Atomic control backend (PR #143769)

2025-06-13 Thread Anchu Rajendran S via cfe-commits
https://github.com/anchuraj updated https://github.com/llvm/llvm-project/pull/143769 >From c9b65080c1301c46b05fddc1278eaf2817963cb9 Mon Sep 17 00:00:00 2001 From: Anchu Rajendran Date: Wed, 4 Jun 2025 15:12:49 -0500 Subject: [PATCH 1/4] [flang][flang-driver] atomic control support --- clang/i

[clang-tools-extra] [clang-tidy] Add bugprone-move-shared-pointer-contents check. (PR #67467)

2025-06-13 Thread via cfe-commits
https://github.com/pizzud updated https://github.com/llvm/llvm-project/pull/67467 >From 04a3e8d8cbd6943f44a81fddb0524902202a1a78 Mon Sep 17 00:00:00 2001 From: David Pizzuto Date: Tue, 26 Sep 2023 10:45:42 -0700 Subject: [PATCH 01/12] [clang-tidy] Add bugprone-move-shared-pointer-contents chec

[clang] [flang] [llvm] [mlir] [mlir][OpenMP][llvm]Atomic control backend (PR #143769)

2025-06-13 Thread Anchu Rajendran S via cfe-commits
https://github.com/anchuraj edited https://github.com/llvm/llvm-project/pull/143769 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Diagnose forming references to nullptr (PR #143667)

2025-06-13 Thread Aaron Ballman via cfe-commits
@@ -5243,7 +5281,9 @@ static bool EvaluateVarDecl(EvalInfo &Info, const VarDecl *VD) { if (InitE->isValueDependent()) return false; - if (!EvaluateInPlace(Val, Info, Result, InitE)) { + if (VD->getType()->isReferenceType()) { AaronBallman wrote: So a

[clang] [Clang] Diagnose forming references to nullptr (PR #143667)

2025-06-13 Thread Aaron Ballman via cfe-commits
@@ -1540,6 +1540,7 @@ static bool isModification(AccessKinds AK) { case AK_DynamicCast: case AK_TypeId: case AK_IsWithinLifetime: + case AK_ReferenceInitialization: AaronBallman wrote: Why is initialization not considered a modification but construction

[clang] Revert "[Clang] Added explanation why `is_constructible` evaluated to false. " (PR #144127)

2025-06-13 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: CC @egorshamshura as the original patch author. https://github.com/llvm/llvm-project/pull/144127 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Revert "[Clang] Added explanation why `is_constructible` evaluated to false. " (PR #144127)

2025-06-13 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM! Thanks for the revert https://github.com/llvm/llvm-project/pull/144127 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] use colon char instead of token name (PR #144068)

2025-06-13 Thread Oleksandr T. via cfe-commits
a-tarasyuk wrote: > Ohh, you beat me by a minute. 😆 I suppose > https://github.com/llvm/llvm-project/pull/144069 could be closed then. You can copy the tests/changes from this PR into yours — I'll close this one. https://github.com/llvm/llvm-project/pull/144068

[clang] [Clang] use colon char instead of token name (PR #144068)

2025-06-13 Thread Mariya Podchishchaeva via cfe-commits
https://github.com/Fznamznon approved this pull request. https://github.com/llvm/llvm-project/pull/144068 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 9670e09 - Enable unique-object-duplication warning for windows (#143537)

2025-06-13 Thread via cfe-commits
Author: Devon Loehr Date: 2025-06-13T10:29:42-04:00 New Revision: 9670e09d0eac596fba6bf03ef1a6f3229dddee46 URL: https://github.com/llvm/llvm-project/commit/9670e09d0eac596fba6bf03ef1a6f3229dddee46 DIFF: https://github.com/llvm/llvm-project/commit/9670e09d0eac596fba6bf03ef1a6f3229dddee46.diff L

[clang] Enable unique-object-duplication warning for windows (PR #143537)

2025-06-13 Thread Devon Loehr via cfe-commits
https://github.com/DKLoehr closed https://github.com/llvm/llvm-project/pull/143537 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AVR] Add support for many new AVR mcus like AVR128DB28 (PR #143914)

2025-06-13 Thread Tom Vijlbrief via cfe-commits
https://github.com/tomtor updated https://github.com/llvm/llvm-project/pull/143914 >From 3e070f4aa1e105a4f5b486b662e481195a0a4608 Mon Sep 17 00:00:00 2001 From: Tom Vijlbrief Date: Thu, 12 Jun 2025 16:59:46 +0200 Subject: [PATCH 1/3] Add support for many new AVR mcus like AVR128DB28 --- clang

[clang-tools-extra] [clang-tidy] properly handle private move constructors in `modernize-pass-by-value` check (PR #141304)

2025-06-13 Thread Baranov Victor via cfe-commits
vbvictor wrote: Ping https://github.com/llvm/llvm-project/pull/141304 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][SPIRV] Use resource names (PR #143412)

2025-06-13 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `lld-x86_64-ubuntu-fast` running on `as-builder-4` while building `clang,llvm` at step 6 "test-build-unified-tree-check-all". Full details are available at: https://lab.llvm.org/buildbot/#/builders/33/builds/18240 Here is th

[clang] [CIR] Change default assumption about allowing builtins (PR #144004)

2025-06-13 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor closed https://github.com/llvm/llvm-project/pull/144004 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 36c710c - [CIR] Change default assumption about allowing builtins (#144004)

2025-06-13 Thread via cfe-commits
Author: Andy Kaylor Date: 2025-06-13T09:42:58-07:00 New Revision: 36c710c40e8a59f74f56eb0e04e438cec5532ec5 URL: https://github.com/llvm/llvm-project/commit/36c710c40e8a59f74f56eb0e04e438cec5532ec5 DIFF: https://github.com/llvm/llvm-project/commit/36c710c40e8a59f74f56eb0e04e438cec5532ec5.diff L

[clang] [KeyInstr][Clang][NFC] Don't set -dwarf-use-key-instructions (PR #144115)

2025-06-13 Thread Orlando Cazalet-Hyams via cfe-commits
https://github.com/OCHyams created https://github.com/llvm/llvm-project/pull/144115 Once #144104 lands the flag is true by default (because each DISubprogram will track whether or not it's using key instructions). >From 748d6d5a7c53b21e6fe1170a8c0793e91196a507 Mon Sep 17 00:00:00 2001 From: Or

[clang] [KeyInstr][Clang][NFC] Don't set -dwarf-use-key-instructions (PR #144115)

2025-06-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Orlando Cazalet-Hyams (OCHyams) Changes Once #144104 lands the flag is true by default (because each DISubprogram will track whether or not it's using key instructions). --- Full diff: https://github.com/llvm/llvm-project/pull/144115.diff

[clang] [llvm] [AArch64][VecLib] Add libmvec support for AArch64 targets (PR #143696)

2025-06-13 Thread Sander de Smalen via cfe-commits
@@ -237,6 +237,266 @@ TLI_DEFINE_VECFUNC("llvm.log.f64", "_ZGVdN4v_log", FIXED(4), "_ZGV_LLVM_N4v") TLI_DEFINE_VECFUNC("llvm.log.f32", "_ZGVbN4v_logf", FIXED(4), "_ZGV_LLVM_N4v") TLI_DEFINE_VECFUNC("llvm.log.f32", "_ZGVdN8v_logf", FIXED(8), "_ZGV_LLVM_N8v") +#elif defined(TLI

[clang] [clang-format] Fix a bug in annotating braces (PR #144095)

2025-06-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-format Author: Owen Pan (owenca) Changes Stop looking for function decls after hitting a BK_BracedInit l_brace. Fixes #144057. --- Full diff: https://github.com/llvm/llvm-project/pull/144095.diff 2 Files Affected: - (modified) clang/lib/Format

[clang] [llvm] [PowerPC] frontend get target feature from backend with cpu name (PR #137670)

2025-06-13 Thread zhijian lin via cfe-commits
@@ -8,6 +8,12 @@ if (HAS_WERROR_GLOBAL_CTORS AND NOT LLVM_HAS_NOGLOBAL_CTOR_MUTEX) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=global-constructors") endif() +set(LLVM_TARGET_DEFINITIONS ${LLVM_MAIN_SRC_DIR}/lib/Target/PowerPC/PPC.td) + +tablegen(LLVM PPCGenSubtargetInfo

[clang] 52d3486 - Fix and reapply IR PGO support for Flang (#142892)

2025-06-13 Thread via cfe-commits
Author: FYK Date: 2025-06-13T12:05:16-06:00 New Revision: 52d34865b9db3485c8a671a88cc571270349f720 URL: https://github.com/llvm/llvm-project/commit/52d34865b9db3485c8a671a88cc571270349f720 DIFF: https://github.com/llvm/llvm-project/commit/52d34865b9db3485c8a671a88cc571270349f720.diff LOG: Fix

[clang] [flang] [llvm] Fix and reapply IR PGO support for Flang (PR #142892)

2025-06-13 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu closed https://github.com/llvm/llvm-project/pull/142892 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-reorder-fields] Prevent rewriting unsupported cases (PR #142149)

2025-06-13 Thread Clement Courbet via cfe-commits
@@ -0,0 +1,15 @@ +// RUN: clang-reorder-fields -record-name ::bar::Foo -fields-order y,x %s -- | FileCheck %s + +namespace bar { + +#define DEFINE_FIELDS + +// This is okay to reorder. +struct Foo { +#ifdef DEFINE_FIELDS // CHECK: {{^#ifdef DEFINE_FIELDS}} + int y;

[clang-tools-extra] [clang-reorder-fields] Prevent rewriting unsupported cases (PR #142149)

2025-06-13 Thread Clement Courbet via cfe-commits
legrosbuffle wrote: Not a big deal, but note for next time: we don't do force push to avoid losing context (https://llvm.org/docs/GitHub.html#rebasing-pull-requests-and-force-pushes) https://github.com/llvm/llvm-project/pull/142149 ___ cfe-commits m

[clang] [Clang] use colon char instead of token name (PR #144068)

2025-06-13 Thread Oleksandr T. via cfe-commits
a-tarasyuk wrote: @rkirsling, this test does not verify the fix https://github.com/llvm/llvm-project/pull/144069/files#diff-b87b117875d2e75dc1ef39535756591a688853bbeb7f83e5b4df6bafca111fa0R239-R241 [switch-recovery.cpp](https://github.com/llvm/llvm-project/blob/cf6ae065a042aae6324b28e99628c40bc

[clang] [Clang] Diagnose forming references to nullptr (PR #143667)

2025-06-13 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin updated https://github.com/llvm/llvm-project/pull/143667 >From 83d2fe6d4fb870e816e6576636864f50586fe37a Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Mon, 9 Jun 2025 17:22:06 +0200 Subject: [PATCH 1/4] [Clang] Diagnose forming references to nullptr Per [decl.r

[clang] [Clang] Fix fix-it hint regression from #143460 (PR #144069)

2025-06-13 Thread Ross Kirsling via cfe-commits
https://github.com/rkirsling updated https://github.com/llvm/llvm-project/pull/144069 >From be121c500684e971ad696be8d53db732665d851c Mon Sep 17 00:00:00 2001 From: Ross Kirsling Date: Fri, 13 Jun 2025 21:51:25 +0900 Subject: [PATCH 1/3] [Clang] Fix fix-it hint regression from #143460 `:` began

[clang] Introduce intra-procedural lifetime analysis in Clang (PR #142313)

2025-06-13 Thread Utkarsh Saxena via cfe-commits
@@ -0,0 +1,728 @@ +#include "clang/Analysis/Analyses/LifetimeSafety.h" +#include "clang/AST/Decl.h" +#include "clang/AST/Expr.h" +#include "clang/AST/StmtVisitor.h" +#include "clang/AST/Type.h" +#include "clang/Analysis/AnalysisDeclContext.h" +#include "clang/Analysis/CFG.h" +#inc

[clang] Introduce intra-procedural lifetime analysis in Clang (PR #142313)

2025-06-13 Thread Utkarsh Saxena via cfe-commits
@@ -0,0 +1,728 @@ +#include "clang/Analysis/Analyses/LifetimeSafety.h" +#include "clang/AST/Decl.h" +#include "clang/AST/Expr.h" +#include "clang/AST/StmtVisitor.h" +#include "clang/AST/Type.h" +#include "clang/Analysis/AnalysisDeclContext.h" +#include "clang/Analysis/CFG.h" +#inc

  1   2   3   4   >