[clang-tools-extra] e76e572 - [clangd] Dont include file version in task name

Kadir Cetinkaya via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 17 10:16:47 PST 2021


Author: Kadir Cetinkaya
Date: 2021-11-17T19:10:09+01:00
New Revision: e76e5729896c4a62f1f5ccbf784a59de96f74cbd

URL: https://github.com/llvm/llvm-project/commit/e76e5729896c4a62f1f5ccbf784a59de96f74cbd
DIFF: https://github.com/llvm/llvm-project/commit/e76e5729896c4a62f1f5ccbf784a59de96f74cbd.diff

LOG: [clangd] Dont include file version in task name

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

Added: 
    

Modified: 
    clang-tools-extra/clangd/TUScheduler.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/TUScheduler.cpp b/clang-tools-extra/clangd/TUScheduler.cpp
index e75867322cdc1..e87aa59ec6f5c 100644
--- a/clang-tools-extra/clangd/TUScheduler.cpp
+++ b/clang-tools-extra/clangd/TUScheduler.cpp
@@ -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});


        


More information about the cfe-commits mailing list