[clangd] Block clang-tidy misc-const-correctness check
authorSam McCall <sam.mccall@gmail.com>
Wed, 12 Oct 2022 23:43:49 +0000 (01:43 +0200)
committerSam McCall <sam.mccall@gmail.com>
Thu, 13 Oct 2022 10:07:31 +0000 (12:07 +0200)
This check performs an extremely large amount of work (for each variable, it
runs very many full matcher-driven traversals of the whole scope the variable
is defined in).

When (inadvertently) enabled for Fuchsia, it regressed BuildAST times by >10x
(400ms -> 7s on my machine).

Differential Revision: https://reviews.llvm.org/D135829

clang-tools-extra/clangd/TidyProvider.cpp

index 32a4d6a..a0a37e8 100644 (file)
@@ -212,8 +212,14 @@ TidyProvider disableUnusableChecks(llvm::ArrayRef<std::string> ExtraBadChecks) {
                        // code, which is often the case when clangd
                        // tries to build an AST.
                        "-bugprone-use-after-move",
-                       // Alias for bugprone-use-after-moe.
-                       "-hicpp-invalid-access-moved");
+                       // Alias for bugprone-use-after-move.
+                       "-hicpp-invalid-access-moved",
+
+                       // ----- Performance problems -----
+
+                       // This check runs expensive analysis for each variable.
+                       // It has been observed to increase reparse time by 10x.
+                       "-misc-const-correctness");
 
   size_t Size = BadChecks.size();
   for (const std::string &Str : ExtraBadChecks) {