summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam McCall <sam.mccall@gmail.com>2022-10-13 01:43:49 +0200
committerTobias Hieta <tobias@hieta.se>2022-10-18 08:29:39 +0200
commitf6af95770615c2218084c82c62c10459feebbfbf (patch)
tree7eed7b71c11fefc4e885388fc5b8d28c7287322c
parent687250913265a0160c8fba2c0bd93ddd933ec9c2 (diff)
downloadllvm-f6af95770615c2218084c82c62c10459feebbfbf.tar.gz
[clangd] Block clang-tidy misc-const-correctness check
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 (cherry picked from commit e78165f0ba1e2fbf72b36a36c8560645b69a168a)
-rw-r--r--clang-tools-extra/clangd/TidyProvider.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/clang-tools-extra/clangd/TidyProvider.cpp b/clang-tools-extra/clangd/TidyProvider.cpp
index 32a4d6a30653..a0a37e86ba01 100644
--- a/clang-tools-extra/clangd/TidyProvider.cpp
+++ b/clang-tools-extra/clangd/TidyProvider.cpp
@@ -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) {