[clang-tools-extra] [clang-tidy] Speed up `misc-header-include-cycle` (PR #148757)

2025-07-15 Thread Victor Chernyakin via cfe-commits
@@ -85,36 +81,26 @@ class CyclicDependencyCallbacks : public PPCallbacks { if (FileType != clang::SrcMgr::C_User) return; -llvm::StringRef FileName = llvm::sys::path::filename(FilePath); -NextToEnter = {FileID(), FileName, Range.getBegin()}; +NextToEnter

[clang-tools-extra] [clang-tidy] Speed up `misc-header-include-cycle` (PR #148757)

2025-07-15 Thread Victor Chernyakin via cfe-commits
@@ -85,36 +81,26 @@ class CyclicDependencyCallbacks : public PPCallbacks { if (FileType != clang::SrcMgr::C_User) return; -llvm::StringRef FileName = llvm::sys::path::filename(FilePath); -NextToEnter = {FileID(), FileName, Range.getBegin()}; +NextToEnter

[clang-tools-extra] [clang-tidy] Speed up `misc-header-include-cycle` (PR #148757)

2025-07-15 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook updated https://github.com/llvm/llvm-project/pull/148757 >From 7cab196f263cc4d1787fe74ae49d4340fcb88624 Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Sun, 13 Jul 2025 11:30:49 -0700 Subject: [PATCH 1/2] [clang-tidy] Speed up `misc-header-include-cycle` --

[clang-tools-extra] [clang-tidy] Speed up `misc-header-include-cycle` (PR #148757)

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

[clang-tools-extra] [clang-tidy] Speed up `misc-header-include-cycle` (PR #148757)

2025-07-15 Thread Victor Chernyakin via cfe-commits
localspook wrote: It doesn't seem like preprocessor-based checks appear in the profile. You can see this with an existing preprocessor check; running `clang-tidy --checks=-*,readability-redundant-preprocessor -enable-check-profile` produces no output. https://github.com/llvm/llvm-project/pull

[clang-tools-extra] [clang-tidy] Update `confusables.txt` in `misc-confusable-identifiers` (PR #148399)

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

[clang-tools-extra] [clang-tidy] `misc-confusable-identifiers`: Update `confusables.txt` (PR #148399)

2025-07-12 Thread Victor Chernyakin via cfe-commits
localspook wrote: Taken from: https://www.unicode.org/Public/security/16.0.0/confusables.txt https://github.com/llvm/llvm-project/pull/148399 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

[clang-tools-extra] [clang-tidy] `misc-confusable-identifiers`: Update `confusables.txt` (PR #148399)

2025-07-12 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook created https://github.com/llvm/llvm-project/pull/148399 We're currently on Unicode 14.0.0. This PR updates it to Unicode 16.0.0. >From e252ea0a1ac94e8324bb332037508fd3f9b61317 Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Sat, 12 Jul 2025 12:46:01 -0700

[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 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-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] Add clang tidy check performance constexpr non static in scope (PR #147809)

2025-07-11 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook edited https://github.com/llvm/llvm-project/pull/147809 ___ 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 `readability-uppercase-literal-suffix` about C++23 and C23 suffixes (PR #148275)

2025-07-11 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook edited https://github.com/llvm/llvm-project/pull/148275 ___ 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 `readability-uppercase-literal-suffix` about C++23 and C23 suffixes (PR #148275)

2025-07-11 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook created https://github.com/llvm/llvm-project/pull/148275 C++23 integer literal suffixes: | Suffix | Type | |-|-| |`z` | `std::make_signed_t`| |`uz` | `std::size_t`| C++23 floating-point literal suffixes: | Suffix | Type | |-|

[clang-tools-extra] Add clang tidy check performance constexpr non static in scope (PR #147809)

2025-07-10 Thread Victor Chernyakin via cfe-commits
@@ -0,0 +1,37 @@ +//===--- ConstexprNonStaticInScopeCheck.h - clang-tidy --*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang-tools-extra] [clang-tidy][NFC] concat static-analyzer name at compilation time (PR #147406)

2025-07-09 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook updated https://github.com/llvm/llvm-project/pull/147406 >From 6f1c9ae3079e4958f29c71a9e09b74b33758effe Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Mon, 7 Jul 2025 14:14:44 -0700 Subject: [PATCH 1/2] [clang-tidy][NFC] Do more work at compile time --- c

[clang-tools-extra] [clang-tidy][NFC] concat static-analyzer name at compilation time (PR #147406)

2025-07-09 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook updated https://github.com/llvm/llvm-project/pull/147406 >From 779dd600a1190b36c1343343e139f6579fa5190b Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Mon, 7 Jul 2025 14:14:44 -0700 Subject: [PATCH 1/3] [clang-tidy][NFC] Do more work at compile time --- c

[clang-tools-extra] [clang-tidy][NFC] concat static-analyzer name at compilation time (PR #147406)

2025-07-09 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook updated https://github.com/llvm/llvm-project/pull/147406 >From 779dd600a1190b36c1343343e139f6579fa5190b Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Mon, 7 Jul 2025 14:14:44 -0700 Subject: [PATCH 1/2] [clang-tidy][NFC] Do more work at compile time --- c

[clang-tools-extra] [clang-tidy][NFC] Do less unnecessary work in `NoLintDirectiveHandler` (PR #147553)

2025-07-08 Thread Victor Chernyakin via cfe-commits
@@ -31,8 +31,6 @@ class NoLintDirectiveHandler { public: NoLintDirectiveHandler(); ~NoLintDirectiveHandler(); - NoLintDirectiveHandler(const NoLintDirectiveHandler &) = delete; - NoLintDirectiveHandler &operator=(const NoLintDirectiveHandler &) = delete;

[clang-tools-extra] [clang-tidy][NFC] Do less unnecessary work in `NoLintDirectiveHandler` (PR #147553)

2025-07-08 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook created https://github.com/llvm/llvm-project/pull/147553 I plan to do more work in this area, but I feel this is a good first set of changes. Summary: - `NoLintBlockToken` is too big: it stores a whole `NoLintToken` inside itself, when all it needs from that `NoL

[clang-tools-extra] [clang-tidy] Add new check: `readability-use-concise-preprocessor-directives` (PR #146830)

2025-07-08 Thread Victor Chernyakin via cfe-commits
localspook wrote: When we're ready to merge, someone please do it for me, I don't have write permissions. https://github.com/llvm/llvm-project/pull/146830 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/l

[clang-tools-extra] [clang-tidy] filter check options by enabled checks in '--dump-config' (PR #147142)

2025-07-07 Thread Victor Chernyakin via cfe-commits
@@ -503,6 +503,21 @@ getCheckNames(const ClangTidyOptions &Options, return Factory.getCheckNames(); } +void filterCheckOptions(ClangTidyOptions &Options, +const std::vector &EnabledChecks) { + StringSet<> EnabledChecksSet(llvm::from_range, EnabledChe

[clang-tools-extra] [clang-tidy][NFC] Prefer `constexpr llvm::StringLiteral` over `const char *` (PR #147301)

2025-07-07 Thread Victor Chernyakin via cfe-commits
@@ -55,7 +55,8 @@ namespace clang::tidy { namespace { #if CLANG_TIDY_ENABLE_STATIC_ANALYZER -static const char *AnalyzerCheckNamePrefix = "clang-analyzer-"; +static constexpr llvm::StringLiteral AnalyzerCheckNamePrefix = localspook wrote: I can't do that, it

[clang-tools-extra] [clang-tidy][NFC] Prefer `constexpr llvm::StringLiteral` over `const char *` (PR #147301)

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

[clang-tools-extra] [clang-tidy][NFC] Prefer `constexpr llvm::StringLiteral` over `const char *` (PR #147301)

2025-07-07 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook updated https://github.com/llvm/llvm-project/pull/147301 >From bad855d41d4350f51af955a33c079f3f1cf605f3 Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Mon, 7 Jul 2025 06:34:02 -0700 Subject: [PATCH 1/2] [clang-tidy][NFC] Prefer `constexpr llvm::StringLitera

[clang-tools-extra] [clang-tidy][NFC] Prefer `constexpr llvm::StringLiteral` over `const char *` (PR #147301)

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

[clang-tools-extra] [clang-tidy][NFC] Prefer `constexpr llvm::StringLiteral` over `const char *` (PR #147301)

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

[clang-tools-extra] [clang-tidy][NFC] Prefer `constexpr llvm::StringLiteral` over `const char *` (PR #147301)

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

[clang-tools-extra] [clang-tidy][NFC] Make global variable constexpr (PR #147301)

2025-07-07 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook updated https://github.com/llvm/llvm-project/pull/147301 >From bad855d41d4350f51af955a33c079f3f1cf605f3 Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Mon, 7 Jul 2025 06:34:02 -0700 Subject: [PATCH] [clang-tidy][NFC] Prefer `constexpr llvm::StringLiteral` o

[clang-tools-extra] [clang-tidy][NFC] Make global variable constexpr (PR #147301)

2025-07-07 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook created https://github.com/llvm/llvm-project/pull/147301 ```cpp static const char *AnalyzerCheckNamePrefix = "clang-analyzer-"; ``` Right now, `AnalyzerCheckNamePrefix` is global mutable state. Probably not what was intended! >From e7b9da97611b272aae38ab3e4c7ed411

[clang-tools-extra] [clang-tidy] Add new check: `readability-use-concise-preprocessor-directives` (PR #146830)

2025-07-07 Thread Victor Chernyakin via cfe-commits
@@ -0,0 +1,40 @@ +//===--- UseConcisePreprocessorDirectivesCheck.h - clang-tidy ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang-tools-extra] [clang-tidy] Add new check: `readability-use-concise-preprocessor-directives` (PR #146830)

2025-07-07 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook updated https://github.com/llvm/llvm-project/pull/146830 >From 9eb58438d2b4061ad7a6bdbd1db82a5fd4043948 Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Thu, 3 Jul 2025 00:19:52 -0700 Subject: [PATCH 01/12] [clang-tidy] Add new check: `modernize-use-concise-

[clang] [clang-tools-extra] [ASTMatchers][NFC] Replace `makeMatcher` function with CTAD (PR #147197)

2025-07-07 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook updated https://github.com/llvm/llvm-project/pull/147197 >From c9da8d946b867fb6e095cefee44388f240c28c28 Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Sun, 6 Jul 2025 08:32:49 -0700 Subject: [PATCH 1/2] [ASTMatchers][NFC] Replace `makeMatcher` function with

[clang] [clang-tools-extra] [ASTMatchers][NFC] Replace `makeMatcher` function with CTAD (PR #147197)

2025-07-06 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook created https://github.com/llvm/llvm-project/pull/147197 C++17's CTAD obsoletes `makeMatcher` (and many `make*` functions like it). The deduction guide is written out explicitly to avoid `-Wctad-maybe-unsupported` warnings. >From c9da8d946b867fb6e095cefee44388f24

[clang-tools-extra] [clang-tidy] Teach `modernize-type-traits` about more type traits (PR #147074)

2025-07-06 Thread Victor Chernyakin via cfe-commits
localspook wrote: When we're ready to merge, someone please do it for me, I don't have write permissions. https://github.com/llvm/llvm-project/pull/147074 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/l

[clang-tools-extra] [clang-tidy] Add new check: `readability-use-concise-preprocessor-directives` (PR #146830)

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

[clang-tools-extra] [clang-tidy] Add new check: `readability-use-concise-preprocessor-directives` (PR #146830)

2025-07-06 Thread Victor Chernyakin via cfe-commits
@@ -0,0 +1,40 @@ +//===--- UseConcisePreprocessorDirectivesCheck.h - clang-tidy ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang-tools-extra] [clang-tidy] Add new check: `readability-use-concise-preprocessor-directives` (PR #146830)

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

[clang-tools-extra] [clang-tidy] Add new check: `readability-use-concise-preprocessor-directives` (PR #146830)

2025-07-06 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook updated https://github.com/llvm/llvm-project/pull/146830 >From 9eb58438d2b4061ad7a6bdbd1db82a5fd4043948 Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Thu, 3 Jul 2025 00:19:52 -0700 Subject: [PATCH 01/11] [clang-tidy] Add new check: `modernize-use-concise-

[clang-tools-extra] [clang-tidy] Add new check: `readability-use-concise-preprocessor-directives` (PR #146830)

2025-07-06 Thread Victor Chernyakin via cfe-commits
@@ -0,0 +1,138 @@ +// RUN: %check_clang_tidy -std=c++98 -check-suffixes=,CXX %s readability-use-concise-preprocessor-directives %t +// RUN: %check_clang_tidy -std=c++11 -check-suffixes=,CXX %s readability-use-concise-preprocessor-directives %t +// RUN: %check_clang_tidy -std=c++

[clang-tools-extra] [clang-tidy] Add new check: `readability-use-concise-preprocessor-directives` (PR #146830)

2025-07-06 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook updated https://github.com/llvm/llvm-project/pull/146830 >From 9eb58438d2b4061ad7a6bdbd1db82a5fd4043948 Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Thu, 3 Jul 2025 00:19:52 -0700 Subject: [PATCH 01/10] [clang-tidy] Add new check: `modernize-use-concise-

[clang-tools-extra] [clang-tidy] Add new check: `readability-use-concise-preprocessor-directives` (PR #146830)

2025-07-06 Thread Victor Chernyakin via cfe-commits
@@ -0,0 +1,108 @@ +//===--- UseConcisePreprocessorDirectivesCheck.cpp - clang-tidy ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] [clang-tidy] filter check options by enabled checks in '--dump-config' (PR #147142)

2025-07-06 Thread Victor Chernyakin via cfe-commits
@@ -503,6 +503,21 @@ getCheckNames(const ClangTidyOptions &Options, return Factory.getCheckNames(); } +void filterCheckOptions(ClangTidyOptions &Options, +const std::vector &EnabledChecks) { + StringSet<> EnabledChecksSet(llvm::from_range, EnabledChe

[clang-tools-extra] [clang-tidy] Teach `modernize-type-traits` about more type traits (PR #147074)

2025-07-05 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook updated https://github.com/llvm/llvm-project/pull/147074 >From 7ad6f7b8663980183e8bb8e79843942870e36267 Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Fri, 4 Jul 2025 07:42:54 -0700 Subject: [PATCH 1/6] [clang-tidy] Teach `modernize-type-traits` about more

[clang-tools-extra] [clang-tidy] Teach `modernize-type-traits` about more type traits (PR #147074)

2025-07-05 Thread Victor Chernyakin via cfe-commits
@@ -130,6 +155,10 @@ static const llvm::StringSet<> TypeTraits = { "result_of", "invoke_result", "type_identity", +"compare_three_way_result", +"common_comparison_category", localspook wrote: > We usually don't care if there would be a warn

[clang-tools-extra] [clang-tidy] Teach `modernize-type-traits` about more type traits (PR #147074)

2025-07-05 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook edited https://github.com/llvm/llvm-project/pull/147074 ___ 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 `modernize-type-traits` about more type traits (PR #147074)

2025-07-05 Thread Victor Chernyakin via cfe-commits
@@ -130,6 +155,10 @@ static const llvm::StringSet<> TypeTraits = { "result_of", "invoke_result", "type_identity", +"compare_three_way_result", +"common_comparison_category", localspook wrote: Hm, I've looked into it some more, and it turns

[clang-tools-extra] [clang-tidy] Add new check: `readability-use-concise-preprocessor-directives` (PR #146830)

2025-07-05 Thread Victor Chernyakin via cfe-commits
@@ -0,0 +1,40 @@ +//===--- UseConcisePreprocessorDirectivesCheck.h - clang-tidy ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang-tools-extra] [clang-tidy] Add new check: `readability-use-concise-preprocessor-directives` (PR #146830)

2025-07-05 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook updated https://github.com/llvm/llvm-project/pull/146830 >From 9eb58438d2b4061ad7a6bdbd1db82a5fd4043948 Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Thu, 3 Jul 2025 00:19:52 -0700 Subject: [PATCH 1/9] [clang-tidy] Add new check: `modernize-use-concise-pr

[clang-tools-extra] [clang-tidy] Add new check: `readability-use-concise-preprocessor-directives` (PR #146830)

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

[clang-tools-extra] [clang-tidy] Add new check: `readability-use-concise-preprocessor-directives` (PR #146830)

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

[clang-tools-extra] [clang-tidy] Add new check: `readability-use-concise-preprocessor-directives` (PR #146830)

2025-07-05 Thread Victor Chernyakin via cfe-commits
@@ -0,0 +1,40 @@ +//===--- UseConcisePreprocessorDirectivesCheck.h - clang-tidy ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang-tools-extra] [clang-tidy] Add new check: `readability-use-concise-preprocessor-directives` (PR #146830)

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

[clang-tools-extra] [clang-tidy] Add new check: `readability-use-concise-preprocessor-directives` (PR #146830)

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

[clang-tools-extra] [clang-tidy] Add new check: `modernize-use-concise-preprocessor-directives` (PR #146830)

2025-07-05 Thread Victor Chernyakin via cfe-commits
localspook wrote: Maybe I'm misunderstanding, but are you concerned about ```cpp #if defined(foo) && defined(bar) ``` being rewritten to this? ```cpp #ifdef foo && if defined(bar) ``` It won't do that, that's not valid syntax (there's not really any way to rewrite it). I've added a test to ensur

[clang-tools-extra] [clang-tidy] Add new check: `modernize-use-concise-preprocessor-directives` (PR #146830)

2025-07-05 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook updated https://github.com/llvm/llvm-project/pull/146830 >From 9eb58438d2b4061ad7a6bdbd1db82a5fd4043948 Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Thu, 3 Jul 2025 00:19:52 -0700 Subject: [PATCH 1/8] [clang-tidy] Add new check: `modernize-use-concise-pr

[clang-tools-extra] [clang-tidy] Teach `modernize-type-traits` about more type traits (PR #147074)

2025-07-04 Thread Victor Chernyakin via cfe-commits
@@ -130,6 +149,12 @@ static const llvm::StringSet<> TypeTraits = { "result_of", "invoke_result", "type_identity", +"tuple_element", localspook wrote: Done https://github.com/llvm/llvm-project/pull/147074 ___

[clang-tools-extra] [clang-tidy] Teach `modernize-type-traits` about more type traits (PR #147074)

2025-07-04 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook updated https://github.com/llvm/llvm-project/pull/147074 >From 7ad6f7b8663980183e8bb8e79843942870e36267 Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Fri, 4 Jul 2025 07:42:54 -0700 Subject: [PATCH 1/5] [clang-tidy] Teach `modernize-type-traits` about more

[clang-tools-extra] [clang-tidy] Teach `modernize-type-traits` about more type traits (PR #147074)

2025-07-04 Thread Victor Chernyakin via cfe-commits
localspook wrote: I've changed the tests to use `-std=c++17-or-later`, but I don't think we need to add tests for the new traits because they wouldn't exercise any new codepaths. It's not like we only match on `compare_three_way_result_t` if compiling in C++20, no, we match on all traits in al

[clang-tools-extra] [clang-tidy] Teach `modernize-type-traits` about more type traits (PR #147074)

2025-07-04 Thread Victor Chernyakin via cfe-commits
@@ -130,6 +149,12 @@ static const llvm::StringSet<> TypeTraits = { "result_of", "invoke_result", "type_identity", +"tuple_element", localspook wrote: Good catch -- recursive traits are indeed problematic, the check fires on the recursive use i

[clang-tools-extra] [clang-tidy] Teach `modernize-type-traits` about more type traits (PR #147074)

2025-07-04 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook updated https://github.com/llvm/llvm-project/pull/147074 >From 7ad6f7b8663980183e8bb8e79843942870e36267 Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Fri, 4 Jul 2025 07:42:54 -0700 Subject: [PATCH 1/4] [clang-tidy] Teach `modernize-type-traits` about more

[clang-tools-extra] [clang-tidy] Teach `modernize-type-traits` about more type traits (PR #147074)

2025-07-04 Thread Victor Chernyakin via cfe-commits
localspook wrote: Mostly manually: I took a list of [all standard library symbols](https://timsong-cpp.github.io/cppwp/libraryindex), used a hacky regex to find `foo`/`foo_[tv]` pairs, filtered out the false positives, diffed against the check's current list, and added what was missing. https

[clang-tools-extra] [clang-tidy] Teach `modernize-type-traits` about more type traits (PR #147074)

2025-07-04 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook updated https://github.com/llvm/llvm-project/pull/147074 >From 7ad6f7b8663980183e8bb8e79843942870e36267 Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Fri, 4 Jul 2025 07:42:54 -0700 Subject: [PATCH 1/3] [clang-tidy] Teach `modernize-type-traits` about more

[clang-tools-extra] [clang-tidy] Teach `modernize-type-traits` about more type traits (PR #147074)

2025-07-04 Thread Victor Chernyakin via cfe-commits
@@ -130,6 +149,12 @@ static const llvm::StringSet<> TypeTraits = { "result_of", "invoke_result", "type_identity", + "tuple_element", localspook wrote: The `TypeTraits` are already not in alphabetical order (`ValueTraits` are though), and I d

[clang-tools-extra] [clang-tidy] Teach `modernize-type-traits` about more type traits (PR #147074)

2025-07-04 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook edited https://github.com/llvm/llvm-project/pull/147074 ___ 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 `modernize-type-traits` about more type traits (PR #147074)

2025-07-04 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook updated https://github.com/llvm/llvm-project/pull/147074 >From 7ad6f7b8663980183e8bb8e79843942870e36267 Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Fri, 4 Jul 2025 07:42:54 -0700 Subject: [PATCH 1/2] [clang-tidy] Teach `modernize-type-traits` about more

[clang-tools-extra] [clang-tidy] Teach `modernize-type-traits` about more type traits (PR #147074)

2025-07-04 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook created https://github.com/llvm/llvm-project/pull/147074 These new traits come from various standard versions: C++14: - `tuple_element_t` C++17: - `is_placeholder_v` - `is_bind_expression_v` - `ratio_equal_v` - `ratio_not_equal_v` - `ratio_less_v` - `ratio_les

[clang-tools-extra] [clang-tidy] Add new check: `modernize-use-concise-preprocessor-directives` (PR #146830)

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

[clang-tools-extra] [clang-tidy] Add new check: `modernize-use-concise-preprocessor-directives` (PR #146830)

2025-07-03 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook updated https://github.com/llvm/llvm-project/pull/146830 >From 9eb58438d2b4061ad7a6bdbd1db82a5fd4043948 Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Thu, 3 Jul 2025 00:19:52 -0700 Subject: [PATCH 1/5] [clang-tidy] Add new check: `modernize-use-concise-pr

[clang-tools-extra] [clang-tidy] Add new check: `modernize-use-concise-preprocessor-directives` (PR #146830)

2025-07-03 Thread Victor Chernyakin via cfe-commits
@@ -0,0 +1,105 @@ +//===--- UseConcisePreprocessorDirectivesCheck.cpp - clang-tidy ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] [clang-tidy] Add new check: `modernize-use-concise-preprocessor-directives` (PR #146830)

2025-07-03 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook updated https://github.com/llvm/llvm-project/pull/146830 >From 9eb58438d2b4061ad7a6bdbd1db82a5fd4043948 Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Thu, 3 Jul 2025 00:19:52 -0700 Subject: [PATCH 1/4] [clang-tidy] Add new check: `modernize-use-concise-pr

[clang-tools-extra] [clang-tidy] Add new check: `modernize-use-concise-preprocessor-directives` (PR #146830)

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

[clang-tools-extra] [clang-tidy] Add new check: `modernize-use-concise-preprocessor-directives` (PR #146830)

2025-07-03 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook created https://github.com/llvm/llvm-project/pull/146830 Closes #132561. This is a check that rewrites `#if`s and `#elif`s like so: ```cpp #if defined(MEOW) // -> #ifdef MEOW #if !defined(MEOW) // -> #ifndef MEOW ``` And, since C23 and C++23: ```cpp #elif def

[clang] [clang] Validate ABI tag attributes (PR #84272)

2024-03-07 Thread Victor Chernyakin via cfe-commits
LocalSpook wrote: > I kind of think "no enforcement for invalid input" is reasonable here. That > would be consistent with things like the alias attribute where we accept a > string that has to conform to ABI mangling rules (which could be a matter of > poor QoI rather than precedent). If I'm

[clang] [clang] Validate ABI tag attributes (PR #84272)

2024-03-06 Thread Victor Chernyakin via cfe-commits
LocalSpook wrote: @erichkeane @AaronBallman https://github.com/llvm/llvm-project/pull/84272 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits