[PATCH] D43550: [clangd] Not collect include headers for dynamic index for now.

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 21 03:17:17 PST 2018


ilya-biryukov added a comment.

Is there a way to still enable include insertion but in a restricted manner, e.g. only for the current project?
File of canonical declaration is usually a pretty good guess and it would be nice to have it. Maybe we could allowing to disable the include insertion via a flag or config parameter rather than disabling it for dynamic index entirely.

It bugs me that internal STL headers are added all the time, but it also lets me test the feature without building the static index. I find the second more valuable, given that we're still actively working on it.



================
Comment at: clangd/index/FileIndex.cpp:18
 
-const CanonicalIncludes *canonicalIncludesForSystemHeaders() {
-  static const auto *Includes = [] {
----------------
Should we also remove the mutex from `CanonicalIncludes` now?


================
Comment at: clangd/index/SymbolCollector.cpp:172
+
+  auto U = toURI(SM, SM.getFilename(Loc), Opts);
+  if (!U)
----------------
Maybe simplify to `return toURI(...)`?
Or is there a reason why it doesn't work?


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D43550





More information about the cfe-commits mailing list