[clang] [WIP][DO NOT MERGE][Clang][Driver] Emit warning when -fsanitize-trap=<...> is passed without associated -fsanitize=<...> (PR #147997)

2025-07-11 Thread Fangrui Song via cfe-commits
MaskRay wrote: Thank you for your efforts to enhance sanitizers. However, the current implementation aligns with the preferences of many, including GCC contributors who introduced -fsanitize-trap in 2022. Gaining consensus to modify -fsanitize-trap to issue warnings or errors seems unlikely, s

[clang] [NFC][-Wunsafe-buffer-usage] Refactor safe pattern check for pointer-size pairs (PR #145626)

2025-07-11 Thread Ziqing Luo via cfe-commits
@@ -453,22 +453,108 @@ static bool areEqualIntegers(const Expr *E1, const Expr *E2, ASTContext &Ctx) { } } +// Providing that `Ptr` is a pointer and `Size` is an unsigned-integral +// expression, returns true iff they follow one of the following safe +// patterns: +// 1. P

[clang] [NFC][-Wunsafe-buffer-usage] Refactor safe pattern check for pointer-size pairs (PR #145626)

2025-07-11 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 updated https://github.com/llvm/llvm-project/pull/145626 >From 8c07b277562bd3d4f332a341eb1e0127545c8280 Mon Sep 17 00:00:00 2001 From: Ziqing Luo Date: Tue, 24 Jun 2025 11:25:52 +0800 Subject: [PATCH 1/3] [NFC][-Wunsafe-buffer-usage] Refactor safe pattern check

[clang] 22b21f3 - Reapply "[clang] [ubsan] add __has_feature for UBSan checks" (#148322) (#148323)

2025-07-11 Thread via cfe-commits
Author: Florian Mayer Date: 2025-07-11T22:09:39-07:00 New Revision: 22b21f34b233630f6adcdb60fe41fcbce322b68c URL: https://github.com/llvm/llvm-project/commit/22b21f34b233630f6adcdb60fe41fcbce322b68c DIFF: https://github.com/llvm/llvm-project/commit/22b21f34b233630f6adcdb60fe41fcbce322b68c.diff

[clang] Reapply "[clang] [ubsan] add __has_feature for UBSan checks" (#148322) (PR #148323)

2025-07-11 Thread Florian Mayer via cfe-commits
https://github.com/fmayer closed https://github.com/llvm/llvm-project/pull/148323 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Don't pass sanitizers' rtlibs to linker with `-r` (PR #147905)

2025-07-11 Thread Dmitry Chestnykh via cfe-commits
https://github.com/chestnykh updated https://github.com/llvm/llvm-project/pull/147905 >From 86dc26e3947d2d53e9b86d700946e7f381f71a7a Mon Sep 17 00:00:00 2001 From: Dmitry Chestnykh Date: Thu, 10 Jul 2025 10:19:31 +0300 Subject: [PATCH 1/3] [clang] Don't pass sanitizers' rtlibs to linker with `-

[clang] Reapply "[clang] [ubsan] add __has_feature for UBSan checks" (#148322) (PR #148323)

2025-07-11 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `fuchsia-x86_64-linux` running on `fuchsia-debian-64-us-central1-b-1` while building `clang` at step 4 "annotate". Full details are available at: https://lab.llvm.org/buildbot/#/builders/11/builds/19385 Here is the relevant

[clang] [clang] Don't pass sanitizers' rtlibs to linker with `-r` (PR #147905)

2025-07-11 Thread Dmitry Chestnykh via cfe-commits
@@ -1159,7 +1159,8 @@ SanitizerArgs::SanitizerArgs(const ToolChain &TC, LinkRuntimes = Args.hasFlag(options::OPT_fsanitize_link_runtime, - options::OPT_fno_sanitize_link_runtime, LinkRuntimes); + options::OPT_fno_sanitize_link_runtim

[clang] [clang] Don't pass sanitizers' rtlibs to linker with `-r` (PR #147905)

2025-07-11 Thread Peter Collingbourne via cfe-commits
@@ -1159,7 +1159,8 @@ SanitizerArgs::SanitizerArgs(const ToolChain &TC, LinkRuntimes = Args.hasFlag(options::OPT_fsanitize_link_runtime, - options::OPT_fno_sanitize_link_runtime, LinkRuntimes); + options::OPT_fno_sanitize_link_runtim

[clang] [HLSL][RootSignature] Allow for multiple parsing errors in `RootSignatureParser` (PR #147832)

2025-07-11 Thread Finn Plummer via cfe-commits
https://github.com/inbelic updated https://github.com/llvm/llvm-project/pull/147832 >From 02e7ad8a92e01b19d85f9bedf831aac161439ccb Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Wed, 9 Jul 2025 21:21:53 + Subject: [PATCH 1/3] [HLSL][RootSignature] Implement multiple diagnostics in `Root

[clang] [HLSL][RootSignature] Add basic parameter validations of Root Elements (PR #145795)

2025-07-11 Thread Finn Plummer via cfe-commits
@@ -1083,6 +1084,90 @@ void SemaHLSL::ActOnFinishRootSignatureDecl( bool SemaHLSL::handleRootSignatureElements( ArrayRef Elements) { + // Define some common error handling functions + bool HadError = false; + auto ReportError = [this, &HadError](SourceLocation Loc, uint

[clang] [llvm] [HLSL][RootSignature] Allow for multiple parsing errors in `RootSignatureParser` (PR #147832)

2025-07-11 Thread Finn Plummer via cfe-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/147832 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reapply "[clang] [ubsan] add __has_feature for UBSan checks" (#148322) (PR #148323)

2025-07-11 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka approved this pull request. https://github.com/llvm/llvm-project/pull/148323 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Teach `cppcoreguidelines-interfaces-global-init` about `constinit` (PR #148334)

2025-07-11 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook created https://github.com/llvm/llvm-project/pull/148334 This check already understands how `constexpr` makes initialization order problems impossible, and C++20's `constinit` provides the exact same guarantees while placing fewer restrictions on the user. >From

[clang-tools-extra] [clang-tidy] Teach `cppcoreguidelines-interfaces-global-init` about `constinit` (PR #148334)

2025-07-11 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tools-extra Author: Victor Chernyakin (localspook) Changes This check already understands how `constexpr` makes initialization order problems impossible, and C++20's `constinit` provides the exact same guarantees while placing fewer restrictions

[clang] 265fb36 - [CIR] Add bit reverse and byte reverse operations (#147200)

2025-07-11 Thread via cfe-commits
Author: Sirui Mu Date: 2025-07-12T12:15:36+08:00 New Revision: 265fb3605d1d070a004fd4d9db54ad2ae6f722c7 URL: https://github.com/llvm/llvm-project/commit/265fb3605d1d070a004fd4d9db54ad2ae6f722c7 DIFF: https://github.com/llvm/llvm-project/commit/265fb3605d1d070a004fd4d9db54ad2ae6f722c7.diff LOG:

[clang] [CIR] Add bit reverse and byte reverse operations (PR #147200)

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

[clang] [CIR] Add bit reverse and byte reverse operations (PR #147200)

2025-07-11 Thread Sirui Mu via cfe-commits
Lancern wrote: I'm going to merge this and I'll send another patch to resolve the various nits in the comments. https://github.com/llvm/llvm-project/pull/147200 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[clang] [clang] Don't pass sanitizers' rtlibs to linker with `-r` (PR #147905)

2025-07-11 Thread Dmitry Chestnykh via cfe-commits
@@ -1159,7 +1159,8 @@ SanitizerArgs::SanitizerArgs(const ToolChain &TC, LinkRuntimes = Args.hasFlag(options::OPT_fsanitize_link_runtime, - options::OPT_fno_sanitize_link_runtime, LinkRuntimes); + options::OPT_fno_sanitize_link_runtim

[clang] [llvm] [WPD]: Apply speculative WPD in non-lto mode. (PR #145031)

2025-07-11 Thread Hassnaa Hamdi via cfe-commits
@@ -0,0 +1,56 @@ +// Check that speculative devirtualization works without the need for LTO or visibility. hassnaaHamdi wrote: I have separated the tests. For testing using non-LTO pass pipeline, that will be postponed until I enable the WPD by default. https:

[clang] [llvm] [WPD]: Apply speculative WPD in non-lto mode. (PR #145031)

2025-07-11 Thread Hassnaa Hamdi via cfe-commits
https://github.com/hassnaaHamdi updated https://github.com/llvm/llvm-project/pull/145031 >From 54296ceadcdf59136f68c1e3132a2528396361d4 Mon Sep 17 00:00:00 2001 From: Hassnaa Hamdi Date: Fri, 20 Jun 2025 01:35:38 + Subject: [PATCH 1/2] [WPD]: Apply speculative WPD in non-lto mode. - This p

[clang] [llvm] [WPD]: Apply speculative WPD in non-lto mode. (PR #145031)

2025-07-11 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff HEAD~1 HEAD --extensions cpp,h,c -- clang/lib/CodeGen/BackendUtil.cpp clang/lib/CodeG

[clang-tools-extra] [clang-tidy] Teach `cppcoreguidelines-interfaces-global-init` about `constinit` (PR #148334)

2025-07-11 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook updated https://github.com/llvm/llvm-project/pull/148334 >From e6b9c9ab548986d26fe24a91ab360e7c0363817d Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Fri, 11 Jul 2025 21:09:22 -0700 Subject: [PATCH 1/2] [clang-tidy] Teach `cppcoreguidelines-interfaces-glo

[clang-tools-extra] [clang-tidy] Teach `cppcoreguidelines-interfaces-global-init` about `constinit` (PR #148334)

2025-07-11 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook edited https://github.com/llvm/llvm-project/pull/148334 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix suppressing diagnostics for uninitialized variables (PR #148336)

2025-07-11 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-analysis Author: Igor Kudrin (igorkudrin) Changes When one kind of diagnostics is disabled, this should not preclude other diagnostics from displaying, even if they have lower priority. For example, this should print a warning about passing an un

[clang] [clang] Fix suppressing diagnostics for uninitialized variables (PR #148336)

2025-07-11 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Igor Kudrin (igorkudrin) Changes When one kind of diagnostics is disabled, this should not preclude other diagnostics from displaying, even if they have lower priority. For example, this should print a warning about passing an uninitializ

[clang] [clang] Fix suppressing diagnostics for uninitialized variables (PR #148336)

2025-07-11 Thread Igor Kudrin via cfe-commits
https://github.com/igorkudrin created https://github.com/llvm/llvm-project/pull/148336 When one kind of diagnostics is disabled, this should not preclude other diagnostics from displaying, even if they have lower priority. For example, this should print a warning about passing an uninitialized

[clang] [libcxx] [clang] Add -Wuninitialized-const-pointer (PR #148337)

2025-07-11 Thread Igor Kudrin via cfe-commits
https://github.com/igorkudrin created https://github.com/llvm/llvm-project/pull/148337 This option is similar to -Wuninitialized-const-reference, but diagnoses the passing of an uninitialized value via a const pointer, like in the following code: ``` void foo(const int *); void test() { int

[clang-tools-extra] [clang-tidy] Teach `cppcoreguidelines-interfaces-global-init` about `constinit` (PR #148334)

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

[clang] [libcxx] [clang] Add -Wuninitialized-const-pointer (PR #148337)

2025-07-11 Thread Igor Kudrin via cfe-commits
igorkudrin wrote: This fixes an additional case reported by @rnapier in #37460 https://github.com/llvm/llvm-project/pull/148337 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [clang] Add -Wuninitialized-const-pointer (PR #148337)

2025-07-11 Thread Igor Kudrin via cfe-commits
https://github.com/igorkudrin updated https://github.com/llvm/llvm-project/pull/148337 >From 8343c946e874ee27e71781ac1bd10fb680b08fbf Mon Sep 17 00:00:00 2001 From: Igor Kudrin Date: Fri, 11 Jul 2025 18:23:10 -0700 Subject: [PATCH 1/2] [clang] Add -Wuninitialized-const-pointer This option is s

[clang] [clang-tools-extra] [Clang] [Diagnostics] Simplify filenames that contain '..' (PR #143520)

2025-07-11 Thread via cfe-commits
eaeltsin wrote: > I can revert and then reland this if the issue is pressing for you @Sirraide - this is pressing us, so please clean revert first. Thank you! https://github.com/llvm/llvm-project/pull/143520 ___ cfe-commits mailing list cfe-commits@l

[clang] 593fd44 - [clang] Don't pass sanitizers' rtlibs to linker with `-r` (#147905)

2025-07-11 Thread via cfe-commits
Author: Dmitry Chestnykh Date: 2025-07-12T09:44:14+03:00 New Revision: 593fd44a9dcf77db8348c37d70cfecef57c392c7 URL: https://github.com/llvm/llvm-project/commit/593fd44a9dcf77db8348c37d70cfecef57c392c7 DIFF: https://github.com/llvm/llvm-project/commit/593fd44a9dcf77db8348c37d70cfecef57c392c7.di

[clang] [clang] Don't pass sanitizers' rtlibs to linker with `-r` (PR #147905)

2025-07-11 Thread Dmitry Chestnykh via cfe-commits
https://github.com/chestnykh closed https://github.com/llvm/llvm-project/pull/147905 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema] Remove unnecessary casts (NFC) (PR #148338)

2025-07-11 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Kazu Hirata (kazutakahirata) Changes NumElts, a member variable of ArrayTypeInfo, is already of Expr *. --- Full diff: https://github.com/llvm/llvm-project/pull/148338.diff 2 Files Affected: - (modified) clang/lib/Sema/SemaExprCXX.cpp

[clang] [Sema] Remove unnecessary casts (NFC) (PR #148338)

2025-07-11 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/148338 NumElts, a member variable of ArrayTypeInfo, is already of Expr *. >From 77284e1f4832ed648fce11ea3cb877369efcf20e Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Fri, 11 Jul 2025 11:20:17 -0700 Subject

[clang-tools-extra] 2f4a804 - [clang-tidy] Add new check `llvm-prefer-static-over-anonymous-namespace` (#142839)

2025-07-11 Thread via cfe-commits
Author: Baranov Victor Date: 2025-07-12T09:56:30+03:00 New Revision: 2f4a804e6eb597e792cf069726c6190127c478fb URL: https://github.com/llvm/llvm-project/commit/2f4a804e6eb597e792cf069726c6190127c478fb DIFF: https://github.com/llvm/llvm-project/commit/2f4a804e6eb597e792cf069726c6190127c478fb.diff

[clang] [Clang] Improve diagnostics for 'placement new' with const storage argument (PR #144270)

2025-07-11 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed https://github.com/llvm/llvm-project/pull/144270 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] f6c927e - [Clang] Improve diagnostics for 'placement new' with const storage argument (#144270)

2025-07-11 Thread via cfe-commits
Author: Baranov Victor Date: 2025-07-12T09:58:06+03:00 New Revision: f6c927e8dbe8e760c5d21c52f0c211ab3fb58735 URL: https://github.com/llvm/llvm-project/commit/f6c927e8dbe8e760c5d21c52f0c211ab3fb58735 DIFF: https://github.com/llvm/llvm-project/commit/f6c927e8dbe8e760c5d21c52f0c211ab3fb58735.diff

[clang-tools-extra] [clang-tidy] Add new check `llvm-prefer-static-over-anonymous-namespace` (PR #142839)

2025-07-11 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed https://github.com/llvm/llvm-project/pull/142839 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

<    1   2   3   4   5