Skip to content

Commit

Permalink
[clangd] Move IncludeCleaner tracer to the actual computation
Browse files Browse the repository at this point in the history
This way we won't get results with 0 ms for all the users with disabled
IncludeCleaner.
  • Loading branch information
kirillbobyrev committed Nov 25, 2021
1 parent c2fe2b5 commit 59e4a67
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clang-tools-extra/clangd/IncludeCleaner.cpp
Expand Up @@ -317,12 +317,12 @@ std::vector<const Inclusion *> computeUnusedIncludes(ParsedAST &AST) {

std::vector<Diag> issueUnusedIncludesDiagnostics(ParsedAST &AST,
llvm::StringRef Code) {
trace::Span Tracer("IncludeCleaner::issueUnusedIncludesDiagnostics");
const Config &Cfg = Config::current();
if (Cfg.Diagnostics.UnusedIncludes != Config::UnusedIncludesPolicy::Strict ||
Cfg.Diagnostics.SuppressAll ||
Cfg.Diagnostics.Suppress.contains("unused-includes"))
return {};
trace::Span Tracer("IncludeCleaner::issueUnusedIncludesDiagnostics");
std::vector<Diag> Result;
std::string FileName =
AST.getSourceManager()
Expand Down

0 comments on commit 59e4a67

Please sign in to comment.