Skip to content

[clang-tidy] Avoid matching nodes in system headers #151035

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

carlosgalvezp
Copy link
Contributor

@carlosgalvezp carlosgalvezp commented Jul 28, 2025

This commit is a re-do of e4a8969, which got reverted, with the same goal: dramatically speed-up clang-tidy by avoiding doing work in system headers (which is wasteful as warnings are later discarded). This proposal was already discussed here with favorable feedback: #132725

The novelty of this patch is:

  • It's less aggressive: it does not fiddle with AST traversal. This solves the issue with the previous patch, which impacted the ability to inspect parents of a given node.

  • Instead, what we optimize for is exitting early in each Traverse* function of MatchASTVisitor if the node is in a system header, thus avoiding calling the match() function with its corresponding callback (when there is a match).

  • It does not cause any failing tests.

  • It does not move MatchFinderOptions - instead we add a user-defined default constructor which solves the same problem.

  • It introduces a function shouldSkipNode which can be extended for adding more conditions. For example there's a PR open about skipping modules in clang-tidy where this could come handy: [clang-tidy] [Modules] Skip checking decls in clang-tidy #145630

As a benchmark, I ran clang-tidy with all checks activated, on a single .cpp file which #includes all the standard C++ headers, then measure the time as well as found warnings.

On trunk:

Suppressed 75413 warnings (75413 in non-user code).

real	0m12.418s
user	0m12.270s
sys	0m0.129s

With this patch:

Suppressed 11448 warnings (11448 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.

real	0m1.666s
user	0m1.538s
sys	0m0.129s

With the original patch that got reverted:

Suppressed 11428 warnings (11428 in non-user code).

real	0m1.193s
user	0m1.096s
sys	0m0.096s

We therefore get a dramatic reduction in number of warnings and runtime, with no change in functionality.

The remaining warnings are due to PPCallbacks - implementing a similar system-header exclusion mechanism there can lead to almost no warnings left in system headers. This does not bring the runtime down as much, though, so it's probably not worth the effort.

Fixes #52959

@llvmbot llvmbot added clang Clang issues not falling into any other category clang-tools-extra clang-tidy labels Jul 28, 2025
@llvmbot
Copy link
Member

llvmbot commented Jul 28, 2025

@llvm/pr-subscribers-clang-tools-extra
@llvm/pr-subscribers-clang

@llvm/pr-subscribers-clang-tidy

Author: Carlos Galvez (carlosgalvezp)

Changes

This commit is a re-do of e4a8969, which got reverted, with the same goal: dramatically speed-up clang-tidy by avoiding doing work in system headers (which is wasteful as warnings are later discarded). This proposal was already discussed here with favorable feedback:
#132725

The novelty of this patch is:

  • It's less aggressive: it does not fiddle with AST traversal. This solves the issue with the previous patch, which impacted the ability to inspect parents of a given node.

  • Instead, what we optimize for is exitting early in each Traverse* function of MatchASTVisitor if the node is in a system header, thus avoiding calling the match() function with its corresponding callback (when there is a match).

  • It does not cause any failing tests.

  • It does not move MatchFinderOptions - instead we add a user-defined default constructor which solves the same problem.

  • It introduces a function shouldSkipNode which can be extended for adding more conditions. For example there's a PR open about skipping modules in clang-tidy where this could come handy: [clang-tidy] [Modules] Skip checking decls in clang-tidy #145630

As a benchmark, I ran clang-tidy with all checks activated, on a single .cpp file which #includes all the standard C++ headers, then measure the time as well as found warnings.

On trunk:

Suppressed 213314 warnings (213314 in non-user code).

real	0m14.311s
user	0m14.126s
sys	0m0.185s

With this patch:

Suppressed 149399 warnings (149399 in non-user code). real	0m3.583s
user	0m3.454s
sys	0m0.128s

With the original patch that got reverted:

Suppressed 8050 warnings (8050 in non-user code).
Runtime: around 1 second.

A lot of warnings remain and the runtime is sligthly higher, but we still got a dramatic reduction with no change in functionality.

Further investigation has shown that all of the remaining warnings are due to PPCallbacks - implementing a similar system-header exclusion mechanism there can lead to almost no warnings left in system headers. This does not bring the runtime down as much, though.

However this may not be as straightforward or wanted, it may even need to be done on a per-check basis (there's about 10 checks or so that would need to explicitly ignore system headers). I will leave that for another patch, it's low priority and does not improve the runtime much (it just prints better statistics).

Fixes #52959


Full diff: https://github.com/llvm/llvm-project/pull/151035.diff

7 Files Affected:

  • (modified) clang-tools-extra/clang-tidy/ClangTidy.cpp (+4)
  • (modified) clang-tools-extra/docs/ReleaseNotes.rst (+4)
  • (modified) clang-tools-extra/test/clang-tidy/infrastructure/file-filter.cpp (-5)
  • (modified) clang-tools-extra/test/clang-tidy/infrastructure/system-headers.cpp (+2-2)
  • (modified) clang/docs/ReleaseNotes.rst (+3)
  • (modified) clang/include/clang/ASTMatchers/ASTMatchFinder.h (+5)
  • (modified) clang/lib/ASTMatchers/ASTMatchFinder.cpp (+61-5)
diff --git a/clang-tools-extra/clang-tidy/ClangTidy.cpp b/clang-tools-extra/clang-tidy/ClangTidy.cpp
index e84be0461f280..eb91484363d6f 100644
--- a/clang-tools-extra/clang-tidy/ClangTidy.cpp
+++ b/clang-tools-extra/clang-tidy/ClangTidy.cpp
@@ -425,6 +425,10 @@ ClangTidyASTConsumerFactory::createASTConsumer(
     FinderOptions.CheckProfiling.emplace(Profiling->Records);
   }
 
+  // Avoid processing system headers, unless the user explicitly requests it
+  if (!Context.getOptions().SystemHeaders.value_or(false))
+    FinderOptions.IgnoreSystemHeaders = true;
+
   std::unique_ptr<ast_matchers::MatchFinder> Finder(
       new ast_matchers::MatchFinder(std::move(FinderOptions)));
 
diff --git a/clang-tools-extra/docs/ReleaseNotes.rst b/clang-tools-extra/docs/ReleaseNotes.rst
index 3ea1c5104316f..f761665677f20 100644
--- a/clang-tools-extra/docs/ReleaseNotes.rst
+++ b/clang-tools-extra/docs/ReleaseNotes.rst
@@ -97,6 +97,10 @@ Improvements to clang-tidy
   now run checks in parallel by default using all available hardware threads.
   Both scripts display the number of threads being used in their output.
 
+- :program:`clang-tidy` no longer attemps to match AST nodes from system headers
+  by default, greatly improving performance. This behavior is disabled if the
+  `SystemHeaders` option is enabled.
+
 New checks
 ^^^^^^^^^^
 
diff --git a/clang-tools-extra/test/clang-tidy/infrastructure/file-filter.cpp b/clang-tools-extra/test/clang-tidy/infrastructure/file-filter.cpp
index 448ef9ddf166c..d9ec1049963b0 100644
--- a/clang-tools-extra/test/clang-tidy/infrastructure/file-filter.cpp
+++ b/clang-tools-extra/test/clang-tidy/infrastructure/file-filter.cpp
@@ -66,19 +66,14 @@ class A { A(int); };
 // CHECK4-NOT: warning:
 // CHECK4-QUIET-NOT: warning:
 
-// CHECK: Suppressed 3 warnings (3 in non-user code)
 // CHECK: Use -header-filter=.* to display errors from all non-system headers.
 // CHECK-QUIET-NOT: Suppressed
-// CHECK2: Suppressed 1 warnings (1 in non-user code)
-// CHECK2: Use -header-filter=.* {{.*}}
 // CHECK2-QUIET-NOT: Suppressed
-// CHECK3: Suppressed 2 warnings (2 in non-user code)
 // CHECK3: Use -header-filter=.* {{.*}}
 // CHECK3-QUIET-NOT: Suppressed
 // CHECK4-NOT: Suppressed {{.*}} warnings
 // CHECK4-NOT: Use -header-filter=.* {{.*}}
 // CHECK4-QUIET-NOT: Suppressed
-// CHECK6: Suppressed 2 warnings (2 in non-user code)
 // CHECK6: Use -header-filter=.* {{.*}}
 
 int x = 123;
diff --git a/clang-tools-extra/test/clang-tidy/infrastructure/system-headers.cpp b/clang-tools-extra/test/clang-tidy/infrastructure/system-headers.cpp
index 9fa990b6aac8c..a25480e9aa39c 100644
--- a/clang-tools-extra/test/clang-tidy/infrastructure/system-headers.cpp
+++ b/clang-tools-extra/test/clang-tidy/infrastructure/system-headers.cpp
@@ -11,9 +11,9 @@
 // RUN: clang-tidy -help | FileCheck -check-prefix=CHECK-OPT-PRESENT %s
 
 // RUN: clang-tidy -checks='-*,google-explicit-constructor' -header-filter='.*' -system-headers=true %s -- -isystem %S/Inputs/system-headers 2>&1 | FileCheck -check-prefix=CHECK-SYSTEM-HEADERS %s
-// RUN: clang-tidy -checks='-*,google-explicit-constructor' -header-filter='.*' -system-headers=false %s -- -isystem %S/Inputs/system-headers 2>&1 | FileCheck -check-prefix=CHECK-NO-SYSTEM-HEADERS %s
+// RUN: clang-tidy -checks='-*,google-explicit-constructor' -header-filter='.*' -system-headers=false %s -- -isystem %S/Inputs/system-headers 2>&1 | FileCheck -check-prefix=CHECK-NO-SYSTEM-HEADERS --allow-empty %s
 // RUN: clang-tidy -checks='-*,google-explicit-constructor' -header-filter='.*' -config='SystemHeaders: true' %s -- -isystem %S/Inputs/system-headers 2>&1 | FileCheck -check-prefix=CHECK-SYSTEM-HEADERS %s
-// RUN: clang-tidy -checks='-*,google-explicit-constructor' -header-filter='.*' -config='SystemHeaders: false' %s -- -isystem %S/Inputs/system-headers 2>&1 | FileCheck -check-prefix=CHECK-NO-SYSTEM-HEADERS %s
+// RUN: clang-tidy -checks='-*,google-explicit-constructor' -header-filter='.*' -config='SystemHeaders: false' %s -- -isystem %S/Inputs/system-headers 2>&1 | FileCheck -check-prefix=CHECK-NO-SYSTEM-HEADERS --allow-empty %s
 
 #include <system_header.h>
 // CHECK-SYSTEM-HEADERS: system_header.h:1:13: warning: single-argument constructors must be marked explicit
diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index ec51ffddce1af..7a0b833dd7bce 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -207,6 +207,9 @@ AST Matchers
 - Ensure ``hasBitWidth`` doesn't crash on bit widths that are dependent on template
   parameters.
 
+- Add a boolean member ``IgnoreSystemHeaders`` to ``MatchFinderOptions``. This
+  allows it to ignore nodes in system headers when traversing the AST.
+
 clang-format
 ------------
 
diff --git a/clang/include/clang/ASTMatchers/ASTMatchFinder.h b/clang/include/clang/ASTMatchers/ASTMatchFinder.h
index 73cbcf1f25025..2d36e8c4fae1c 100644
--- a/clang/include/clang/ASTMatchers/ASTMatchFinder.h
+++ b/clang/include/clang/ASTMatchers/ASTMatchFinder.h
@@ -135,10 +135,15 @@ class MatchFinder {
       llvm::StringMap<llvm::TimeRecord> &Records;
     };
 
+    MatchFinderOptions() {}
+
     /// Enables per-check timers.
     ///
     /// It prints a report after match.
     std::optional<Profiling> CheckProfiling;
+
+    /// Avoids matching declarations in system headers.
+    bool IgnoreSystemHeaders{false};
   };
 
   MatchFinder(MatchFinderOptions Options = MatchFinderOptions());
diff --git a/clang/lib/ASTMatchers/ASTMatchFinder.cpp b/clang/lib/ASTMatchers/ASTMatchFinder.cpp
index 6d0ba0b7907a1..15d9183c9fddb 100644
--- a/clang/lib/ASTMatchers/ASTMatchFinder.cpp
+++ b/clang/lib/ASTMatchers/ASTMatchFinder.cpp
@@ -1336,6 +1336,45 @@ class MatchASTVisitor : public RecursiveASTVisitor<MatchASTVisitor>,
     return false;
   }
 
