@@ -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
@@ -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
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`
--
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
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
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
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
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
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
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
@@ -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
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
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
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
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 |
|-|
@@ -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
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
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
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
@@ -31,8 +31,6 @@ class NoLintDirectiveHandler {
public:
NoLintDirectiveHandler();
~NoLintDirectiveHandler();
- NoLintDirectiveHandler(const NoLintDirectiveHandler &) = delete;
- NoLintDirectiveHandler &operator=(const NoLintDirectiveHandler &) = delete;
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
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
@@ -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
@@ -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
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
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
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
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
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
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
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
@@ -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
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-
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
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
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
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
@@ -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
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
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-
@@ -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++
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-
@@ -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
@@ -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
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
@@ -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
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
@@ -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
@@ -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
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
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
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
@@ -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
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
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
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
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
@@ -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
___
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
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
@@ -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
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
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
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
@@ -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
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
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
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
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
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
@@ -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
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
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
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
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
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
76 matches
Mail list logo