diff options
author | Ilya Biryukov <ibiryukov@google.com> | 2017-12-21 14:05:28 +0000 |
---|---|---|
committer | Ilya Biryukov <ibiryukov@google.com> | 2017-12-21 14:05:28 +0000 |
commit | 199a5071efecbf9e71d53a505746fd33e125f458 (patch) | |
tree | b4e81e553db411ec52b089e7880586a30aad49a5 /clang-tools-extra/clangd/ClangdUnit.cpp | |
parent | 8fd007255f10a11f51a49e088a492f020574a225 (diff) |
[clangd] Log more info about preambles
Diffstat (limited to 'clang-tools-extra/clangd/ClangdUnit.cpp')
-rw-r--r-- | clang-tools-extra/clangd/ClangdUnit.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/clang-tools-extra/clangd/ClangdUnit.cpp b/clang-tools-extra/clangd/ClangdUnit.cpp index b6bf3f75eaa..5fa8cd33a9b 100644 --- a/clang-tools-extra/clangd/ClangdUnit.cpp +++ b/clang-tools-extra/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; } }; |