[PATCH] D52078: [clangd] Store preamble macros in dynamic index.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 18 07:15:33 PDT 2018


sammccall accepted this revision.
sammccall added a comment.

Something not listed in cons: because macros aren't namespaced and we don't have lots of signals, they can be really spammy. 
Potentially, offering macros that aren't in the TU could be a loss even if it's a win for other types of signals.

We could always e.g. postfilter index macro results using the include structure of the preamble, so no concern for this patch, just something to think about for the followup.

We also need to make sure that we're not indexing/serving header guards as code completions (e.g. if SemaCodeComplete is currently taking care of this)



================
Comment at: clangd/index/FileIndex.cpp:48
     CollectorOpts.RefFilter = RefKind::All;
+  }else {
+    IndexOpts.IndexMacrosInPreprocessor = true;
----------------
nit: please clang-format


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D52078





More information about the cfe-commits mailing list