+  bool isInSystemHeader(const SourceLocation &Loc) {
+    const SourceManager &SM = getASTContext().getSourceManager();
+    return SM.isInSystemHeader(Loc);
+  }
+
+  template <typename T> SourceLocation getNodeLocation(T const &Node) {
+    return Node.getBeginLoc();
+  }
+
+  SourceLocation getNodeLocation(QualType const &Node) { return {}; }
+
+  SourceLocation getNodeLocation(NestedNameSpecifier const &Node) { return {}; }
+
+  SourceLocation getNodeLocation(CXXCtorInitializer const &Node) {
+    return Node.getSourceLocation();
+  }
+
+  SourceLocation getNodeLocation(TemplateArgumentLoc const &Node) {
+    return Node.getLocation();
+  }
+
+  SourceLocation getNodeLocation(Attr const &Node) {
+    return Node.getLocation();
+  }
+
+  template <typename T>
+  auto shouldSkipNode(T const &Node)
+      -> std::enable_if_t<std::is_pointer_v<T>, bool> {
+    return (Node == nullptr) || shouldSkipNode(*Node);
+  }
+
+  template <typename T>
+  auto shouldSkipNode(T const &Node)
+      -> std::enable_if_t<!std::is_pointer_v<T>, bool> {
+    if (Options.IgnoreSystemHeaders && isInSystemHeader(getNodeLocation(Node)))
+      return true;
+    return false;
+  }
+
   /// Bucket to record map.
   ///
   /// Used to get the appropriate bucket for each matcher.
