summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlya Biryukov <ibiryukov@google.com>2017-12-21 14:05:28 +0000
committerIlya Biryukov <ibiryukov@google.com>2017-12-21 14:05:28 +0000
commit5b3e265710cf307d75e0d9a1af00fa3c6eed114e (patch)
tree33a44bf38c5b3c8ba0a753cf92497fddb1c9fd40
parent3dcb4d85f05d3fff0501d36c0c688534221ec953 (diff)
[clangd] Log more info about preambles
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@321267 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--clangd/ClangdUnit.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/clangd/ClangdUnit.cpp b/clangd/ClangdUnit.cpp
index b6bf3f75..5fa8cd33 100644
--- a/clangd/ClangdUnit.cpp
+++ b/clangd/ClangdUnit.cpp
@@ -513,10 +513,13 @@ CppFile::deferRebuild(StringRef NewContents,
ComputePreambleBounds(*CI->getLangOpts(), ContentsBuffer.get(), 0);
if (OldPreamble && OldPreamble->Preamble.CanReuse(
*CI, ContentsBuffer.get(), Bounds, VFS.get())) {
+ log(Ctx, "Reusing preamble for file " + Twine(That->FileName));
return OldPreamble;
}
- // We won't need the OldPreamble anymore, release it so it can be deleted
- // (if there are no other references to it).
+ log(Ctx, "Premble for file " + Twine(That->FileName) +
+ " cannot be reused. Attempting to rebuild it.");
+ // We won't need the OldPreamble anymore, release it so it can be
+ // deleted (if there are no other references to it).
OldPreamble.reset();
trace::Span Tracer(Ctx, "Preamble");
@@ -533,11 +536,16 @@ CppFile::deferRebuild(StringRef NewContents,
SerializedDeclsCollector);
if (BuiltPreamble) {
+ log(Ctx, "Built preamble of size " + Twine(BuiltPreamble->getSize()) +
+ " for file " + Twine(That->FileName));
+
return std::make_shared<PreambleData>(
std::move(*BuiltPreamble),
SerializedDeclsCollector.takeTopLevelDeclIDs(),
std::move(PreambleDiags));
} else {
+ log(Ctx,
+ "Could not build a preamble for file " + Twine(That->FileName));
return nullptr;
}
};