Skip to content

Commit e78165f

Browse files
committed
[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
1 parent 3d9653b commit e78165f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

clang-tools-extra/clangd/TidyProvider.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,14 @@ TidyProvider disableUnusableChecks(llvm::ArrayRef<std::string> ExtraBadChecks) {
212212
// code, which is often the case when clangd
213213
// tries to build an AST.
214214
"-bugprone-use-after-move",
215-
// Alias for bugprone-use-after-moe.
216-
"-hicpp-invalid-access-moved");
215+
// Alias for bugprone-use-after-move.
216+
"-hicpp-invalid-access-moved",
217+
218+
// ----- Performance problems -----
219+
220+
// This check runs expensive analysis for each variable.
221+
// It has been observed to increase reparse time by 10x.
222+
"-misc-const-correctness");
217223

218224
size_t Size = BadChecks.size();
219225
for (const std::string &Str : ExtraBadChecks) {

0 commit comments

Comments
 (0)