[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

[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] [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] [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] 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-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] [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] [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] [libcxx] [clang] Add -Wuninitialized-const-pointer (PR #148337)

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/test/SemaCXX/warn-uninitialized-const-point

[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 via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Igor Kudrin (igorkudrin) Changes 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() { in

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

2025-07-11 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-analysis Author: Igor Kudrin (igorkudrin) Changes 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

[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] [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 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 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-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-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 Baranov Victor via cfe-commits
@@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s cppcoreguidelines-interfaces-global-init %t +// RUN: %check_clang_tidy -std=c++20 %s cppcoreguidelines-interfaces-global-init %t vbvictor wrote: Yes, we could do guards https://github.com/llvm/llvm-project/pull/1483

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

2025-07-11 Thread Victor Chernyakin via cfe-commits
@@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s cppcoreguidelines-interfaces-global-init %t +// RUN: %check_clang_tidy -std=c++20 %s cppcoreguidelines-interfaces-global-init %t localspook wrote: Would you be fine with some `#if __cplusplus >= 202002L` guards inste

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

2025-07-11 Thread Peter Collingbourne via cfe-commits
https://github.com/pcc approved this pull request. 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] [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/5] [clang] Don't pass sanitizers' rtlibs to linker with `-

[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-tools-extra] [clang-tidy] Teach `cppcoreguidelines-interfaces-global-init` about `constinit` (PR #148334)

2025-07-11 Thread Baranov Victor via cfe-commits
@@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s cppcoreguidelines-interfaces-global-init %t +// RUN: %check_clang_tidy -std=c++20 %s cppcoreguidelines-interfaces-global-init %t vbvictor wrote: We shouldn't increase standard here because we still want to check that

[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 requested changes to this pull request. 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] 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 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/4] [clang] Don't pass sanitizers' rtlibs to linker with `-

[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] 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 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 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] 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] [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] [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] [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] [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 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/2] [clang] Don't pass sanitizers' rtlibs to linker with `-

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

2025-07-11 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `llvm-clang-aarch64-darwin` running on `doug-worker-4` while building `clang` at step 6 "test-build-unified-tree-check-all". Full details are available at: https://lab.llvm.org/buildbot/#/builders/190/builds/23350 Here is th

[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] [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 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] [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] [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] 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
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-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-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] [LTO] Add unified LTO tests for the PS targets. (PR #148229)

2025-07-11 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,33 @@ +// RUN: %clang -flto=thin --target=x86_64-scei-ps4 -O2 -c %s -o %t.ps4.tu -Xclang -fdebug-pass-manager 2>%t.ps4.tu.txt MaskRay wrote: unified-lto-pipeline.c is present and serves the purpose. For target-generic codegen features, we usually tes

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

2025-07-11 Thread Finn Plummer via cfe-commits
https://github.com/inbelic updated https://github.com/llvm/llvm-project/pull/145795 >From 43991791409d376e682c6a482941fcc4cd43b0bc Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Wed, 9 Jul 2025 19:25:19 + Subject: [PATCH 1/9] add basic integer range validations --- .../clang/Basic/Diag

[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] [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] [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-tools-extra] [clangd] Improve Markup Rendering (PR #140498)

2025-07-11 Thread Maksim Ivanov via cfe-commits
@@ -370,40 +497,128 @@ std::unique_ptr Paragraph::clone() const { /// Choose a marker to delimit `Text` from a prioritized list of options. /// This is more readable than escaping for plain-text. -llvm::StringRef chooseMarker(llvm::ArrayRef Options, -

[clang-tools-extra] [clangd] Improve Markup Rendering (PR #140498)

2025-07-11 Thread Maksim Ivanov via cfe-commits
@@ -352,40 +606,59 @@ TEST(BulletList, Render) { DeepDoc.addParagraph().appendText("baz"); StringRef ExpectedMarkdown = R"md(- foo - bar -- foo - baz - - foo -- baz +- foo + emaxx-google wrote: Related to the comment in the code - these addit

[clang-tools-extra] [clangd] Improve Markup Rendering (PR #140498)

2025-07-11 Thread Maksim Ivanov via cfe-commits
@@ -58,11 +67,9 @@ class Paragraph : public Block { Paragraph &appendSpace(); private: + typedef enum { PlainText, InlineCode, Bold, Emphasized } ChunkKind; emaxx-google wrote: nit: Just do `enum ChunkKind { ... }`. https://github.com/llvm/llvm-project/pu

[clang-tools-extra] [clangd] Improve Markup Rendering (PR #140498)

2025-07-11 Thread Maksim Ivanov via cfe-commits
@@ -370,40 +497,128 @@ std::unique_ptr Paragraph::clone() const { /// Choose a marker to delimit `Text` from a prioritized list of options. /// This is more readable than escaping for plain-text. -llvm::StringRef chooseMarker(llvm::ArrayRef Options, -

[clang-tools-extra] [clangd] Improve Markup Rendering (PR #140498)

2025-07-11 Thread Maksim Ivanov via cfe-commits
@@ -341,27 +437,58 @@ std::string Block::asPlainText() const { return llvm::StringRef(OS.str()).trim().str(); } +void Paragraph::renderEscapedMarkdown(llvm::raw_ostream &OS) const { + bool NeedsSpace = false; + bool HasChunks = false; + for (auto &C : Chunks) { +if (C

[clang-tools-extra] [clangd] Improve Markup Rendering (PR #140498)

2025-07-11 Thread Maksim Ivanov via cfe-commits
@@ -73,6 +80,20 @@ class Paragraph : public Block { bool SpaceAfter = false; }; std::vector Chunks; + + Paragraph &appendChunk(llvm::StringRef Contents, ChunkKind K); + + llvm::StringRef chooseMarker(llvm::ArrayRef Options, + llvm::String

[clang-tools-extra] [clangd] Improve Markup Rendering (PR #140498)

2025-07-11 Thread Maksim Ivanov via cfe-commits
@@ -420,29 +636,44 @@ Paragraph &Paragraph::appendSpace() { return *this; } -Paragraph &Paragraph::appendText(llvm::StringRef Text) { - std::string Norm = canonicalizeSpaces(Text); - if (Norm.empty()) +Paragraph &Paragraph::appendChunk(llvm::StringRef Contents, ChunkKind K

[clang-tools-extra] [clangd] Improve Markup Rendering (PR #140498)

2025-07-11 Thread Maksim Ivanov via cfe-commits
@@ -370,40 +497,128 @@ std::unique_ptr Paragraph::clone() const { /// Choose a marker to delimit `Text` from a prioritized list of options. /// This is more readable than escaping for plain-text. -llvm::StringRef chooseMarker(llvm::ArrayRef Options, -

[clang-tools-extra] [clangd] Improve Markup Rendering (PR #140498)

2025-07-11 Thread Maksim Ivanov via cfe-commits
@@ -151,16 +151,91 @@ bool needsLeadingEscape(char C, llvm::StringRef Before, llvm::StringRef After, } } +/// \brief Tests whether \p C should be backslash-escaped in markdown. +/// +/// The MarkupContent LSP specification defines that `markdown` content needs to +/// foll

[clang-tools-extra] [clangd] Improve Markup Rendering (PR #140498)

2025-07-11 Thread Maksim Ivanov via cfe-commits
@@ -316,6 +399,12 @@ std::string indentLines(llvm::StringRef Input) { class Heading : public Paragraph { public: Heading(size_t Level) : Level(Level) {} + + void renderEscapedMarkdown(llvm::raw_ostream &OS) const override { +OS << std::string(Level, '#') << ' ';

[clang-tools-extra] [clangd] Improve Markup Rendering (PR #140498)

2025-07-11 Thread Maksim Ivanov via cfe-commits
@@ -151,16 +151,91 @@ bool needsLeadingEscape(char C, llvm::StringRef Before, llvm::StringRef After, } } +/// \brief Tests whether \p C should be backslash-escaped in markdown. +/// +/// The MarkupContent LSP specification defines that `markdown` content needs to +/// foll

[clang-tools-extra] [clangd] Improve Markup Rendering (PR #140498)

2025-07-11 Thread Maksim Ivanov via cfe-commits
@@ -151,16 +151,91 @@ bool needsLeadingEscape(char C, llvm::StringRef Before, llvm::StringRef After, } } +/// \brief Tests whether \p C should be backslash-escaped in markdown. +/// +/// The MarkupContent LSP specification defines that `markdown` content needs to +/// foll

[clang-tools-extra] [clangd] Improve Markup Rendering (PR #140498)

2025-07-11 Thread Maksim Ivanov via cfe-commits
@@ -151,16 +151,91 @@ bool needsLeadingEscape(char C, llvm::StringRef Before, llvm::StringRef After, } } +/// \brief Tests whether \p C should be backslash-escaped in markdown. +/// +/// The MarkupContent LSP specification defines that `markdown` content needs to +/// foll

[clang-tools-extra] [clangd] Improve Markup Rendering (PR #140498)

2025-07-11 Thread Maksim Ivanov via cfe-commits
@@ -1601,51 +1591,32 @@ std::optional getBacktickQuoteRange(llvm::StringRef Line, return Line.slice(Offset, Next + 1); } -void parseDocumentationLine(llvm::StringRef Line, markup::Paragraph &Out) { +void parseDocumentationParagraph(llvm::StringRef Text, markup::Paragraph &O

[clang-tools-extra] [clangd] Improve Markup Rendering (PR #140498)

2025-07-11 Thread Maksim Ivanov via cfe-commits
https://github.com/emaxx-google requested changes to this pull request. Thanks! A couple of questions about newline handling, and a few minor nits. https://github.com/llvm/llvm-project/pull/140498 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang-tools-extra] [clangd] Improve Markup Rendering (PR #140498)

2025-07-11 Thread Maksim Ivanov via cfe-commits
@@ -151,16 +151,91 @@ bool needsLeadingEscape(char C, llvm::StringRef Before, llvm::StringRef After, } } +/// \brief Tests whether \p C should be backslash-escaped in markdown. +/// +/// The MarkupContent LSP specification defines that `markdown` content needs to +/// foll

[clang-tools-extra] [clangd] Improve Markup Rendering (PR #140498)

2025-07-11 Thread Maksim Ivanov via cfe-commits
https://github.com/emaxx-google edited https://github.com/llvm/llvm-project/pull/140498 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[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] [HLSL][RootSignature] Add basic parameter validations of Root Elements (PR #145795)

2025-07-11 Thread Finn Plummer via cfe-commits
https://github.com/inbelic updated https://github.com/llvm/llvm-project/pull/145795 >From 43991791409d376e682c6a482941fcc4cd43b0bc Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Wed, 9 Jul 2025 19:25:19 + Subject: [PATCH 1/8] add basic integer range validations --- .../clang/Basic/Diag

[clang] [HLSL][RootSignature] Audit `RootSignatureParser` diagnostic production (PR #147800)

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

[clang] f03bcb7 - [HLSL][RootSignature] Audit `RootSignatureParser` diagnostic production (#147800)

2025-07-11 Thread via cfe-commits
Author: Finn Plummer Date: 2025-07-11T19:40:10-07:00 New Revision: f03bcb7594254b91098f16a339dd6ba4c55a0c8e URL: https://github.com/llvm/llvm-project/commit/f03bcb7594254b91098f16a339dd6ba4c55a0c8e DIFF: https://github.com/llvm/llvm-project/commit/f03bcb7594254b91098f16a339dd6ba4c55a0c8e.diff

[clang] [RISCV] Add -march=unset to cancel and ignore a previous -march. (PR #148321)

2025-07-11 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/148321 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RISCV] Add -march=unset to cancel and ignore a previous -march. (PR #148321)

2025-07-11 Thread Fangrui Song via cfe-commits
@@ -403,6 +403,11 @@ // MCPU-MARCH: "-nostdsysteminc" "-target-cpu" "sifive-e31" "-target-feature" "+m" "-target-feature" "+c" // MCPU-MARCH: "-target-abi" "ilp32" +// march=unset erases previous march +// RUN: %clang --target=riscv32 -### -c %s 2>&1 -march=rv32imc -march=uns

[clang] [RISCV] Add -march=unset to cancel and ignore a previous -march. (PR #148321)

2025-07-11 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay commented: Thanks for implementing -mcpu=unset. This looks good. I'm glad to see -mcpu=unset gaining support, especially after feeling like the lone voice in the GCC thread: https://gcc.gnu.org/pipermail/gcc-patches/2025-June/685537.html https://github.com/llvm/llvm-

[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] [llvm] [HIPSTDPAR] Add support for globals (PR #146813)

2025-07-11 Thread Alex Voicu via cfe-commits
AlexVlx wrote: This is the run time part needed to make things work: https://github.com/llvm/llvm-project/pull/146813 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-

[clang] [HLSL][RootSignature] Audit `RootSignatureParser` diagnostic production (PR #147800)

2025-07-11 Thread Finn Plummer via cfe-commits
https://github.com/inbelic updated https://github.com/llvm/llvm-project/pull/147800 >From a510b930402cd4a6a00f253093d1a3ddfab918ac Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Wed, 9 Jul 2025 15:50:55 + Subject: [PATCH 01/11] remove confusing hlsl_unexpected_end_of_params diagnostic

[clang] [llvm] [HLSL][RootSignature] Audit `RootSignatureParser` diagnostic production (PR #147800)

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

[clang] [clang][ARM] Include arm_acle.h in intrin.h on supported platforms (PR #144172)

2025-07-11 Thread Nick Sarnie via cfe-commits
@@ -50,11 +50,11 @@ BUILTIN(__builtin_arm_wfi, "v", "") BUILTIN(__builtin_arm_sev, "v", "") BUILTIN(__builtin_arm_sevl, "v", "") BUILTIN(__builtin_arm_chkfeat, "WUiWUi", "") -TARGET_HEADER_BUILTIN(__yield, "v", "h", ARMACLE_H, ALL_LANGUAGES, "") -TARGET_HEADER_BUILTIN(__wfe,

[clang] [llvm] [HLSL][RootSignature] Retain `SourceLocation` of `RootElement` for `SemaHLSL` diagnostics (PR #147115)

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

[clang] 7ecb37b - [HLSL][RootSignature] Retain `SourceLocation` of `RootElement` for `SemaHLSL` diagnostics (#147115)

2025-07-11 Thread via cfe-commits
Author: Finn Plummer Date: 2025-07-11T18:33:16-07:00 New Revision: 7ecb37b703b7c675d1be6c4194c50f6f8dd9ac9c URL: https://github.com/llvm/llvm-project/commit/7ecb37b703b7c675d1be6c4194c50f6f8dd9ac9c DIFF: https://github.com/llvm/llvm-project/commit/7ecb37b703b7c675d1be6c4194c50f6f8dd9ac9c.diff

[clang] [clang-format][NFC] Simplify some logic in BreakableLineCommentSection (PR #148324)

2025-07-11 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-format Author: Owen Pan (owenca) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/148324.diff 1 Files Affected: - (modified) clang/lib/Format/BreakableToken.cpp (+4-6) ``diff diff --git a/clang/lib/Format/BreakableTo

[clang] [clang-format][NFC] Simplify some logic in BreakableLineCommentSection (PR #148324)

2025-07-11 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/148324 None >From 88f34fb41704bdd6f6de743a5b467cdc3c938cc4 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri, 11 Jul 2025 18:18:18 -0700 Subject: [PATCH] [clang-format][NFC] Simplify some logic in BreakableLineComment

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

2025-07-11 Thread Peter Collingbourne via cfe-commits
https://github.com/pcc 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] 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 updated https://github.com/llvm/llvm-project/pull/148323 >From 64b17b603b9300bb15b28d5ded80b174b8eacbb9 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Fri, 11 Jul 2025 18:06:48 -0700 Subject: [PATCH 1/3] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?= =?UT

[clang] 2f1673e - Follow up on #147623

2025-07-11 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2025-07-11T18:15:27-07:00 New Revision: 2f1673eaa0e3b0c98cdd66429849ec27e220055b URL: https://github.com/llvm/llvm-project/commit/2f1673eaa0e3b0c98cdd66429849ec27e220055b DIFF: https://github.com/llvm/llvm-project/commit/2f1673eaa0e3b0c98cdd66429849ec27e220055b.diff LOG:

[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 updated https://github.com/llvm/llvm-project/pull/148323 >From 64b17b603b9300bb15b28d5ded80b174b8eacbb9 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Fri, 11 Jul 2025 18:06:48 -0700 Subject: [PATCH 1/2] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?= =?UT

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

2025-07-11 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Florian Mayer (fmayer) Changes This reverts commit 102c15ad28d3c312ea8926c85dbf907ca0d07b84. --- Full diff: https://github.com/llvm/llvm-project/pull/148323.diff 2 Files Affected: - (modified) clang/include/clang/Basic/Features.def (+4

[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 created https://github.com/llvm/llvm-project/pull/148323 This reverts commit 102c15ad28d3c312ea8926c85dbf907ca0d07b84. >From 64b17b603b9300bb15b28d5ded80b174b8eacbb9 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Fri, 11 Jul 2025 18:06:48 -0700 Subject: [PATCH] =

[clang] [RISCV] Add -march=unset to cancel and ignore a previous -march. (PR #148321)

2025-07-11 Thread Craig Topper via cfe-commits
https://github.com/topperc updated https://github.com/llvm/llvm-project/pull/148321 >From 9521bd783966635f3219ac02e3fe43ed33294546 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Fri, 11 Jul 2025 17:42:49 -0700 Subject: [PATCH 1/2] [RISCV] Add -march=unset to cancel and ignore a previous -ma

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

2025-07-11 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Florian Mayer (fmayer) Changes Reverts llvm/llvm-project#148310 Some targets don't support the flags passed in the test --- Full diff: https://github.com/llvm/llvm-project/pull/148322.diff 2 Files Affected: - (modified) clang/include/c

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

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

  1   2   3   4   5   >