hokein added inline comments.
Herald added a subscriber: kadircet.

================
Comment at: clangd/index/FileIndex.h:70
+  void
+  update(PathRef Path, ASTContext *AST, std::shared_ptr<Preprocessor> PP,
+         llvm::Optional<llvm::ArrayRef<Decl *>> TopLevelDecls = llvm::None);
----------------
Any strong reason to unify the interface (and `indexAST`)? 

It seems to me that we do different things on `PreambleAST` and `MainAST`:

- on `PreambleAST`, we only index `Symbols` for code completion.
- on `MainAST`, we index `Symbols` (to collect other information missing from 
`PreambleAST`, e.g. definition location), and collect symbol references.

Therefore, we'd need to set different options for `SymbolCollector` 
accordingly. Having a single interface would make the implementation tricky 
(checking `TopLevelDecls` to see whether this is a `PreambleASt`).  


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D50889



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to