@@ -1465,9 +1504,8 @@ bool MatchASTVisitor::objcClassIsDerivedFrom(
 }
 
 bool MatchASTVisitor::TraverseDecl(Decl *DeclNode) {
-  if (!DeclNode) {
+  if (shouldSkipNode(DeclNode))
     return true;
-  }
 
   bool ScopedTraversal =
       TraversingASTNodeNotSpelledInSource || DeclNode->isImplicit();
@@ -1495,9 +1533,9 @@ bool MatchASTVisitor::TraverseDecl(Decl *DeclNode) {
 }
 
 bool MatchASTVisitor::TraverseStmt(Stmt *StmtNode, DataRecursionQueue *Queue) {
-  if (!StmtNode) {
+  if (shouldSkipNode(StmtNode))
     return true;
-  }
+
   bool ScopedTraversal = TraversingASTNodeNotSpelledInSource ||
                          TraversingASTChildrenNotSpelledInSource;
 
@@ -1507,11 +1545,17 @@ bool MatchASTVisitor::TraverseStmt(Stmt *StmtNode, DataRecursionQueue *Queue) {
 }
 
 bool MatchASTVisitor::TraverseType(QualType TypeNode) {
+  if (shouldSkipNode(TypeNode))
+    return true;
+
   match(TypeNode);
   return RecursiveASTVisitor<MatchASTVisitor>::TraverseType(TypeNode);
 }
 
 bool MatchASTVisitor::TraverseTypeLoc(TypeLoc TypeLocNode) {
+  if (shouldSkipNode(TypeLocNode))
+    return true;
+
   // The RecursiveASTVisitor only visits types if they're not within TypeLocs.
   // We still want to find those types via matchers, so we match them here. Note
   // that the TypeLocs are structurally a shadow-hierarchy to the expressed
@@ -1523,6 +1567,9 @@ bool MatchASTVisitor::TraverseTypeLoc(TypeLoc TypeLocNode) {
 }
 
 bool MatchASTVisitor::TraverseNestedNameSpecifier(NestedNameSpecifier *NNS) {
+  if (shouldSkipNode(NNS))
+    return true;
+
   match(*NNS);
   return RecursiveASTVisitor<MatchASTVisitor>::TraverseNestedNameSpecifier(NNS);
 }
@@ -1532,6 +1579,9 @@ bool MatchASTVisitor::TraverseNestedNameSpecifierLoc(
   if (!NNS)
     return true;
 
+  if (shouldSkipNode(NNS))
+    return true;
+
   match(NNS);
 
   // We only match the nested name specifier here (as opposed to traversing it)
@@ -1544,7 +1594,7 @@ bool MatchASTVisitor::TraverseNestedNameSpecifierLoc(
 
 bool MatchASTVisitor::TraverseConstructorInitializer(
     CXXCtorInitializer *CtorInit) {
-  if (!CtorInit)
+  if (shouldSkipNode(CtorInit))
     return true;
 
   bool ScopedTraversal = TraversingASTNodeNotSpelledInSource ||
@@ -1562,11 +1612,17 @@ bool MatchASTVisitor::TraverseConstructorInitializer(
 }
 
 bool MatchASTVisitor::TraverseTemplateArgumentLoc(TemplateArgumentLoc Loc) {
+  if (shouldSkipNode(Loc))
+    return true;
+
   match(Loc);
   return RecursiveASTVisitor<MatchASTVisitor>::TraverseTemplateArgumentLoc(Loc);
 }
 
 bool MatchASTVisitor::TraverseAttr(Attr *AttrNode) {
+  if (shouldSkipNode(AttrNode))
+    return true;
+
   match(*AttrNode);
   return RecursiveASTVisitor<MatchASTVisitor>::TraverseAttr(AttrNode);
 }

@carlosgalvezp carlosgalvezp force-pushed the system_headers_new branch 2 times, most recently from d52db8c to cc9a245 Compare July 28, 2025 21:05
Copy link
Contributor

@vbvictor vbvictor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for working on this!
Left a couple of NFC comments on style

Copy link
Contributor

@5chmidti 5chmidti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome to see this continuing. The changes also look quite clean and extendable to, e.g., modules, like you mentioned. The performance improvement is still incredible to see. Especially when considering library layering in user-code from external or internal libraries, giving this a potentially much stronger impact on analysis time. I'm not sure if we could recover the last ~2.5s compared to the previous change without breaking something.

It's probably an LGTM from me, but I will think about the change for a bit and try it out a bit in a few days (e.g., w.r.t. macros).

@@ -135,10 +135,15 @@ class MatchFinder {
llvm::StringMap<llvm::TimeRecord> &Records;
};

MatchFinderOptions() {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MatchFinderOptions() = default; (why add it in the first place? Having no ctor should be enough)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know, it bothers me a lot as well. I am not sure if this is a compiler bug or expected, but the moment I add a non-static member initializer (NSDMI) to the struct, I get the following compiler error:

https://godbolt.org/z/Mb3bnxjjM

Using = default surprisingly does not work :(

The solutions are:

  • Move MatchFinderOptions outside the MatchFinder class (like I did on the original patch). I didn't like this because it introduced unrelated noise to the patch, but I'm happy to do it on a separate patch if we feel it's the cleanest.
  • Not use NSDMI, and instead create a constructor with member initializer list.
  • Add a non-default user-defined constructor (this patch).

@carlosgalvezp carlosgalvezp force-pushed the system_headers_new branch 2 times, most recently from 38fb173 to 220d450 Compare July 29, 2025 19:43
@carlosgalvezp
Copy link
Contributor Author

I'm happy to split the little refactor of shouldSkipNode into a separate patch to make this one smaller / not have to revert the whole thing if it doesn't work out, please let me know :)

@vbvictor
Copy link
Contributor

I'm happy to split the little refactor of shouldSkipNode into a separate patch to make this one smaller / not have to revert the whole thing if it doesn't work out, please let me know :)

I think this patch is good and small enough as a whole, so not need to worry about further reduction.

@carlosgalvezp
Copy link
Contributor Author

I'm not sure if we could recover the last ~2.5s

@5chmidti Here goes 2 more seconds :)

#151772

With both patches, the result is very close to the reverted patch, just 0.5 seconds diff :) Maybe the PPCallbacks aren't worth touching after all.

Suppressed 11142 warnings (11142 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.

real	0m1.732s
user	0m1.591s
sys	0m0.141s

@vbvictor
Copy link
Contributor

vbvictor commented Aug 2, 2025

As a benchmark, I ran clang-tidy with all checks activated, on a single .cpp file which #includes all the standard C++ headers, then measure the time as well as found warnings.

Could you please save this file (or make a gist) for later. I think we could have some benchmarks of clang-tidy and this file will a bench-test.

@firewave
Copy link

firewave commented Aug 2, 2025

Something else to benchmark: #109450.

Copy link
Contributor

@5chmidti 5chmidti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. This will be super nice to have, and should also help make clang-tidy checks in clangd more responsive (when using system includes)

@5chmidti Here goes 2 more seconds :)

XD

@carlosgalvezp
Copy link
Contributor Author

Could you please save this file (or make a gist) for later.

https://godbolt.org/z/s7jPbGdWz

@carlosgalvezp
Copy link
Contributor Author

Something else to benchmark: #109450.

@firewave Here's the results:

On trunk:

6874 warnings generated.
Suppressed 6874 warnings (6874 in non-user code).

real	0m5.298s
user	0m5.209s
sys	0m0.089s

With this patch:

1949 warnings generated.
Suppressed 1949 warnings (1949 in non-user code).

real	0m1.342s
user	0m1.254s
sys	0m0.089s

@vbvictor
Copy link
Contributor

vbvictor commented Aug 3, 2025

Benchmark of whole LLVM with new option -enable-check-profile in run-clang-tidy:
Without this patch:

===-------------------------------------------------------------------------===
                          clang-tidy checks profiling
===-------------------------------------------------------------------------===
  Total Execution Time: 24487.3832 seconds (24799.3347 wall clock)

     ---User Time---      --System Time--       --User+System--       ---Wall Time---    --- Name ---
    2049.0815 ( 11.3%)    984.8611 ( 15.6%)    3033.9425 ( 12.4%)    3051.4287 ( 12.3%)  misc-unused-using-decls
    1656.9201 (  9.1%)      4.5172 (  0.1%)    1661.4373 (  6.8%)    1684.7562 (  6.8%)  readability-identifier-naming
    1287.2900 (  7.1%)    190.2703 (  3.0%)    1477.5604 (  6.0%)    1497.9806 (  6.0%)  llvm-qualified-auto
     777.7900 (  4.3%)    348.1104 (  5.5%)    1125.9004 (  4.6%)    1143.7030 (  4.6%)  llvm-prefer-isa-or-dyn-cast-in-conditionals
     661.6098 (  3.6%)    300.6106 (  4.8%)     962.2204 (  3.9%)     976.0817 (  3.9%)  llvm-use-new-mlir-op-builder
     635.3992 (  3.5%)    307.7876 (  4.9%)     943.1868 (  3.9%)     955.1817 (  3.9%)  misc-misleading-identifier
     601.2707 (  3.3%)    289.6396 (  4.6%)     890.9103 (  3.6%)     903.4145 (  3.6%)  misc-definitions-in-headers
     623.0603 (  3.4%)    241.8083 (  3.8%)     864.8686 (  3.5%)     870.0066 (  3.5%)  misc-unconventional-assign-operator
     531.2312 (  2.9%)    257.4703 (  4.1%)     788.7015 (  3.2%)     798.1253 (  3.2%)  misc-non-copyable-objects
     485.4046 (  2.7%)    199.9448 (  3.2%)     685.3494 (  2.8%)     695.3362 (  2.8%)  misc-confusable-identifiers
     472.4182 (  2.6%)    196.1331 (  3.1%)     668.5513 (  2.7%)     673.9013 (  2.7%)  misc-redundant-expression
     447.1723 (  2.5%)    133.9819 (  2.1%)     581.1542 (  2.4%)     585.2264 (  2.4%)  bugprone-use-after-move
     307.1628 (  1.7%)    122.2547 (  1.9%)     429.4175 (  1.8%)     434.2075 (  1.8%)  bugprone-stringview-nullptr
     314.4236 (  1.7%)    104.7319 (  1.7%)     419.1556 (  1.7%)     421.5933 (  1.7%)  bugprone-standalone-empty
     266.8207 (  1.5%)    129.1858 (  2.0%)     396.0065 (  1.6%)     401.4400 (  1.6%)  misc-misplaced-const
     329.9909 (  1.8%)     65.2102 (  1.0%)     395.2011 (  1.6%)     401.3557 (  1.6%)  modernize-macro-to-enum
     238.6055 (  1.3%)    113.6561 (  1.8%)     352.2616 (  1.4%)     362.1046 (  1.5%)  misc-use-internal-linkage
     247.2550 (  1.4%)     78.1046 (  1.2%)     325.3597 (  1.3%)     327.7789 (  1.3%)  llvm-namespace-comment
     229.0520 (  1.3%)     78.2602 (  1.2%)     307.3122 (  1.3%)     309.5962 (  1.2%)  misc-static-assert
     216.2386 (  1.2%)     87.4115 (  1.4%)     303.6501 (  1.2%)     310.4832 (  1.3%)  modernize-type-traits
     193.4055 (  1.1%)     93.6862 (  1.5%)     287.0917 (  1.2%)     290.8492 (  1.2%)  misc-new-delete-overloads
     213.9849 (  1.2%)     56.9021 (  0.9%)     270.8870 (  1.1%)     273.9251 (  1.1%)  readability-container-size-empty
     257.1717 (  1.4%)      2.5328 (  0.0%)     259.7045 (  1.1%)     263.7113 (  1.1%)  bugprone-reserved-identifier
     179.6977 (  1.0%)     77.9258 (  1.2%)     257.6235 (  1.1%)     260.4723 (  1.1%)  modernize-use-transparent-functors
     155.4288 (  0.9%)     75.2556 (  1.2%)     230.6844 (  0.9%)     233.3771 (  0.9%)  llvm-prefer-register-over-unsigned
     153.6946 (  0.8%)     59.8137 (  0.9%)     213.5083 (  0.9%)     214.8026 (  0.9%)  llvm-else-after-return
     148.2659 (  0.8%)     63.9858 (  1.0%)     212.2517 (  0.9%)     218.2334 (  0.9%)  modernize-replace-auto-ptr
     144.2431 (  0.8%)     62.4504 (  1.0%)     206.6935 (  0.8%)     208.3795 (  0.8%)  modernize-deprecated-ios-base-aliases
     134.4497 (  0.7%)     65.1532 (  1.0%)     199.6029 (  0.8%)     204.9860 (  0.8%)  llvm-twine-local
     140.2568 (  0.8%)     51.4716 (  0.8%)     191.7285 (  0.8%)     199.4717 (  0.8%)  readability-non-const-parameter
     138.8445 (  0.8%)     51.1365 (  0.8%)     189.9810 (  0.8%)     193.9912 (  0.8%)  bugprone-suspicious-string-compare
     139.1127 (  0.8%)     46.2000 (  0.7%)     185.3127 (  0.8%)     187.6193 (  0.8%)  readability-uppercase-literal-suffix
     132.2334 (  0.7%)     48.5392 (  0.8%)     180.7726 (  0.7%)     183.8049 (  0.7%)  bugprone-sizeof-expression
     134.4028 (  0.7%)     45.8942 (  0.7%)     180.2971 (  0.7%)     181.3381 (  0.7%)  bugprone-implicit-widening-of-multiplication-result
     120.5073 (  0.7%)     44.7933 (  0.7%)     165.3006 (  0.7%)     168.1138 (  0.7%)  modernize-use-nullptr
     108.3158 (  0.6%)     51.6977 (  0.8%)     160.0134 (  0.7%)     164.9829 (  0.7%)  llvm-prefer-static-over-anonymous-namespace
     116.5443 (  0.6%)     43.3148 (  0.7%)     159.8591 (  0.7%)     162.0576 (  0.7%)  bugprone-optional-value-conversion
     107.2880 (  0.6%)     39.7731 (  0.6%)     147.0611 (  0.6%)     150.4240 (  0.6%)  readability-redundant-control-flow
     106.0311 (  0.6%)     38.6217 (  0.6%)     144.6529 (  0.6%)     146.6271 (  0.6%)  bugprone-infinite-loop
     100.2725 (  0.6%)     37.2599 (  0.6%)     137.5324 (  0.6%)     139.8270 (  0.6%)  bugprone-multiple-statement-macro
     100.0909 (  0.6%)     37.2428 (  0.6%)     137.3337 (  0.6%)     140.7783 (  0.6%)  bugprone-suspicious-semicolon
      97.7712 (  0.5%)     36.2448 (  0.6%)     134.0161 (  0.5%)     136.9142 (  0.6%)  bugprone-assert-side-effect
      87.7025 (  0.5%)     41.4545 (  0.7%)     129.1570 (  0.5%)     129.7289 (  0.5%)  misc-unused-alias-decls
      91.6513 (  0.5%)     32.3233 (  0.5%)     123.9746 (  0.5%)     125.9572 (  0.5%)  bugprone-inc-dec-in-conditions
      90.0758 (  0.5%)     32.3611 (  0.5%)     122.4369 (  0.5%)     125.6284 (  0.5%)  modernize-use-starts-ends-with
      78.6036 (  0.4%)     28.1597 (  0.4%)     106.7632 (  0.4%)     107.7710 (  0.4%)  bugprone-not-null-terminated-result
      77.7145 (  0.4%)     28.3128 (  0.4%)     106.0274 (  0.4%)     108.7961 (  0.4%)  bugprone-chained-comparison
      77.5710 (  0.4%)     28.0612 (  0.4%)     105.6322 (  0.4%)     107.1881 (  0.4%)  bugprone-unused-raii
      77.2441 (  0.4%)     27.4647 (  0.4%)     104.7088 (  0.4%)     106.3475 (  0.4%)  bugprone-dangling-handle
      74.9281 (  0.4%)     28.5803 (  0.5%)     103.5084 (  0.4%)     104.4719 (  0.4%)  readability-function-size
      72.7386 (  0.4%)     29.7547 (  0.5%)     102.4933 (  0.4%)     103.9331 (  0.4%)  modernize-redundant-void-arg
      73.7881 (  0.4%)     24.8424 (  0.4%)      98.6304 (  0.4%)      99.3209 (  0.4%)  performance-unnecessary-copy-initialization
      69.1588 (  0.4%)     21.7173 (  0.3%)      90.8761 (  0.4%)      91.2550 (  0.4%)  modernize-use-bool-literals
      59.1058 (  0.3%)     17.9275 (  0.3%)      77.0333 (  0.3%)      77.6519 (  0.3%)  bugprone-multiple-new-in-one-expression
      55.1500 (  0.3%)     21.7267 (  0.3%)      76.8767 (  0.3%)      77.3848 (  0.3%)  modernize-use-equals-default
      53.3965 (  0.3%)     21.4704 (  0.3%)      74.8669 (  0.3%)      75.4574 (  0.3%)  readability-redundant-access-specifiers
      49.1486 (  0.3%)     21.2680 (  0.3%)      70.4166 (  0.3%)      71.5446 (  0.3%)  modernize-use-noexcept
      50.1864 (  0.3%)     18.7956 (  0.3%)      68.9820 (  0.3%)      70.4616 (  0.3%)  bugprone-misplaced-widening-cast
      52.2086 (  0.3%)     16.2338 (  0.3%)      68.4424 (  0.3%)      68.8261 (  0.3%)  bugprone-swapped-arguments
      46.6692 (  0.3%)     17.9805 (  0.3%)      64.6497 (  0.3%)      65.4135 (  0.3%)  modernize-use-using
      39.3865 (  0.2%)     16.2249 (  0.3%)      55.6115 (  0.2%)      56.7646 (  0.2%)  readability-redundant-inline-specifier
      39.3940 (  0.2%)     16.1852 (  0.3%)      55.5792 (  0.2%)      55.8472 (  0.2%)  bugprone-signed-char-misuse
      34.8791 (  0.2%)     14.4551 (  0.2%)      49.3342 (  0.2%)      49.8039 (  0.2%)  bugprone-virtual-near-miss
      36.7021 (  0.2%)     10.4236 (  0.2%)      47.1257 (  0.2%)      47.5811 (  0.2%)  readability-redundant-smartptr-get
      32.7713 (  0.2%)     13.9465 (  0.2%)      46.7179 (  0.2%)      47.2929 (  0.2%)  readability-redundant-string-init
      32.5695 (  0.2%)     11.9329 (  0.2%)      44.5024 (  0.2%)      44.8963 (  0.2%)  readability-string-compare
      29.8861 (  0.2%)     12.6942 (  0.2%)      42.5803 (  0.2%)      42.8250 (  0.2%)  readability-reference-to-constructed-temporary
      32.1193 (  0.2%)      9.7905 (  0.2%)      41.9098 (  0.2%)      42.3365 (  0.2%)  bugprone-capturing-this-in-member-variable
      30.5946 (  0.2%)     11.1974 (  0.2%)      41.7920 (  0.2%)      42.1965 (  0.2%)  modernize-use-uncaught-exceptions
      29.4111 (  0.2%)     12.3307 (  0.2%)      41.7418 (  0.2%)      42.0365 (  0.2%)  bugprone-crtp-constructor-accessibility
      29.5917 (  0.2%)     10.0659 (  0.2%)      39.6576 (  0.2%)      39.9623 (  0.2%)  bugprone-argument-comment
      29.2552 (  0.2%)      9.7016 (  0.2%)      38.9568 (  0.2%)      39.0992 (  0.2%)  bugprone-return-const-ref-from-parameter
      28.1537 (  0.2%)      9.9377 (  0.2%)      38.0915 (  0.2%)      38.3482 (  0.2%)  bugprone-fold-init-type
      26.4408 (  0.1%)     10.6332 (  0.2%)      37.0740 (  0.2%)      37.6128 (  0.2%)  readability-make-member-function-const
      27.9317 (  0.2%)      8.8587 (  0.1%)      36.7904 (  0.2%)      37.1715 (  0.1%)  modernize-use-scoped-lock
      26.4108 (  0.1%)      8.7392 (  0.1%)      35.1500 (  0.1%)      35.3245 (  0.1%)  readability-redundant-string-cstr
      26.5708 (  0.1%)      8.4163 (  0.1%)      34.9871 (  0.1%)      35.3537 (  0.1%)  bugprone-forward-declaration-namespace
      24.3526 (  0.1%)     10.5863 (  0.2%)      34.9389 (  0.1%)      35.3497 (  0.1%)  misc-uniqueptr-reset-release
      25.9784 (  0.1%)      8.4738 (  0.1%)      34.4522 (  0.1%)      34.6924 (  0.1%)  modernize-use-emplace
      23.9433 (  0.1%)     10.1446 (  0.2%)      34.0879 (  0.1%)      34.4315 (  0.1%)  bugprone-unhandled-self-assignment
      23.6327 (  0.1%)      9.4061 (  0.1%)      33.0388 (  0.1%)      33.5344 (  0.1%)  readability-avoid-const-params-in-decls
      26.4126 (  0.1%)      5.4670 (  0.1%)      31.8795 (  0.1%)      32.1692 (  0.1%)  bugprone-throw-keyword-missing
      20.6387 (  0.1%)      8.7730 (  0.1%)      29.4117 (  0.1%)      29.6092 (  0.1%)  modernize-use-override
      22.1023 (  0.1%)      7.2470 (  0.1%)      29.3494 (  0.1%)      29.6926 (  0.1%)  bugprone-suspicious-memset-usage
      21.6630 (  0.1%)      7.6162 (  0.1%)      29.2793 (  0.1%)      29.7000 (  0.1%)  bugprone-misplaced-operator-in-strlen-in-alloc
      19.7646 (  0.1%)      8.5593 (  0.1%)      28.3239 (  0.1%)      29.0385 (  0.1%)  readability-const-return-type
      19.6767 (  0.1%)      7.3163 (  0.1%)      26.9930 (  0.1%)      27.2485 (  0.1%)  bugprone-incorrect-roundings
      20.6044 (  0.1%)      5.8634 (  0.1%)      26.4677 (  0.1%)      26.5998 (  0.1%)  modernize-make-shared
      18.4337 (  0.1%)      7.8495 (  0.1%)      26.2832 (  0.1%)      26.8429 (  0.1%)  bugprone-unused-local-non-trivial-variable
      18.4861 (  0.1%)      7.7051 (  0.1%)      26.1913 (  0.1%)      27.3047 (  0.1%)  modernize-use-equals-delete
      18.7699 (  0.1%)      6.9770 (  0.1%)      25.7469 (  0.1%)      25.9552 (  0.1%)  bugprone-unsafe-functions
      19.6176 (  0.1%)      5.6809 (  0.1%)      25.2985 (  0.1%)      25.7202 (  0.1%)  modernize-return-braced-init-list
      18.3483 (  0.1%)      6.9045 (  0.1%)      25.2528 (  0.1%)      25.5847 (  0.1%)  bugprone-non-zero-enum-to-bool-conversion
      18.3602 (  0.1%)      5.7379 (  0.1%)      24.0981 (  0.1%)      24.3626 (  0.1%)  readability-misleading-indentation
      16.7951 (  0.1%)      7.1430 (  0.1%)      23.9381 (  0.1%)      24.3282 (  0.1%)  readability-inconsistent-declaration-parameter-name
      17.4505 (  0.1%)      6.1945 (  0.1%)      23.6450 (  0.1%)      23.7766 (  0.1%)  bugprone-undefined-memory-manipulation
      21.7133 (  0.1%)      1.7670 (  0.0%)      23.4803 (  0.1%)      23.9318 (  0.1%)  modernize-loop-convert
      16.9237 (  0.1%)      6.2982 (  0.1%)      23.2219 (  0.1%)      23.7129 (  0.1%)  bugprone-multi-level-implicit-pointer-conversion
      16.2149 (  0.1%)      6.6264 (  0.1%)      22.8413 (  0.1%)      23.1313 (  0.1%)  bugprone-misleading-setter-of-reference
      15.4894 (  0.1%)      6.6633 (  0.1%)      22.1527 (  0.1%)      22.5065 (  0.1%)  bugprone-lambda-function-name
      16.4884 (  0.1%)      5.6105 (  0.1%)      22.0989 (  0.1%)      22.2493 (  0.1%)  bugprone-tagged-union-member-count
      15.8947 (  0.1%)      5.1520 (  0.1%)      21.0467 (  0.1%)      21.2492 (  0.1%)  modernize-min-max-use-initializer-list
      14.5901 (  0.1%)      5.1951 (  0.1%)      19.7853 (  0.1%)      20.0647 (  0.1%)  modernize-replace-random-shuffle
      14.5211 (  0.1%)      4.4871 (  0.1%)      19.0083 (  0.1%)      19.2258 (  0.1%)  bugprone-parent-virtual-call
      14.6786 (  0.1%)      3.9294 (  0.1%)      18.6081 (  0.1%)      18.7094 (  0.1%)  bugprone-spuriously-wake-up-functions
      13.9962 (  0.1%)      4.5084 (  0.1%)      18.5046 (  0.1%)      20.5715 (  0.1%)  performance-avoid-endl
      13.6965 (  0.1%)      4.4933 (  0.1%)      18.1898 (  0.1%)      18.3981 (  0.1%)  bugprone-undelegated-constructor
      13.2238 (  0.1%)      4.7066 (  0.1%)      17.9304 (  0.1%)      18.0526 (  0.1%)  bugprone-suspicious-memory-comparison
      13.2614 (  0.1%)      4.6438 (  0.1%)      17.9052 (  0.1%)      18.2747 (  0.1%)  bugprone-move-forwarding-reference
      13.0424 (  0.1%)      4.6563 (  0.1%)      17.6987 (  0.1%)      17.8726 (  0.1%)  modernize-avoid-bind
      12.0597 (  0.1%)      4.9246 (  0.1%)      16.9843 (  0.1%)      17.7955 (  0.1%)  bugprone-incorrect-enable-shared-from-this
      13.5394 (  0.1%)      2.4051 (  0.0%)      15.9445 (  0.1%)      16.2168 (  0.1%)  modernize-make-unique
      11.7474 (  0.1%)      3.9525 (  0.1%)      15.6998 (  0.1%)      16.2827 (  0.1%)  bugprone-nondeterministic-pointer-iteration-order
      10.5781 (  0.1%)      4.5165 (  0.1%)      15.0946 (  0.1%)      15.2983 (  0.1%)  bugprone-forwarding-reference-overload
      11.1552 (  0.1%)      3.9035 (  0.1%)      15.0587 (  0.1%)      15.5458 (  0.1%)  bugprone-bad-signal-to-kill-thread
      10.9076 (  0.1%)      3.6617 (  0.1%)      14.5693 (  0.1%)      14.7350 (  0.1%)  performance-inefficient-algorithm
      10.7657 (  0.1%)      3.7246 (  0.1%)      14.4903 (  0.1%)      14.6918 (  0.1%)  bugprone-posix-return
      11.3607 (  0.1%)      3.0708 (  0.0%)      14.4315 (  0.1%)      14.5441 (  0.1%)  readability-math-missing-parentheses
      10.2718 (  0.1%)      3.6651 (  0.1%)      13.9369 (  0.1%)      14.1714 (  0.1%)  bugprone-bitwise-pointer-cast
      12.8133 (  0.1%)      0.0269 (  0.0%)      12.8402 (  0.1%)      13.0821 (  0.1%)  modernize-deprecated-headers
       9.1128 (  0.1%)      2.9419 (  0.0%)      12.0547 (  0.0%)      12.1437 (  0.0%)  bugprone-suspicious-enum-usage
       8.8910 (  0.0%)      3.0873 (  0.0%)      11.9783 (  0.0%)      12.1396 (  0.0%)  bugprone-string-constructor
       8.6676 (  0.0%)      3.0120 (  0.0%)      11.6795 (  0.0%)      11.7570 (  0.0%)  performance-no-automatic-move
       7.7853 (  0.0%)      2.4979 (  0.0%)      10.2832 (  0.0%)      10.4792 (  0.0%)  readability-static-accessed-through-instance
       6.0213 (  0.0%)      2.6182 (  0.0%)       8.6395 (  0.0%)       8.7206 (  0.0%)  performance-move-constructor-init
       6.4076 (  0.0%)      2.2017 (  0.0%)       8.6093 (  0.0%)       8.7714 (  0.0%)  bugprone-pointer-arithmetic-on-polymorphic-object
       6.0634 (  0.0%)      2.3921 (  0.0%)       8.4555 (  0.0%)       8.6253 (  0.0%)  modernize-use-default-member-init
       6.2648 (  0.0%)      2.1860 (  0.0%)       8.4508 (  0.0%)       8.5035 (  0.0%)  readability-redundant-casting
       5.7153 (  0.0%)      2.7355 (  0.0%)       8.4507 (  0.0%)       8.5642 (  0.0%)  misc-misleading-bidirectional
       6.1525 (  0.0%)      2.1207 (  0.0%)       8.2732 (  0.0%)       8.3473 (  0.0%)  bugprone-misplaced-pointer-arithmetic-in-alloc
       5.9320 (  0.0%)      2.3401 (  0.0%)       8.2721 (  0.0%)       8.4114 (  0.0%)  readability-redundant-member-init
       6.2891 (  0.0%)      1.8899 (  0.0%)       8.1790 (  0.0%)       8.2069 (  0.0%)  bugprone-inaccurate-erase
       5.9291 (  0.0%)      1.9106 (  0.0%)       7.8397 (  0.0%)       7.8610 (  0.0%)  bugprone-bool-pointer-implicit-conversion
       5.7723 (  0.0%)      2.0114 (  0.0%)       7.7837 (  0.0%)       7.8442 (  0.0%)  bugprone-string-literal-with-embedded-nul
       5.0558 (  0.0%)      2.1841 (  0.0%)       7.2399 (  0.0%)       7.3284 (  0.0%)  bugprone-copy-constructor-init
       4.5001 (  0.0%)      2.0499 (  0.0%)       6.5499 (  0.0%)       6.7451 (  0.0%)  bugprone-incorrect-enable-if
       4.7537 (  0.0%)      1.4608 (  0.0%)       6.2145 (  0.0%)       6.3157 (  0.0%)  modernize-shrink-to-fit
       4.4881 (  0.0%)      1.4579 (  0.0%)       5.9460 (  0.0%)       6.0718 (  0.0%)  performance-faster-string-find
       4.3039 (  0.0%)      1.5959 (  0.0%)       5.8997 (  0.0%)       5.9274 (  0.0%)  modernize-raw-string-literal
       4.4139 (  0.0%)      1.4348 (  0.0%)       5.8487 (  0.0%)       6.0691 (  0.0%)  readability-ambiguous-smartptr-reset-call
       4.2243 (  0.0%)      1.4537 (  0.0%)       5.6780 (  0.0%)       5.8678 (  0.0%)  bugprone-integer-division
       4.1870 (  0.0%)      1.4623 (  0.0%)       5.6493 (  0.0%)       5.6977 (  0.0%)  bugprone-compare-pointer-to-member-virtual-function
       3.8752 (  0.0%)      1.3545 (  0.0%)       5.2297 (  0.0%)       5.2572 (  0.0%)  bugprone-suspicious-realloc-usage
       3.5878 (  0.0%)      1.2602 (  0.0%)       4.8481 (  0.0%)       4.8889 (  0.0%)  bugprone-shared-ptr-array-mismatch
       3.5918 (  0.0%)      1.2522 (  0.0%)       4.8439 (  0.0%)       4.8725 (  0.0%)  readability-redundant-function-ptr-dereference
       3.2016 (  0.0%)      1.1234 (  0.0%)       4.3250 (  0.0%)       4.3854 (  0.0%)  bugprone-unique-ptr-array-mismatch
       2.9130 (  0.0%)      1.1206 (  0.0%)       4.0335 (  0.0%)       4.0705 (  0.0%)  bugprone-casting-through-void
       2.6342 (  0.0%)      0.9195 (  0.0%)       3.5537 (  0.0%)       3.6063 (  0.0%)  readability-container-data-pointer
       2.1412 (  0.0%)      0.6505 (  0.0%)       2.7917 (  0.0%)       2.8705 (  0.0%)  readability-delete-null-pointer
       1.8297 (  0.0%)      0.5723 (  0.0%)       2.4020 (  0.0%)       2.4230 (  0.0%)  readability-use-std-min-max
       2.0068 (  0.0%)      0.3909 (  0.0%)       2.3978 (  0.0%)       2.4231 (  0.0%)  readability-enum-initial-value
       1.7164 (  0.0%)      0.5675 (  0.0%)       2.2839 (  0.0%)       2.2913 (  0.0%)  performance-inefficient-string-concatenation
       1.6757 (  0.0%)      0.5792 (  0.0%)       2.2549 (  0.0%)       2.2631 (  0.0%)  bugprone-sizeof-container
       1.5015 (  0.0%)      0.5775 (  0.0%)       2.0790 (  0.0%)       2.0934 (  0.0%)  modernize-unary-static-assert
       1.5159 (  0.0%)      0.4666 (  0.0%)       1.9825 (  0.0%)       2.0280 (  0.0%)  bugprone-redundant-branch-condition
       1.2099 (  0.0%)      0.5213 (  0.0%)       1.7311 (  0.0%)       1.7461 (  0.0%)  performance-trivially-destructible
       1.2716 (  0.0%)      0.3232 (  0.0%)       1.5948 (  0.0%)       1.6072 (  0.0%)  modernize-concat-nested-namespaces
       1.0545 (  0.0%)      0.3507 (  0.0%)       1.4052 (  0.0%)       1.4925 (  0.0%)  bugprone-string-integer-assignment
       0.9455 (  0.0%)      0.3136 (  0.0%)       1.2591 (  0.0%)       1.2870 (  0.0%)  bugprone-unintended-char-ostream-output
       0.6779 (  0.0%)      0.2457 (  0.0%)       0.9236 (  0.0%)       0.9280 (  0.0%)  bugprone-suspicious-missing-comma
       0.4345 (  0.0%)      0.1183 (  0.0%)       0.5528 (  0.0%)       0.5767 (  0.0%)  readability-simplify-subscript-expr
       0.3023 (  0.0%)      0.0988 (  0.0%)       0.4011 (  0.0%)       0.4028 (  0.0%)  bugprone-too-small-loop-variable
       0.2643 (  0.0%)      0.0890 (  0.0%)       0.3533 (  0.0%)       0.3539 (  0.0%)  readability-misplaced-array-index
       0.2670 (  0.0%)      0.0830 (  0.0%)       0.3500 (  0.0%)       0.3533 (  0.0%)  performance-inefficient-vector-operation
       0.1008 (  0.0%)      0.0242 (  0.0%)       0.1250 (  0.0%)       0.1252 (  0.0%)  readability-uniqueptr-delete-release
       0.0723 (  0.0%)      0.0211 (  0.0%)       0.0934 (  0.0%)       0.0934 (  0.0%)  performance-for-range-copy
       0.0659 (  0.0%)      0.0201 (  0.0%)       0.0860 (  0.0%)       0.0864 (  0.0%)  bugprone-terminating-continue
       0.0680 (  0.0%)      0.0177 (  0.0%)       0.0858 (  0.0%)       0.0861 (  0.0%)  performance-implicit-conversion-in-loop
       0.0541 (  0.0%)      0.0181 (  0.0%)       0.0722 (  0.0%)       0.0731 (  0.0%)  bugprone-switch-missing-default-case
       0.0130 (  0.0%)      0.0030 (  0.0%)       0.0160 (  0.0%)       0.0170 (  0.0%)  misc-throw-by-value-catch-by-reference
       0.0004 (  0.0%)      0.0000 (  0.0%)       0.0005 (  0.0%)       0.0005 (  0.0%)  bugprone-empty-catch
   18163.2080 (100.0%)   6324.1752 (100.0%)   24487.3832 (100.0%)   24799.3347 (100.0%)  Total

With patch:

===-------------------------------------------------------------------------===
                          clang-tidy checks profiling
===-------------------------------------------------------------------------===
  Total Execution Time: 14350.9109 seconds (14620.4821 wall clock)

     ---User Time---      --System Time--       --User+System--       ---Wall Time---    --- Name ---
    1636.1281 ( 14.6%)      5.2065 (  0.2%)    1641.3346 ( 11.4%)    1673.7107 ( 11.4%)  readability-identifier-naming
    1261.7204 ( 11.2%)    246.6323 (  7.9%)    1508.3527 ( 10.5%)    1537.5619 ( 10.5%)  misc-unconventional-assign-operator
     778.2031 (  6.9%)    350.4652 ( 11.2%)    1128.6683 (  7.9%)    1142.9793 (  7.8%)  misc-unused-using-decls
     403.4598 (  3.6%)    172.7319 (  5.5%)     576.1917 (  4.0%)     588.3824 (  4.0%)  llvm-prefer-isa-or-dyn-cast-in-conditionals
     436.9664 (  3.9%)    128.1873 (  4.1%)     565.1537 (  3.9%)     573.4947 (  3.9%)  misc-redundant-expression
     351.7317 (  3.1%)    152.4484 (  4.9%)     504.1801 (  3.5%)     516.5904 (  3.5%)  llvm-use-new-mlir-op-builder
     363.5850 (  3.2%)     68.0481 (  2.2%)     431.6331 (  3.0%)     439.0423 (  3.0%)  misc-static-assert
     253.6255 (  2.3%)    115.0100 (  3.7%)     368.6355 (  2.6%)     375.4275 (  2.6%)  misc-misleading-identifier
     249.5640 (  2.2%)    112.6589 (  3.6%)     362.2229 (  2.5%)     369.1099 (  2.5%)  misc-definitions-in-headers
     264.5492 (  2.4%)     74.4050 (  2.4%)     338.9543 (  2.4%)     342.6153 (  2.3%)  bugprone-use-after-move
     291.5185 (  2.6%)     46.1335 (  1.5%)     337.6520 (  2.4%)     343.2440 (  2.3%)  modernize-macro-to-enum
     238.2498 (  2.1%)     84.1317 (  2.7%)     322.3815 (  2.2%)     327.5137 (  2.2%)  misc-confusable-identifiers
     215.6190 (  1.9%)     97.5984 (  3.1%)     313.2174 (  2.2%)     319.7390 (  2.2%)  misc-non-copyable-objects
     263.6929 (  2.3%)      2.6387 (  0.1%)     266.3316 (  1.9%)     270.5380 (  1.9%)  bugprone-reserved-identifier
     200.6016 (  1.8%)     62.1167 (  2.0%)     262.7183 (  1.8%)     265.4603 (  1.8%)  bugprone-standalone-empty
     175.2217 (  1.6%)     64.2099 (  2.1%)     239.4316 (  1.7%)     242.9705 (  1.7%)  bugprone-stringview-nullptr
     165.1792 (  1.5%)     40.4204 (  1.3%)     205.5995 (  1.4%)     208.6505 (  1.4%)  readability-container-size-empty
     122.6938 (  1.1%)     55.8242 (  1.8%)     178.5180 (  1.2%)     182.6060 (  1.2%)  misc-misplaced-const
     112.5563 (  1.0%)     50.1951 (  1.6%)     162.7513 (  1.1%)     168.3551 (  1.2%)  misc-use-internal-linkage
     107.3324 (  1.0%)     39.8269 (  1.3%)     147.1592 (  1.0%)     151.6417 (  1.0%)  modernize-type-traits
     102.3166 (  0.9%)     33.6026 (  1.1%)     135.9192 (  0.9%)     137.5315 (  0.9%)  llvm-namespace-comment
      90.8168 (  0.8%)     41.1969 (  1.3%)     132.0137 (  0.9%)     134.6357 (  0.9%)  misc-new-delete-overloads
      92.6586 (  0.8%)     35.0088 (  1.1%)     127.6674 (  0.9%)     129.1964 (  0.9%)  llvm-else-after-return
      95.3694 (  0.8%)     29.8905 (  1.0%)     125.2599 (  0.9%)     127.2424 (  0.9%)  readability-uppercase-literal-suffix
      86.0855 (  0.8%)     34.4657 (  1.1%)     120.5511 (  0.8%)     122.5493 (  0.8%)  modernize-use-transparent-functors
      87.7022 (  0.8%)     29.8755 (  1.0%)     117.5777 (  0.8%)     122.8331 (  0.8%)  readability-non-const-parameter
      86.0909 (  0.8%)     29.5673 (  0.9%)     115.6582 (  0.8%)     118.7411 (  0.8%)  bugprone-suspicious-string-compare
      85.8652 (  0.8%)     26.9181 (  0.9%)     112.7833 (  0.8%)     113.9763 (  0.8%)  bugprone-implicit-widening-of-multiplication-result
      81.0573 (  0.7%)     27.7088 (  0.9%)     108.7661 (  0.8%)     111.1458 (  0.8%)  bugprone-sizeof-expression
      73.6292 (  0.7%)     29.1742 (  0.9%)     102.8034 (  0.7%)     106.1015 (  0.7%)  modernize-replace-auto-ptr
      70.5600 (  0.6%)     28.0448 (  0.9%)      98.6048 (  0.7%)     100.3638 (  0.7%)  modernize-deprecated-ios-base-aliases
      66.6560 (  0.6%)     30.2764 (  1.0%)      96.9324 (  0.7%)      98.3872 (  0.7%)  llvm-prefer-register-over-unsigned
      71.7215 (  0.6%)     24.6661 (  0.8%)      96.3876 (  0.7%)      98.5079 (  0.7%)  bugprone-optional-value-conversion
      70.6481 (  0.6%)     24.3593 (  0.8%)      95.0074 (  0.7%)      97.0608 (  0.7%)  modernize-use-nullptr
      67.4057 (  0.6%)     23.2345 (  0.7%)      90.6402 (  0.6%)      93.1496 (  0.6%)  readability-redundant-control-flow
      62.4119 (  0.6%)     21.2651 (  0.7%)      83.6770 (  0.6%)      85.2719 (  0.6%)  bugprone-infinite-loop
      57.0784 (  0.5%)     25.9546 (  0.8%)      83.0329 (  0.6%)      86.2327 (  0.6%)  llvm-twine-local
      60.4115 (  0.5%)     20.8768 (  0.7%)      81.2882 (  0.6%)      83.2560 (  0.6%)  bugprone-multiple-statement-macro
      61.3165 (  0.5%)     19.8500 (  0.6%)      81.1665 (  0.6%)      82.6712 (  0.6%)  bugprone-inc-dec-in-conditions
      60.1922 (  0.5%)     20.8167 (  0.7%)      81.0089 (  0.6%)      83.7285 (  0.6%)  bugprone-suspicious-semicolon
      59.1556 (  0.5%)     20.3554 (  0.7%)      79.5111 (  0.6%)      81.7000 (  0.6%)  bugprone-assert-side-effect
      54.2692 (  0.5%)     24.2298 (  0.8%)      78.4990 (  0.5%)      81.4663 (  0.6%)  llvm-prefer-static-over-anonymous-namespace
      57.4074 (  0.5%)     19.2064 (  0.6%)      76.6138 (  0.5%)      79.0293 (  0.5%)  modernize-use-starts-ends-with
      51.0435 (  0.5%)     16.5856 (  0.5%)      67.6291 (  0.5%)      68.4073 (  0.5%)  performance-unnecessary-copy-initialization
      50.8695 (  0.5%)     16.5302 (  0.5%)      67.3997 (  0.5%)      68.7756 (  0.5%)  bugprone-dangling-handle
      48.5181 (  0.4%)     16.8414 (  0.5%)      65.3595 (  0.5%)      66.0853 (  0.5%)  readability-function-size
      48.2374 (  0.4%)     16.2312 (  0.5%)      64.4686 (  0.4%)      65.7003 (  0.4%)  bugprone-unused-raii
      47.6440 (  0.4%)     16.0649 (  0.5%)      63.7089 (  0.4%)      65.7831 (  0.4%)  bugprone-chained-comparison
      46.9782 (  0.4%)     15.5737 (  0.5%)      62.5520 (  0.4%)      63.4025 (  0.4%)  bugprone-not-null-terminated-result
      44.7660 (  0.4%)     16.7490 (  0.5%)      61.5150 (  0.4%)      62.6117 (  0.4%)  modernize-redundant-void-arg
      46.0235 (  0.4%)     13.3668 (  0.4%)      59.3903 (  0.4%)      59.9375 (  0.4%)  modernize-use-bool-literals
      39.3017 (  0.4%)     17.5220 (  0.6%)      56.8237 (  0.4%)      57.5930 (  0.4%)  misc-unused-alias-decls
      40.4198 (  0.4%)     14.2106 (  0.5%)      54.6304 (  0.4%)      55.2604 (  0.4%)  llvm-qualified-auto
      39.5830 (  0.4%)     11.4748 (  0.4%)      51.0578 (  0.4%)      51.7312 (  0.4%)  bugprone-multiple-new-in-one-expression
      34.9078 (  0.3%)     12.8644 (  0.4%)      47.7722 (  0.3%)      48.4475 (  0.3%)  modernize-use-equals-default
      30.8230 (  0.3%)     10.6026 (  0.3%)      41.4256 (  0.3%)      42.3760 (  0.3%)  bugprone-misplaced-widening-cast
      32.3470 (  0.3%)      8.6457 (  0.3%)      40.9927 (  0.3%)      41.5110 (  0.3%)  readability-redundant-smartptr-get
      27.4482 (  0.2%)     10.9994 (  0.4%)      38.4476 (  0.3%)      39.5606 (  0.3%)  modernize-use-noexcept
      24.5813 (  0.2%)      9.4346 (  0.3%)      34.0160 (  0.2%)      34.4767 (  0.2%)  bugprone-virtual-near-miss
      25.9555 (  0.2%)      7.4797 (  0.2%)      33.4353 (  0.2%)      33.7978 (  0.2%)  bugprone-swapped-arguments
      22.8992 (  0.2%)      8.6520 (  0.3%)      31.5512 (  0.2%)      31.9583 (  0.2%)  bugprone-signed-char-misuse
      22.5585 (  0.2%)      8.5047 (  0.3%)      31.0632 (  0.2%)      31.9302 (  0.2%)  readability-redundant-inline-specifier
      23.7042 (  0.2%)      7.0245 (  0.2%)      30.7288 (  0.2%)      31.0431 (  0.2%)  modernize-use-scoped-lock
      22.1595 (  0.2%)      8.1467 (  0.3%)      30.3061 (  0.2%)      30.6318 (  0.2%)  readability-redundant-access-specifiers
      22.6853 (  0.2%)      7.2766 (  0.2%)      29.9620 (  0.2%)      30.2278 (  0.2%)  bugprone-argument-comment
      23.3010 (  0.2%)      6.4451 (  0.2%)      29.7460 (  0.2%)      30.1779 (  0.2%)  bugprone-capturing-this-in-member-variable
      22.0670 (  0.2%)      7.0265 (  0.2%)      29.0935 (  0.2%)      29.4030 (  0.2%)  bugprone-return-const-ref-from-parameter
      21.6111 (  0.2%)      6.8367 (  0.2%)      28.4478 (  0.2%)      28.6843 (  0.2%)  readability-redundant-string-cstr
      21.3638 (  0.2%)      6.5940 (  0.2%)      27.9578 (  0.2%)      28.2459 (  0.2%)  modernize-use-emplace
      19.7069 (  0.2%)      7.9504 (  0.3%)      27.6573 (  0.2%)      28.0303 (  0.2%)  bugprone-crtp-constructor-accessibility
      19.0512 (  0.2%)      7.1129 (  0.2%)      26.1641 (  0.2%)      26.6807 (  0.2%)  readability-make-member-function-const
      20.0441 (  0.2%)      5.5902 (  0.2%)      25.6344 (  0.2%)      26.0801 (  0.2%)  modernize-return-braced-init-list
      18.1326 (  0.2%)      7.4648 (  0.2%)      25.5974 (  0.2%)      26.2701 (  0.2%)  misc-uniqueptr-reset-release
      19.0810 (  0.2%)      6.5111 (  0.2%)      25.5921 (  0.2%)      26.0752 (  0.2%)  readability-string-compare
      18.3538 (  0.2%)      7.1846 (  0.2%)      25.5384 (  0.2%)      25.9779 (  0.2%)  readability-redundant-string-init
      18.0538 (  0.2%)      7.1125 (  0.2%)      25.1663 (  0.2%)      25.4127 (  0.2%)  readability-reference-to-constructed-temporary
      21.8732 (  0.2%)      1.5904 (  0.1%)      23.4636 (  0.2%)      23.7599 (  0.2%)  modernize-loop-convert
      17.4517 (  0.2%)      5.9695 (  0.2%)      23.4212 (  0.2%)      23.7943 (  0.2%)  modernize-use-uncaught-exceptions
      17.9995 (  0.2%)      4.8411 (  0.2%)      22.8406 (  0.2%)      23.0617 (  0.2%)  modernize-make-shared
      16.2629 (  0.1%)      5.9190 (  0.2%)      22.1819 (  0.2%)      22.5736 (  0.2%)  readability-avoid-const-params-in-decls
      16.5428 (  0.1%)      5.3898 (  0.2%)      21.9325 (  0.2%)      22.1339 (  0.2%)  bugprone-fold-init-type
      16.9393 (  0.2%)      4.2616 (  0.1%)      21.2009 (  0.1%)      21.5157 (  0.1%)  bugprone-throw-keyword-missing
      14.9002 (  0.1%)      5.9394 (  0.2%)      20.8396 (  0.1%)      21.1441 (  0.1%)  bugprone-unhandled-self-assignment
      14.9561 (  0.1%)      5.4008 (  0.2%)      20.3569 (  0.1%)      20.8580 (  0.1%)  modernize-use-using
      15.0212 (  0.1%)      4.5789 (  0.1%)      19.6001 (  0.1%)      19.9151 (  0.1%)  bugprone-suspicious-memset-usage
      15.0638 (  0.1%)      4.2288 (  0.1%)      19.2926 (  0.1%)      19.5795 (  0.1%)  bugprone-forward-declaration-namespace
      13.0326 (  0.1%)      5.2133 (  0.2%)      18.2459 (  0.1%)      18.5434 (  0.1%)  modernize-use-override
      13.5008 (  0.1%)      4.0318 (  0.1%)      17.5327 (  0.1%)      17.8497 (  0.1%)  readability-misleading-indentation
      12.9688 (  0.1%)      4.2196 (  0.1%)      17.1884 (  0.1%)      17.4861 (  0.1%)  bugprone-misplaced-operator-in-strlen-in-alloc
      12.7162 (  0.1%)      4.4512 (  0.1%)      17.1674 (  0.1%)      17.3587 (  0.1%)  bugprone-incorrect-roundings
      12.0264 (  0.1%)      4.6771 (  0.1%)      16.7035 (  0.1%)      17.4893 (  0.1%)  modernize-use-equals-delete
      11.8897 (  0.1%)      4.7541 (  0.2%)      16.6438 (  0.1%)      17.1543 (  0.1%)  readability-const-return-type
      11.5529 (  0.1%)      4.0636 (  0.1%)      15.6165 (  0.1%)      15.8675 (  0.1%)  bugprone-non-zero-enum-to-bool-conversion
      11.3064 (  0.1%)      4.2711 (  0.1%)      15.5775 (  0.1%)      15.7981 (  0.1%)  bugprone-misleading-setter-of-reference
      11.7290 (  0.1%)      3.3836 (  0.1%)      15.1127 (  0.1%)      15.4091 (  0.1%)  bugprone-parent-virtual-call
      11.0131 (  0.1%)      3.8548 (  0.1%)      14.8679 (  0.1%)      15.2811 (  0.1%)  bugprone-multi-level-implicit-pointer-conversion
      10.7367 (  0.1%)      3.7531 (  0.1%)      14.4899 (  0.1%)      14.6971 (  0.1%)  bugprone-unsafe-functions
      10.1546 (  0.1%)      3.9545 (  0.1%)      14.1091 (  0.1%)      14.4984 (  0.1%)  bugprone-unused-local-non-trivial-variable
      10.0921 (  0.1%)      3.9585 (  0.1%)      14.0506 (  0.1%)      14.4513 (  0.1%)  readability-inconsistent-declaration-parameter-name
      11.8787 (  0.1%)      1.9776 (  0.1%)      13.8563 (  0.1%)      14.1242 (  0.1%)  modernize-make-unique
      10.9104 (  0.1%)      2.8760 (  0.1%)      13.7864 (  0.1%)      13.9569 (  0.1%)  bugprone-spuriously-wake-up-functions
      10.5274 (  0.1%)      3.1451 (  0.1%)      13.6725 (  0.1%)      13.8131 (  0.1%)  modernize-min-max-use-initializer-list
      10.2774 (  0.1%)      3.3657 (  0.1%)      13.6430 (  0.1%)      13.7722 (  0.1%)  bugprone-undefined-memory-manipulation
       9.5967 (  0.1%)      3.8570 (  0.1%)      13.4536 (  0.1%)      13.8295 (  0.1%)  bugprone-lambda-function-name
      13.1263 (  0.1%)      0.0276 (  0.0%)      13.1538 (  0.1%)      13.3021 (  0.1%)  modernize-deprecated-headers
      10.0067 (  0.1%)      3.1240 (  0.1%)      13.1306 (  0.1%)      13.2881 (  0.1%)  bugprone-undelegated-constructor
       9.9228 (  0.1%)      2.7798 (  0.1%)      12.7026 (  0.1%)      12.8664 (  0.1%)  bugprone-tagged-union-member-count
       9.6769 (  0.1%)      2.8868 (  0.1%)      12.5637 (  0.1%)      13.9300 (  0.1%)  performance-avoid-endl
       9.0878 (  0.1%)      2.3576 (  0.1%)      11.4454 (  0.1%)      11.6878 (  0.1%)  readability-math-missing-parentheses
       8.3031 (  0.1%)      2.7388 (  0.1%)      11.0419 (  0.1%)      11.2531 (  0.1%)  modernize-replace-random-shuffle
       7.8275 (  0.1%)      2.5712 (  0.1%)      10.3987 (  0.1%)      10.5443 (  0.1%)  bugprone-suspicious-memory-comparison
       7.6199 (  0.1%)      2.5180 (  0.1%)      10.1379 (  0.1%)      10.3064 (  0.1%)  bugprone-posix-return
       7.6069 (  0.1%)      2.5014 (  0.1%)      10.1083 (  0.1%)      10.2922 (  0.1%)  modernize-avoid-bind
       7.6876 (  0.1%)      2.3903 (  0.1%)      10.0779 (  0.1%)      10.5077 (  0.1%)  bugprone-nondeterministic-pointer-iteration-order
       7.5070 (  0.1%)      2.5132 (  0.1%)      10.0203 (  0.1%)      10.1926 (  0.1%)  bugprone-string-constructor
       7.2418 (  0.1%)      2.4096 (  0.1%)       9.6514 (  0.1%)       9.7762 (  0.1%)  performance-no-automatic-move
       7.0478 (  0.1%)      2.1895 (  0.1%)       9.2374 (  0.1%)       9.3191 (  0.1%)  bugprone-suspicious-enum-usage
       7.0281 (  0.1%)      2.1781 (  0.1%)       9.2062 (  0.1%)       9.3349 (  0.1%)  performance-inefficient-algorithm
       6.4493 (  0.1%)      2.1125 (  0.1%)       8.5618 (  0.1%)       8.8479 (  0.1%)  bugprone-move-forwarding-reference
       6.4266 (  0.1%)      2.0639 (  0.1%)       8.4905 (  0.1%)       8.8709 (  0.1%)  bugprone-bad-signal-to-kill-thread
       6.3412 (  0.1%)      1.9566 (  0.1%)       8.2978 (  0.1%)       8.4622 (  0.1%)  readability-static-accessed-through-instance
       5.9272 (  0.1%)      1.9609 (  0.1%)       7.8881 (  0.1%)       8.0366 (  0.1%)  bugprone-bitwise-pointer-cast
       5.8201 (  0.1%)      1.6799 (  0.1%)       7.5000 (  0.1%)       7.6002 (  0.1%)  bugprone-inaccurate-erase
       5.3069 (  0.0%)      1.9485 (  0.1%)       7.2554 (  0.1%)       7.6205 (  0.1%)  bugprone-incorrect-enable-shared-from-this
       4.3714 (  0.0%)      1.4434 (  0.0%)       5.8148 (  0.0%)       5.9171 (  0.0%)  bugprone-misplaced-pointer-arithmetic-in-alloc
       4.3028 (  0.0%)      1.4453 (  0.0%)       5.7481 (  0.0%)       5.8035 (  0.0%)  bugprone-string-literal-with-embedded-nul
       4.2676 (  0.0%)      1.3715 (  0.0%)       5.6392 (  0.0%)       5.7110 (  0.0%)  bugprone-pointer-arithmetic-on-polymorphic-object
       4.2584 (  0.0%)      1.3772 (  0.0%)       5.6356 (  0.0%)       5.7019 (  0.0%)  readability-redundant-casting
       4.2664 (  0.0%)      1.3133 (  0.0%)       5.5798 (  0.0%)       5.6148 (  0.0%)  bugprone-bool-pointer-implicit-conversion
       4.2364 (  0.0%)      1.2466 (  0.0%)       5.4830 (  0.0%)       5.5545 (  0.0%)  modernize-shrink-to-fit
       3.8319 (  0.0%)      1.3766 (  0.0%)       5.2085 (  0.0%)       5.3237 (  0.0%)  readability-redundant-member-init
       3.7511 (  0.0%)      1.4268 (  0.0%)       5.1779 (  0.0%)       5.2510 (  0.0%)  bugprone-forwarding-reference-overload
       3.5513 (  0.0%)      1.2620 (  0.0%)       4.8132 (  0.0%)       4.8938 (  0.0%)  modernize-use-default-member-init
       3.6783 (  0.0%)      1.1296 (  0.0%)       4.8079 (  0.0%)       4.9569 (  0.0%)  performance-faster-string-find
       3.5901 (  0.0%)      1.1067 (  0.0%)       4.6968 (  0.0%)       4.8639 (  0.0%)  readability-ambiguous-smartptr-reset-call
       3.0066 (  0.0%)      1.0174 (  0.0%)       4.0241 (  0.0%)       4.0995 (  0.0%)  bugprone-shared-ptr-array-mismatch
       2.8421 (  0.0%)      1.1334 (  0.0%)       3.9755 (  0.0%)       4.0027 (  0.0%)  performance-move-constructor-init
       2.9572 (  0.0%)      0.9815 (  0.0%)       3.9386 (  0.0%)       4.0226 (  0.0%)  bugprone-compare-pointer-to-member-virtual-function
       2.6051 (  0.0%)      1.0287 (  0.0%)       3.6339 (  0.0%)       3.6755 (  0.0%)  bugprone-copy-constructor-init
       2.7157 (  0.0%)      0.9012 (  0.0%)       3.6169 (  0.0%)       3.7693 (  0.0%)  bugprone-integer-division
       2.6658 (  0.0%)      0.9009 (  0.0%)       3.5667 (  0.0%)       3.6281 (  0.0%)  bugprone-unique-ptr-array-mismatch
       2.6262 (  0.0%)      0.8845 (  0.0%)       3.5107 (  0.0%)       3.5901 (  0.0%)  bugprone-suspicious-realloc-usage
       2.3304 (  0.0%)      1.1120 (  0.0%)       3.4424 (  0.0%)       3.5060 (  0.0%)  misc-misleading-bidirectional
       1.9123 (  0.0%)      0.6224 (  0.0%)       2.5347 (  0.0%)       2.5710 (  0.0%)  readability-redundant-function-ptr-dereference
       1.9827 (  0.0%)      0.3907 (  0.0%)       2.3735 (  0.0%)       2.4103 (  0.0%)  readability-enum-initial-value
       1.7227 (  0.0%)      0.5959 (  0.0%)       2.3186 (  0.0%)       2.3486 (  0.0%)  bugprone-casting-through-void
       1.6035 (  0.0%)      0.4968 (  0.0%)       2.1003 (  0.0%)       2.1306 (  0.0%)  readability-container-data-pointer
       1.4558 (  0.0%)      0.4224 (  0.0%)       1.8782 (  0.0%)       1.9546 (  0.0%)  readability-delete-null-pointer
       1.1538 (  0.0%)      0.5024 (  0.0%)       1.6561 (  0.0%)       1.7108 (  0.0%)  bugprone-incorrect-enable-if
       1.2710 (  0.0%)      0.3817 (  0.0%)       1.6528 (  0.0%)       1.6839 (  0.0%)  readability-use-std-min-max
       1.1224 (  0.0%)      0.3940 (  0.0%)       1.5164 (  0.0%)       1.5339 (  0.0%)  bugprone-sizeof-container
       1.0843 (  0.0%)      0.4157 (  0.0%)       1.5000 (  0.0%)       1.5102 (  0.0%)  modernize-unary-static-assert
       1.1409 (  0.0%)      0.3195 (  0.0%)       1.4604 (  0.0%)       1.4727 (  0.0%)  modernize-concat-nested-namespaces
       1.0666 (  0.0%)      0.3473 (  0.0%)       1.4139 (  0.0%)       1.4276 (  0.0%)  modernize-raw-string-literal
       1.0594 (  0.0%)      0.3392 (  0.0%)       1.3986 (  0.0%)       1.4199 (  0.0%)  performance-inefficient-string-concatenation
       1.0271 (  0.0%)      0.3032 (  0.0%)       1.3304 (  0.0%)       1.3722 (  0.0%)  bugprone-redundant-branch-condition
       0.6820 (  0.0%)      0.2749 (  0.0%)       0.9569 (  0.0%)       0.9750 (  0.0%)  performance-trivially-destructible
       0.6664 (  0.0%)      0.2144 (  0.0%)       0.8808 (  0.0%)       0.9388 (  0.0%)  bugprone-string-integer-assignment
       0.5675 (  0.0%)      0.1826 (  0.0%)       0.7501 (  0.0%)       0.7929 (  0.0%)  bugprone-unintended-char-ostream-output
       0.3728 (  0.0%)      0.1015 (  0.0%)       0.4743 (  0.0%)       0.4840 (  0.0%)  readability-simplify-subscript-expr
       0.2944 (  0.0%)      0.0891 (  0.0%)       0.3834 (  0.0%)       0.3887 (  0.0%)  bugprone-suspicious-missing-comma
       0.2014 (  0.0%)      0.0669 (  0.0%)       0.2683 (  0.0%)       0.2694 (  0.0%)  readability-misplaced-array-index
       0.1528 (  0.0%)      0.0443 (  0.0%)       0.1971 (  0.0%)       0.1980 (  0.0%)  performance-inefficient-vector-operation
       0.1234 (  0.0%)      0.0373 (  0.0%)       0.1607 (  0.0%)       0.1609 (  0.0%)  bugprone-too-small-loop-variable
       0.0790 (  0.0%)      0.0190 (  0.0%)       0.0980 (  0.0%)       0.0984 (  0.0%)  performance-implicit-conversion-in-loop
       0.0750 (  0.0%)      0.0215 (  0.0%)       0.0966 (  0.0%)       0.0974 (  0.0%)  performance-for-range-copy
       0.0548 (  0.0%)      0.0168 (  0.0%)       0.0716 (  0.0%)       0.0717 (  0.0%)  bugprone-switch-missing-default-case
       0.0514 (  0.0%)      0.0140 (  0.0%)       0.0654 (  0.0%)       0.0655 (  0.0%)  bugprone-terminating-continue
       0.0381 (  0.0%)      0.0104 (  0.0%)       0.0484 (  0.0%)       0.0486 (  0.0%)  readability-uniqueptr-delete-release
       0.0059 (  0.0%)      0.0004 (  0.0%)       0.0064 (  0.0%)       0.0074 (  0.0%)  misc-throw-by-value-catch-by-reference
       0.0005 (  0.0%)      0.0000 (  0.0%)       0.0005 (  0.0%)       0.0005 (  0.0%)  bugprone-empty-catch
   11222.9492 (100.0%)   3127.9618 (100.0%)   14350.9109 (100.0%)   14620.4821 (100.0%)  Total

So we are having ~70% speedup overall.

@carlosgalvezp
Copy link
Contributor Author

@Xazax-hun @steakhal @AaronBallman Do you have any feedback on the changes to ASTMatchers?

Copy link
Collaborator

@Xazax-hun Xazax-hun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the design here around macros? Like what is the expected behavior for code expanded from macros defined in system header?

@carlosgalvezp
Copy link
Contributor Author

what is the expected behavior for code expanded from macros defined in system header?

As it is right now, we do not perform any expansion of the SourceLocation before checking if it is in a system header, so the behavior is that macros coming from system headers won't be analyzed. The rationale being that a user typically cannot change the contents of a system macro anyway.

If this is deemed too aggressive I can change it to perform the check on the expanded location instead. This would be consistent with the reverted patch as well as some checks that already do unless(isExpansionInSystemHeader).

@Xazax-hun
Copy link
Collaborator

The rationale being that a user typically cannot change the contents of a system macro anyway.

This is not always true, e.g., when it comes to macros with arguments. I am mostly interested in the scenario where someone has something like:

SYSTEM_HEADER_MACRO(UserCode); 

In one of the files we check. Would we still get warnings for UserCode?

Copy link
Contributor

@steakhal steakhal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The patch looks good. I had a couple of remarks though.
Thank you for working on this.

@carlosgalvezp
Copy link
Contributor Author

In one of the files we check. Would we still get warnings for UserCode?

Yes, we would. For example, a simple:

int x = 0;
assert(reinterpret_cast<int*>(x) == nullptr);

Triggers cppcoreguidelines-pro-type-reinterpret-cast for the use of reinterpret_cast, even if it's called inside a macro.

It's also my understanding that clang-tidy already filters out all system header diagnostics, before doing macro expansion:

https://github.com/llvm/llvm-project/blob/main/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp#L569

This commit is a re-do of e4a8969,
which got reverted, with the same goal: dramatically speed-up
clang-tidy by avoiding doing work in system headers (which is wasteful
as warnings are later discarded). This proposal was already discussed
here with favorable feedback:
llvm#132725

The novelty of this patch is:

- It's less aggressive: it does not fiddle with AST traversal. This
  solves the issue with the previous patch, which impacted the ability
  to inspect parents of a given node.

- Instead, what we optimize for is exitting early in each Traverse*
  function of MatchASTVisitor if the node is in a system header, thus
  avoiding calling the match() function with its corresponding callback
  (when there is a match).

- It does not cause any failing tests.

- It does not move MatchFinderOptions outside - instead we add
  a user-defined default constructor which solves the same problem.

- It introduces a function "shouldSkipNode" which can be extended
  for adding more conditions. For example there's a PR open about
  skipping modules in clang-tidy where this could come handy:
  llvm#145630

As a benchmark, I ran clang-tidy with all checks activated, on a single
.cpp file which #includes all the standard C++ headers, then measure
the time as well as found warnings.

On trunk:

Suppressed 213314 warnings (213314 in non-user code).

real	0m14.311s
user	0m14.126s
sys	0m0.185s

With this patch:

Suppressed 149399 warnings (149399 in non-user code).
real	0m3.583s
user	0m3.454s
sys	0m0.128s

With the original patch that got reverted:

Suppressed 8050 warnings (8050 in non-user code).
Runtime: around 1 second.

A lot of warnings remain and the runtime is sligthly higher, but we
still got a dramatic reduction with no change in functionality.

Further investigation has shown that all of the remaining warnings are
due to PPCallbacks - implementing a similar system-header exclusion
mechanism there can lead to almost no warnings left in system headers.
This does not bring the runtime down as much, though.

However this may not be as straightforward or wanted, it may even
need to be done on a per-check basis (there's about 10 checks or so
that would need to explicitly ignore system headers). I will leave that
for another patch, it's low priority and does not improve the runtime
much (it just prints better statistics).

Fixes llvm#52959
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang Clang issues not falling into any other category clang-tidy clang-tools-extra
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Option to not check included files in clang-tidy
8 participants