[clang] [llvm] [BPF] Make -mcpu=v3 as the default (PR #107008)

2024-09-02 Thread via cfe-commits
@@ -38,16 +38,22 @@ void BPFTargetInfo::getTargetDefines(const LangOptions &Opts, Builder.defineMacro("__BPF_FEATURE_ADDR_SPACE_CAST"); - if (CPU.empty() || CPU == "generic" || CPU == "v1") { + if (CPU == "generic" || CPU == "v1") { eddyz87 wrote: Thank

[clang] [analyzer] Fix false positive for stack-addr leak on simple param ptr (PR #107003)

2024-09-02 Thread Arseniy Zaostrovnykh via cfe-commits
https://github.com/necto edited https://github.com/llvm/llvm-project/pull/107003 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Fix false positive for stack-addr leak on simple param ptr (PR #107003)

2024-09-02 Thread Arseniy Zaostrovnykh via cfe-commits
@@ -791,3 +791,58 @@ void global_ptr_to_ptr() { *global_pp = nullptr; } } // namespace leaking_via_indirect_global_invalidated + +namespace not_leaking_via_simple_ptr { +void simple_ptr(const char *p) { + char tmp; + p = &tmp; // no-warning +} + +void ref_ptr(const char *&p

[clang] [clang][bytecode] Implement placement-new (PR #107033)

2024-09-02 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/107033 >From be9096f14454cf1450915bd044aef1c037c3e935 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 3 Sep 2024 02:52:35 +0200 Subject: [PATCH] [clang][bytecode] Implement placement-new ---

[clang] [clang] Fix FnInfoOpts::operator&= and FnInfoOpts::operator|= not updating assigned operands (PR #107050)

2024-09-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: None (mylai-mtk) Changes Hi, this is my first time sending a PR to the LLVM repo. I ran into this bug when implementing a feature in my private repo, and I think maybe I can take this small patch as a chance to practice contributin

[clang] [clang] Fix FnInfoOpts::operator&= and FnInfoOpts::operator|= not updating assigned operands (PR #107050)

2024-09-02 Thread via cfe-commits
github-actions[bot] wrote: Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it

[clang] [clang] Fix FnInfoOpts::operator&= and FnInfoOpts::operator|= not updating assigned operands (PR #107050)

2024-09-02 Thread via cfe-commits
https://github.com/mylai-mtk created https://github.com/llvm/llvm-project/pull/107050 Hi, this is my first time sending a PR to the LLVM repo. I ran into this bug when implementing a feature in my private repo, and I think maybe I can take this small patch as a chance to practice contributing t

[clang-tools-extra] Update clang tidy Contributing guide (PR #106672)

2024-09-02 Thread via cfe-commits
MichelleCDjunaidi wrote: @LegalizeAdulthood Thanks for bringing this up because it slipped my mind to test it on Windows! I honestly have only tested it on Linux, and I currently don't have access to my laptop for the week. If anyone reads this and tests it out, please tell the results. I'll o

[clang] [clang][bytecode] Implement placement-new (PR #107033)

2024-09-02 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/107033 >From 903663240c79db28a3153e2d7154bb40c214 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 3 Sep 2024 02:52:35 +0200 Subject: [PATCH] [clang][bytecode] Implement placement-new ---

[clang] [analyzer] Fix false positive for stack-addr leak on simple param ptr (PR #107003)

2024-09-02 Thread Balazs Benics via cfe-commits
@@ -791,3 +791,58 @@ void global_ptr_to_ptr() { *global_pp = nullptr; } } // namespace leaking_via_indirect_global_invalidated + +namespace not_leaking_via_simple_ptr { +void simple_ptr(const char *p) { + char tmp; + p = &tmp; // no-warning +} + +void ref_ptr(const char *&p

[clang] [analyzer] Fix false positive for stack-addr leak on simple param ptr (PR #107003)

2024-09-02 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/107003 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Fix false positive for stack-addr leak on simple param ptr (PR #107003)

2024-09-02 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. You nailed the tests. You inspired one more test, and that's it I think. Once you added that, lets merge this. https://github.com/llvm/llvm-project/pull/107003 ___ cfe-commits mailing list cfe-co

[clang-tools-extra] [clangd] Add inlay hints for default function arguments and implicit lambda captures (PR #95712)

2024-09-02 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 edited https://github.com/llvm/llvm-project/pull/95712 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Add inlay hints for default function arguments and implicit lambda captures (PR #95712)

2024-09-02 Thread Nathan Ridge via cfe-commits
@@ -709,7 +762,8 @@ class InlayHintVisitor : public RecursiveASTVisitor { private: using NameVec = SmallVector; - void processCall(Callee Callee, llvm::ArrayRef Args) { + void processCall(Callee Callee, SourceRange LParenOrBraceRange, HighCommander4 wrote

[clang-tools-extra] [clangd] Add inlay hints for default function arguments and implicit lambda captures (PR #95712)

2024-09-02 Thread Nathan Ridge via cfe-commits
@@ -755,12 +812,33 @@ class InlayHintVisitor : public RecursiveASTVisitor { bool NameHint = shouldHintName(Args[I], Name); bool ReferenceHint = shouldHintReference(Params[I], ForwardedParams[I]); + bool IsDefault = isa(Args[I]); HighCommander

[clang-tools-extra] [clangd] Add inlay hints for default function arguments and implicit lambda captures (PR #95712)

2024-09-02 Thread Nathan Ridge via cfe-commits
@@ -372,6 +383,38 @@ maybeDropCxxExplicitObjectParameters(ArrayRef Params) { return Params; } +llvm::StringRef getLambdaCaptureName(const LambdaCapture &Capture) { + switch (Capture.getCaptureKind()) { + case LCK_This: + case LCK_StarThis: +return llvm::StringRef{"thi

[clang-tools-extra] [clangd] Add inlay hints for default function arguments and implicit lambda captures (PR #95712)

2024-09-02 Thread Nathan Ridge via cfe-commits
@@ -1681,6 +1681,21 @@ enum class InlayHintKind { /// This is a clangd extension. BlockEnd = 4, + /// An inlay hint that is for a variable captured implicitly in a lambda. + /// + /// An example of parameter hint for implicit lambda captures: + ///[&^] { return A;

[clang-tools-extra] [clangd] Add inlay hints for default function arguments and implicit lambda captures (PR #95712)

2024-09-02 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 requested changes to this pull request. Apologies for the slow response time, it's been quite a busy summer. High-level feedback: * Let's definitely split the default arguments part from the lambda captures part. Even if we decide we want both, it helps to hav

[clang-tools-extra] [clangd] Add inlay hints for default function arguments and implicit lambda captures (PR #95712)

2024-09-02 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 edited https://github.com/llvm/llvm-project/pull/95712 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Fix diagnostic for function overloading in extern "C" (PR #106033)

2024-09-02 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `sanitizer-ppc64le-linux` running on `ppc64le-sanitizer` while building `clang` at step 2 "annotate". Full details are available at: https://lab.llvm.org/buildbot/#/builders/72/builds/2892 Here is the relevant piece of the bu

[clang] [clang] Keep using declarations at head of list in addOrReplaceDecl (PR #105976)

2024-09-02 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank edited https://github.com/llvm/llvm-project/pull/105976 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Fix particular operator overload crash (PR #105976)

2024-09-02 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: The reason for the break in 0cb7e7ca0c864e052bf49978f3bcd667c9e16930 is that prior to this commit, using declarations were always kept at the front of the `NamedDecl` list. This behavior was changed in that commit. See a comment here: https://github.com/llvm/llvm-project/blob/3

[clang] [clang][Sema] Fix particular operator overload crash (PR #105976)

2024-09-02 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/105976 >From 465eadc6e5f83470764a14071f62f272c3cd7921 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Tue, 3 Sep 2024 00:43:30 -0400 Subject: [PATCH] [clang] Keep using declarations at head of list in addOrRe

[clang] [clang][bytecode] Implement placement-new (PR #107033)

2024-09-02 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/107033 >From cfdf24d7e50c13b4741336303dfe1e5abae3ed81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 3 Sep 2024 02:52:35 +0200 Subject: [PATCH] [clang][bytecode] Implement placement-new ---

[clang-tools-extra] Update clang tidy Contributing guide (PR #106672)

2024-09-02 Thread Richard Thomson via cfe-commits
LegalizeAdulthood wrote: > Alternatively, pressing the tab key after a previous matcher's open > parentheses would also Did you try this on Windows? Because in my experience all these TAB-complete actions depend on GNU readline which doesn't work on Windows. https://github.com/llvm/llvm-proj

[clang] [clang][Sema] Fix diagnostic for function overloading in extern "C" (PR #106033)

2024-09-02 Thread via cfe-commits
github-actions[bot] wrote: @s-watanabe314 Congratulations on having your first Pull Request (PR) merged into the LLVM Project! Your changes will be combined with recent changes from other authors, then tested by our [build bots](https://lab.llvm.org/buildbot/). If there is a problem with a

[clang] [clang][Sema] Fix diagnostic for function overloading in extern "C" (PR #106033)

2024-09-02 Thread via cfe-commits
https://github.com/s-watanabe314 closed https://github.com/llvm/llvm-project/pull/106033 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 78abeca - [clang][Sema] Fix diagnostic for function overloading in extern "C" (#106033)

2024-09-02 Thread via cfe-commits
Author: s-watanabe314 Date: 2024-09-03T13:22:33+09:00 New Revision: 78abeca1d88593d7f2a27f3c3e140abe77236e7e URL: https://github.com/llvm/llvm-project/commit/78abeca1d88593d7f2a27f3c3e140abe77236e7e DIFF: https://github.com/llvm/llvm-project/commit/78abeca1d88593d7f2a27f3c3e140abe77236e7e.diff

[clang] [clang][Sema] Fix diagnostic for function overloading in extern "C" (PR #106033)

2024-09-02 Thread via cfe-commits
s-watanabe314 wrote: Thank you for the approval. I have been granted commit access, so I will merge it myself. https://github.com/llvm/llvm-project/pull/106033 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mail

[clang] [clang][bytecode] Implement placement-new (PR #107033)

2024-09-02 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/107033 >From 6c722173d8a08f4c0bb75916ac88f2e37170c742 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 3 Sep 2024 02:52:35 +0200 Subject: [PATCH] [clang][bytecode] Implement placement-new ---

[clang] [C++20] [Modules] Embed all source files for C++20 Modules (PR #102444)

2024-09-02 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: @AaronBallman @iains I've sent the RFC here: https://discourse.llvm.org/t/rfc-modules-should-we-embed-sources-to-the-bmi/81029 https://github.com/llvm/llvm-project/pull/102444 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [llvm] [LTO] Reduce memory usage for import lists (PR #106772)

2024-09-02 Thread Kazu Hirata via cfe-commits
kazutakahirata wrote: > > It looks like this causes a compile-time regression. The clang thin link > > time increases by 1% > > (https://llvm-compile-time-tracker.com/compare_clang.php?from=9ccf82543d509bb5a0f5d0551fc4d6c1913b9a9b&to=5c0d61e318a77434487fcec8361d8110fb06e59d&stat=instructions%3A

[clang] tune the default stack protector level as SSPOn on Windows platform (PR #107043)

2024-09-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (wenqinI) Changes This commit tune the default stack protector level on Windows platform, it could improve performance and reduce binary size, will provide more details in related issue later. --- Full diff: https://github.com/llvm/

[clang] tune the default stack protector level as SSPOn on Windows platform (PR #107043)

2024-09-02 Thread via cfe-commits
https://github.com/wenqinI converted_to_draft https://github.com/llvm/llvm-project/pull/107043 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] tune the default stack protector level as SSPOn on Windows platform (PR #107043)

2024-09-02 Thread via cfe-commits
github-actions[bot] wrote: Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it

[clang] tune the default stack protector level as SSPOn on Windows platform (PR #107043)

2024-09-02 Thread via cfe-commits
https://github.com/wenqinI created https://github.com/llvm/llvm-project/pull/107043 This commit tune the default stack protector level on Windows platform, it could improve performance and reduce binary size, will provide more details in related issue later. >From dd5a44532e2d50348bfdcaef1ae2

[clang] [llvm] [BPF] Make -mcpu=v3 as the default (PR #107008)

2024-09-02 Thread via cfe-commits
https://github.com/yonghong-song updated https://github.com/llvm/llvm-project/pull/107008 >From 670fa2f6bf890b34cf256241fccc23d6d1ab3695 Mon Sep 17 00:00:00 2001 From: Yonghong Song Date: Sat, 31 Aug 2024 11:28:29 -0700 Subject: [PATCH] [BPF] Make -mcpu=v3 as the default Before llvm20, (void)_

[clang] [llvm] [BPF] Make -mcpu=v3 as the default (PR #107008)

2024-09-02 Thread via cfe-commits
@@ -38,16 +38,22 @@ void BPFTargetInfo::getTargetDefines(const LangOptions &Opts, Builder.defineMacro("__BPF_FEATURE_ADDR_SPACE_CAST"); - if (CPU.empty() || CPU == "generic" || CPU == "v1") { + if (CPU == "generic" || CPU == "v1") { yonghong-song wrote:

[clang] [C++20] [Modules] Embed all source files for C++20 Modules (PR #102444)

2024-09-02 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Thanks for the write-up. I've reverted and I'll try to open a RFC to get a wider discussion. https://github.com/llvm/llvm-project/pull/102444 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mail

[clang] 2cbd1bc - Revert "[C++20] [Modules] Embed all source files for C++20 Modules (#102444)"

2024-09-02 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-09-03T10:54:20+08:00 New Revision: 2cbd1bc830861bc08f78fb6cc11747b82f66c4c6 URL: https://github.com/llvm/llvm-project/commit/2cbd1bc830861bc08f78fb6cc11747b82f66c4c6 DIFF: https://github.com/llvm/llvm-project/commit/2cbd1bc830861bc08f78fb6cc11747b82f66c4c6.diff LO

[clang] [clang-format] Handle spaces in file paths in git-clang-format.bat (PR #107041)

2024-09-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-format Author: Owen Pan (owenca) Changes This patch is provided by @jeliebig. Fixes #107017. --- Full diff: https://github.com/llvm/llvm-project/pull/107041.diff 1 Files Affected: - (modified) clang/tools/clang-format/git-clang-format.bat (+1-

[clang] [clang-format] Handle spaces in file paths in git-clang-format.bat (PR #107041)

2024-09-02 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/107041 This patch is provided by @jeliebig. Fixes #107017. >From f44ecbe9880aba26ca02046dbe26582ea81abe73 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Mon, 2 Sep 2024 19:33:01 -0700 Subject: [PATCH] [clang-format] Ha

[clang] [flang] [llvm] [mlir] [ADT] Deprecate DenseMap::getOrInsertDefault (PR #107040)

2024-09-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-mlir Author: Kazu Hirata (kazutakahirata) Changes This patch deprecates DenseMap::getOrInsertDefault in favor of DenseMap::operator[], which does the same thing, has been around longer, and is also a household name as part of std::map and std::unordered_

[clang] [flang] [llvm] [mlir] [ADT] Deprecate DenseMap::getOrInsertDefault (PR #107040)

2024-09-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-flang-fir-hlfir @llvm/pr-subscribers-clang Author: Kazu Hirata (kazutakahirata) Changes This patch deprecates DenseMap::getOrInsertDefault in favor of DenseMap::operator[], which does the same thing, has been around longer, and is also a household name a

[clang] [flang] [llvm] [mlir] [ADT] Deprecate DenseMap::getOrInsertDefault (PR #107040)

2024-09-02 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/107040 This patch deprecates DenseMap::getOrInsertDefault in favor of DenseMap::operator[], which does the same thing, has been around longer, and is also a household name as part of std::map and std::unordered_m

[clang] [RFC][C++20][Modules] Fix crash when function and lambda inside loaded from different modules (PR #104512)

2024-09-02 Thread Chuanqi Xu via cfe-commits
Valentin Clement =?utf-8?b?KOODkOODrOODsw=?=,Kyungwoo Lee Message-ID: In-Reply-To: ChuanqiXu9 wrote: > > I am curious about your real project, is it open source? > > Unfortunately, it is not an open source project but we use bunch of OSS > libraries like Folly, Thrift and many other so I see

[clang] [analyzer] Fix false positive for stack-addr leak on simple param ptr (PR #107003)

2024-09-02 Thread Arseniy Zaostrovnykh via cfe-commits
@@ -791,3 +791,30 @@ void global_ptr_to_ptr() { *global_pp = nullptr; } } // namespace leaking_via_indirect_global_invalidated + +namespace not_leaking_via_simple_ptr { +void top(const char *p) { necto wrote: I am not sure what you are referring to by the "r

[clang] [analyzer] Fix false positive for stack-addr leak on simple param ptr (PR #107003)

2024-09-02 Thread Arseniy Zaostrovnykh via cfe-commits
https://github.com/necto updated https://github.com/llvm/llvm-project/pull/107003 >From da5671efccd0ba56a0dd983b04d1f798c5c35d0d Mon Sep 17 00:00:00 2001 From: Arseniy Zaostrovnykh Date: Mon, 2 Sep 2024 17:13:14 +0200 Subject: [PATCH 1/2] [analyzer] Fix false positive for stack-addr leak on si

[clang] [clang][bytecode] Implement placement-new (PR #107033)

2024-09-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Timm Baeder (tbaederr) Changes If we have a placement-new destination already, use that instead of allocating a new one. Tests are partially based on `test/SemaCXX/cxx2c-constexpr-placement-new.cpp`. --- Full diff: https://github.com/llvm

[clang] [clang][bytecode] Implement placement-new (PR #107033)

2024-09-02 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/107033 If we have a placement-new destination already, use that instead of allocating a new one. Tests are partially based on `test/SemaCXX/cxx2c-constexpr-placement-new.cpp`. >From 588703b329b186c3e85291abd63c8cf18f

[clang] [llvm] [BPF] Make -mcpu=v3 as the default (PR #107008)

2024-09-02 Thread via cfe-commits
https://github.com/4ast approved this pull request. Long overdue. -mcpu=v3 produces much better code and had kernel supports for many years. https://github.com/llvm/llvm-project/pull/107008 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https

[clang] [clang][OpenMP] `masked` and `master` are not capturing (PR #106787)

2024-09-02 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `sanitizer-ppc64le-linux` running on `ppc64le-sanitizer` while building `clang` at step 2 "annotate". Full details are available at: https://lab.llvm.org/buildbot/#/builders/72/builds/2885 Here is the relevant piece of the bu

[clang] [clang] Catch missing format attributes (PR #105479)

2024-09-02 Thread Aaron Puchert via cfe-commits
@@ -0,0 +1,176 @@ +// RUN: %clang_cc1 -fsyntax-only -verify=expected,beforeCxx2b -Wmissing-format-attribute %s +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++2b -Wmissing-format-attribute %s +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++23 -Wmissing-format-attribute %s +

[clang] [clang] Catch missing format attributes (PR #105479)

2024-09-02 Thread Aaron Puchert via cfe-commits
@@ -5335,6 +5335,217 @@ static void handlePreferredTypeAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) PreferredTypeAttr(S.Context, AL, ParmTSI)); } +// This function is called only if function call is not inside template body. +// TODO: Add call

[clang] [clang] Catch missing format attributes (PR #105479)

2024-09-02 Thread Aaron Puchert via cfe-commits
@@ -5335,6 +5335,217 @@ static void handlePreferredTypeAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) PreferredTypeAttr(S.Context, AL, ParmTSI)); } +// This function is called only if function call is not inside template body. +// TODO: Add call

[clang] [clang] Catch missing format attributes (PR #105479)

2024-09-02 Thread Aaron Puchert via cfe-commits
@@ -5335,6 +5335,217 @@ static void handlePreferredTypeAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) PreferredTypeAttr(S.Context, AL, ParmTSI)); } +// This function is called only if function call is not inside template body. +// TODO: Add call

[clang] [clang] Catch missing format attributes (PR #105479)

2024-09-02 Thread Aaron Puchert via cfe-commits
@@ -5335,6 +5335,217 @@ static void handlePreferredTypeAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) PreferredTypeAttr(S.Context, AL, ParmTSI)); } +// This function is called only if function call is not inside template body. +// TODO: Add call

[clang] [clang] Catch missing format attributes (PR #105479)

2024-09-02 Thread Aaron Puchert via cfe-commits
@@ -5335,6 +5335,217 @@ static void handlePreferredTypeAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) PreferredTypeAttr(S.Context, AL, ParmTSI)); } +// This function is called only if function call is not inside template body. +// TODO: Add call

[clang] [clang] Catch missing format attributes (PR #105479)

2024-09-02 Thread Aaron Puchert via cfe-commits
@@ -5335,6 +5335,217 @@ static void handlePreferredTypeAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) PreferredTypeAttr(S.Context, AL, ParmTSI)); } +// This function is called only if function call is not inside template body. +// TODO: Add call

[clang] [clang] Catch missing format attributes (PR #105479)

2024-09-02 Thread Aaron Puchert via cfe-commits
@@ -5335,6 +5335,217 @@ static void handlePreferredTypeAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) PreferredTypeAttr(S.Context, AL, ParmTSI)); } +// This function is called only if function call is not inside template body. +// TODO: Add call

[clang] [clang] Catch missing format attributes (PR #105479)

2024-09-02 Thread Aaron Puchert via cfe-commits
@@ -5335,6 +5335,217 @@ static void handlePreferredTypeAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) PreferredTypeAttr(S.Context, AL, ParmTSI)); } +// This function is called only if function call is not inside template body. +// TODO: Add call

[clang] [clang] Catch missing format attributes (PR #105479)

2024-09-02 Thread Aaron Puchert via cfe-commits
@@ -0,0 +1,251 @@ +// RUN: %clang_cc1 -fsyntax-only -verify=expected,c_diagnostics -Wmissing-format-attribute %s +// RUN: %clang_cc1 -fsyntax-only -Wmissing-format-attribute -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s +// RUN: %clang_cc1 -fsyntax-only -x c++ -verify=ex

[clang] [clang] Catch missing format attributes (PR #105479)

2024-09-02 Thread Aaron Puchert via cfe-commits
@@ -5335,6 +5335,217 @@ static void handlePreferredTypeAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) PreferredTypeAttr(S.Context, AL, ParmTSI)); } +// This function is called only if function call is not inside template body. +// TODO: Add call

[clang] [clang] Catch missing format attributes (PR #105479)

2024-09-02 Thread Aaron Puchert via cfe-commits
@@ -0,0 +1,251 @@ +// RUN: %clang_cc1 -fsyntax-only -verify=expected,c_diagnostics -Wmissing-format-attribute %s +// RUN: %clang_cc1 -fsyntax-only -Wmissing-format-attribute -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s +// RUN: %clang_cc1 -fsyntax-only -x c++ -verify=ex

[clang] [clang] Catch missing format attributes (PR #105479)

2024-09-02 Thread Aaron Puchert via cfe-commits
@@ -5335,6 +5335,217 @@ static void handlePreferredTypeAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) PreferredTypeAttr(S.Context, AL, ParmTSI)); } +// This function is called only if function call is not inside template body. +// TODO: Add call

[clang] [clang] Catch missing format attributes (PR #105479)

2024-09-02 Thread Aaron Puchert via cfe-commits
@@ -5335,6 +5335,217 @@ static void handlePreferredTypeAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) PreferredTypeAttr(S.Context, AL, ParmTSI)); } +// This function is called only if function call is not inside template body. +// TODO: Add call

[clang] [clang] Catch missing format attributes (PR #105479)

2024-09-02 Thread Aaron Puchert via cfe-commits
@@ -5335,6 +5335,217 @@ static void handlePreferredTypeAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) PreferredTypeAttr(S.Context, AL, ParmTSI)); } +// This function is called only if function call is not inside template body. +// TODO: Add call

[clang] [clang] Catch missing format attributes (PR #105479)

2024-09-02 Thread Aaron Puchert via cfe-commits
@@ -0,0 +1,251 @@ +// RUN: %clang_cc1 -fsyntax-only -verify=expected,c_diagnostics -Wmissing-format-attribute %s +// RUN: %clang_cc1 -fsyntax-only -Wmissing-format-attribute -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s +// RUN: %clang_cc1 -fsyntax-only -x c++ -verify=ex

[clang] [clang][OpenMP] `masked` and `master` are not capturing (PR #106787)

2024-09-02 Thread Krzysztof Parzyszek via cfe-commits
https://github.com/kparzysz closed https://github.com/llvm/llvm-project/pull/106787 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 7e8aba2 - [clang][OpenMP] `masked` and `master` are not capturing (#106787)

2024-09-02 Thread via cfe-commits
Author: Krzysztof Parzyszek Date: 2024-09-02T16:56:14-05:00 New Revision: 7e8aba2b993014d975cf35f1f9831c951c4ab292 URL: https://github.com/llvm/llvm-project/commit/7e8aba2b993014d975cf35f1f9831c951c4ab292 DIFF: https://github.com/llvm/llvm-project/commit/7e8aba2b993014d975cf35f1f9831c951c4ab292

[clang] [compiler-rt] [compiler-rt][rtsan] Introduce rtsan_interface.h and ScopedDisabler (PR #106736)

2024-09-02 Thread via cfe-commits
https://github.com/davidtrevelyan edited https://github.com/llvm/llvm-project/pull/106736 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [compiler-rt][rtsan] Introduce rtsan_interface.h and ScopedDisabler (PR #106736)

2024-09-02 Thread via cfe-commits
https://github.com/davidtrevelyan approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/106736 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix a regression in annotating ObjCBlockLParen (PR #107021)

2024-09-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-format Author: Owen Pan (owenca) Changes Fixes #106994. --- Full diff: https://github.com/llvm/llvm-project/pull/107021.diff 2 Files Affected: - (modified) clang/lib/Format/TokenAnnotator.cpp (+1-2) - (modified) clang/unittests/Format/TokenAnn

[clang] [clang-format] Fix a regression in annotating ObjCBlockLParen (PR #107021)

2024-09-02 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/107021 Fixes #106994. >From 563ad14fb2b5b91adbc906fce34e74e71dc1f141 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Mon, 2 Sep 2024 14:02:54 -0700 Subject: [PATCH] [clang-format] Fix a regression in annotating ObjCBlock

[clang] [clang] Don't add DWARF debug info when assembling .s with clang-cl /Z7 (PR #106686)

2024-09-02 Thread Martin Storsjö via cfe-commits
mstorsjo wrote: @MaskRay - IIRC you're on vacation, but in case you're lurking - any objection to merging this to fix the regression (and backporting it)? If not, I'll go ahead and merge it in a day or two. (It probably misses 19.1.0 RC 4, but can go into the later releases at least.) Also eve

[clang] [analyzer] [MallocChecker] suspect all release functions as candidate for suppression (PR #104599)

2024-09-02 Thread Pavel Skripkin via cfe-commits
@@ -3648,35 +3652,53 @@ PathDiagnosticPieceRef MallocBugVisitor::VisitNode(const ExplodedNode *N, return nullptr; } - // See if we're releasing memory while inlining a destructor - // (or one of its callees). This turns on various common - //

[clang] [analyzer] [MallocChecker] suspect all release functions as candidate for suppression (PR #104599)

2024-09-02 Thread Pavel Skripkin via cfe-commits
https://github.com/pskrgag updated https://github.com/llvm/llvm-project/pull/104599 >From 913036ab795d6b91d6bb74d82aa2d329fe689535 Mon Sep 17 00:00:00 2001 From: Pavel Skripkin Date: Fri, 16 Aug 2024 17:45:57 +0300 Subject: [PATCH 1/5] clang/csa: suspect all functions as those that may do refc

[clang] [clang] Add tests for CWG issues about language linkage (PR #107019)

2024-09-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Vlad Serebrennikov (Endilll) Changes This patch covers Core issues about language linkage during declaration matching resolved in [P1787R6](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1787r6.html), namely [CWG563](https://c

[clang] [clang] Add tests for CWG issues about language linkage (PR #107019)

2024-09-02 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/107019 This patch covers Core issues about language linkage during declaration matching resolved in [P1787R6](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1787r6.html), namely [CWG563](https://cplusplus.

[clang] [llvm] [CodeView] Flatten cmd args in frontend for LF_BUILDINFO (PR #106369)

2024-09-02 Thread via cfe-commits
https://github.com/nebulark updated https://github.com/llvm/llvm-project/pull/106369 >From e190d074a0a77c9f8a7d7938a8187a7e2076e290 Mon Sep 17 00:00:00 2001 From: Florian Schmiderer Date: Wed, 28 Aug 2024 12:36:39 +0200 Subject: [PATCH] [Codeview] Moved flattening of commandline arguments into

[clang] [clang-format] Add new option: WrapNamespaceBodyWithNewlines (PR #106145)

2024-09-02 Thread via cfe-commits
https://github.com/dmasloff updated https://github.com/llvm/llvm-project/pull/106145 >From 219424f9cd3477d9290c8766eaa857234a1ae387 Mon Sep 17 00:00:00 2001 From: dmasloff Date: Mon, 26 Aug 2024 22:11:05 +0300 Subject: [PATCH 1/2] [clang-format] Add new option: WrapNamespaceBodyWithNewlines -

[clang] [llvm] [BPF] Make -mcpu=v3 as the default (PR #107008)

2024-09-02 Thread via cfe-commits
https://github.com/eddyz87 approved this pull request. https://github.com/llvm/llvm-project/pull/107008 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [BPF] Make -mcpu=v3 as the default (PR #107008)

2024-09-02 Thread via cfe-commits
@@ -38,16 +38,22 @@ void BPFTargetInfo::getTargetDefines(const LangOptions &Opts, Builder.defineMacro("__BPF_FEATURE_ADDR_SPACE_CAST"); - if (CPU.empty() || CPU == "generic" || CPU == "v1") { + if (CPU == "generic" || CPU == "v1") { eddyz87 wrote: Nitpi

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-09-02 Thread Pavel Skripkin via cfe-commits
https://github.com/pskrgag updated https://github.com/llvm/llvm-project/pull/102602 >From 7b4f999b39f4308cab253204e6be41ea7a70f695 Mon Sep 17 00:00:00 2001 From: Pavel Skripkin Date: Fri, 9 Aug 2024 14:37:47 +0300 Subject: [PATCH 1/8] clang/csa: add initial support for builtin overflow --- ..

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-09-02 Thread Pavel Skripkin via cfe-commits
@@ -50,6 +118,75 @@ class BuiltinFunctionChecker : public Checker { } // namespace +std::pair +BuiltinFunctionChecker::checkOverflow(CheckerContext &C, SVal RetVal, + QualType Res) const { + ProgramStateRef State = C.getState(); + SValBu

[clang] [llvm] [mlir] [TableGen] Add const variants of accessors for backend (PR #106658)

2024-09-02 Thread Rahul Joshi via cfe-commits
@@ -189,7 +189,7 @@ static StringRef NormalizeGNUAttrSpelling(StringRef AttrSpelling) { typedef std::vector> ParsedAttrMap; -static ParsedAttrMap getParsedAttrList(const RecordKeeper &Records, jurahul wrote: Please see the discourse thread: https://discour

[clang] [analyzer] Fix false positive for stack-addr leak on simple param ptr (PR #107003)

2024-09-02 Thread Balazs Benics via cfe-commits
@@ -791,3 +791,30 @@ void global_ptr_to_ptr() { *global_pp = nullptr; } } // namespace leaking_via_indirect_global_invalidated + +namespace not_leaking_via_simple_ptr { +void top(const char *p) { steakhal wrote: Please add a ref case too. And also one for ta

[clang] [analyzer] Fix false positive for stack-addr leak on simple param ptr (PR #107003)

2024-09-02 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/107003 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Fix false positive for stack-addr leak on simple param ptr (PR #107003)

2024-09-02 Thread Balazs Benics via cfe-commits
https://github.com/steakhal requested changes to this pull request. https://github.com/llvm/llvm-project/pull/107003 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [TableGen] Add const variants of accessors for backend (PR #106658)

2024-09-02 Thread Matthias Springer via cfe-commits
@@ -189,7 +189,7 @@ static StringRef NormalizeGNUAttrSpelling(StringRef AttrSpelling) { typedef std::vector> ParsedAttrMap; -static ParsedAttrMap getParsedAttrList(const RecordKeeper &Records, matthias-springer wrote: I expected to see more `const` instead

[clang] [llvm] [mlir] [TableGen] Add const variants of accessors for backend (PR #106658)

2024-09-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-llvm-globalisel @llvm/pr-subscribers-clang Author: Rahul Joshi (jurahul) Changes Split RecordKeeper `getAllDerivedDefinitions` family of functions into two variants: (a) non-const ones that return vectors of `Record *` and (b) const ones, that return v

[clang] [llvm] [mlir] [TableGen] Add const variants of accessors for backend (PR #106658)

2024-09-02 Thread Rahul Joshi via cfe-commits
https://github.com/jurahul ready_for_review https://github.com/llvm/llvm-project/pull/106658 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [TableGen] Add const variants of accessors for backend (PR #106658)

2024-09-02 Thread Rahul Joshi via cfe-commits
jurahul wrote: Note, this is related to the following discourse thread that I had started: https://discourse.llvm.org/t/changing-tablegen-getallderiveddefinitions-to-return-arrayref-const-record/80586/5 https://github.com/llvm/llvm-project/pull/106658 __

[clang-tools-extra] [clangd] Do not collect macros when clang-tidy checks call into the preprocessor (PR #106329)

2024-09-02 Thread kadir çetinkaya via cfe-commits
@@ -702,6 +704,10 @@ ParsedAST::build(llvm::StringRef Filename, const ParseInputs &Inputs, log("Execute() failed when building AST for {0}: {1}", MainInput.getFile(), toString(std::move(Err))); + // Disable the macro collector for the remainder of this function,

[clang] [clang][AST][NFC] Make ASTContext::UnwrapSimilar{Array, }Types const (PR #106992)

2024-09-02 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/106992 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 38ae53d - [clang][AST][NFC] Make ASTContext::UnwrapSimilar{Array,}Types const (#106992)

2024-09-02 Thread via cfe-commits
Author: Timm Baeder Date: 2024-09-02T19:03:52+02:00 New Revision: 38ae53da15c6636c0d13ccf20415b5ce8541aefd URL: https://github.com/llvm/llvm-project/commit/38ae53da15c6636c0d13ccf20415b5ce8541aefd DIFF: https://github.com/llvm/llvm-project/commit/38ae53da15c6636c0d13ccf20415b5ce8541aefd.diff L

[clang] [clang] Don't add DWARF debug info when assembling .s with clang-cl /Z7 (PR #106686)

2024-09-02 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. https://github.com/llvm/llvm-project/pull/106686 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Driver] Add a custom error option in multilib.yaml. (PR #105684)

2024-09-02 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `clang-hip-vega20` running on `hip-vega20-0` while building `clang` at step 3 "annotate". Full details are available at: https://lab.llvm.org/buildbot/#/builders/123/builds/4754 Here is the relevant piece of the build log for

[clang] [llvm] [BPF] Make -mcpu=v3 as the default (PR #107008)

2024-09-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (yonghong-song) Changes Before llvm20, (void)__sync_fetch_and_add(...) always generates locked xadd insns. In linux kernel upstream discussion [1], it is found that for arm64 architecture, the original semantics of (void)__sync_fetch

[clang] [llvm] [BPF] Make -mcpu=v3 as the default (PR #107008)

2024-09-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-llvm-binary-utilities Author: None (yonghong-song) Changes Before llvm20, (void)__sync_fetch_and_add(...) always generates locked xadd insns. In linux kernel upstream discussion [1], it is found that for arm64 architecture, the original semantics of (v

  1   2   3   >