[clangd] Dont include file version in task name
authorKadir Cetinkaya <kadircet@google.com>
Mon, 8 Nov 2021 10:16:28 +0000 (11:16 +0100)
committerKadir Cetinkaya <kadircet@google.com>
Wed, 17 Nov 2021 18:10:09 +0000 (19:10 +0100)
This will drop file version information from span names, reducing
overall cardinality and also effect logging when skipping actions in scheduler.

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

clang-tools-extra/clangd/TUScheduler.cpp

index e758673..e87aa59 100644 (file)
@@ -992,7 +992,7 @@ void ASTWorker::updatePreamble(std::unique_ptr<CompilerInvocation> CI,
                                std::shared_ptr<const PreambleData> Preamble,
                                std::vector<Diag> CIDiags,
                                WantDiagnostics WantDiags) {
-  std::string TaskName = llvm::formatv("Build AST for ({0})", PI.Version);
+  llvm::StringLiteral TaskName = "Build AST";
   // Store preamble and build diagnostics with new preamble if requested.
   auto Task = [this, Preamble = std::move(Preamble), CI = std::move(CI),
                PI = std::move(PI), CIDiags = std::move(CIDiags),
@@ -1032,7 +1032,7 @@ void ASTWorker::updatePreamble(std::unique_ptr<CompilerInvocation> CI,
   }
   {
     std::lock_guard<std::mutex> Lock(Mutex);
-    PreambleRequests.push_back({std::move(Task), std::move(TaskName),
+    PreambleRequests.push_back({std::move(Task), std::string(TaskName),
                                 steady_clock::now(), Context::current().clone(),
                                 llvm::None, llvm::None,
                                 TUScheduler::NoInvalidation, nullptr});