[clangd] Improve long and confusing preamble log message.
authorSam McCall <sam.mccall@gmail.com>
Sat, 16 Nov 2019 16:11:54 +0000 (17:11 +0100)
committerSam McCall <sam.mccall@gmail.com>
Sat, 16 Nov 2019 16:13:02 +0000 (17:13 +0100)
clang-tools-extra/clangd/Preamble.cpp

index 41e3c13..eca545f 100644 (file)
@@ -102,10 +102,11 @@ buildPreamble(PathRef FileName, CompilerInvocation &CI,
       compileCommandsAreEqual(Inputs.CompileCommand, OldCompileCommand) &&
       OldPreamble->Preamble.CanReuse(CI, ContentsBuffer.get(), Bounds,
                                      Inputs.FS.get())) {
-    vlog("Reusing preamble for file {0}", llvm::Twine(FileName));
+    vlog("Reusing preamble for {0}", FileName);
     return OldPreamble;
   }
-  vlog("Preamble for file {0} cannot be reused. Attempting to rebuild it.",
+  vlog(OldPreamble ? "Rebuilding invalidated preamble for {0}"
+                   : "Building first preamble for {0}",
        FileName);
 
   trace::Span Tracer("BuildPreamble");