forked from OSchip/llvm-project
[clangd] Move IncludeCleaner tracer to the actual computation
This way we won't get results with 0 ms for all the users with disabled IncludeCleaner.
This commit is contained in:
parent
c2fe2b5a63
commit
59e4a67081
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue