[PATCH] D58239: [clangd] Cache include fixes for diagnostics caused by the same unresolved name or incomplete type.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 18 04:17:55 PST 2019


sammccall accepted this revision.
sammccall added a comment.
This revision is now accepted and ready to land.

SymbolSlab is much cleaner, nice!



================
Comment at: clangd/IncludeFixer.cpp:122
 
-  if (!Matched || Matched->IncludeHeaders.empty() || !Matched->Definition ||
-      Matched->CanonicalDeclaration.FileURI != Matched->Definition.FileURI)
+  auto I = LookupCache.find(*ID);
+  if (I != LookupCache.end())
----------------
extract  a function that maps `SymbolID -> const SymbolSlab&` and takes care of the caching?
(likewise for fuzzyfind)


================
Comment at: clangd/IncludeFixer.h:87
+  // copy-and-pasted without #includes. We cache the index results based on
+  // index requests (assuming index results are consistent during the single AST
+  // parse).
----------------
nit: maybe drop the parenthetical here? I think it's more confusing than enlightening.

("assuming" can mean either "and we assume" or "if" in this context. Also it's not clear there's a better behavior even if results did change and queries are free.)


Repository:
  rCTE Clang Tools Extra

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58239/new/

https://reviews.llvm.org/D58239





More information about the cfe-commits mailing list