ioeric added inline comments.

================
Comment at: clangd/index/FileIndex.cpp:37
+  std::vector<Decl *> TopLevelDecls(
+      AST.getTranslationUnitDecl()->decls().begin(),
+      AST.getTranslationUnitDecl()->decls().end());
----------------
ilya-biryukov wrote:
> ioeric wrote:
> > Would this give us decls in namespaces? It seems that 
> > `AST.getTranslationUnitDecl()->decls()` are only decls that are immediately 
> > inside the TU context. 
> I'll double check and add a test for that, but I think the indexer visits the 
> namespaces that we provide, I'm not sure if we have tests though.
Oh, right! In that case, it seems that a single TU decl which contains all 
interesting decls would be sufficient? Is it possible that preamble doesn't 
have all available top level decls in TU decl? This seems to be possible for 
ParsedAST, which is why we used `getTopLevelDecls`, I think?


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D47272



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

Reply via email to