HighCommander4 wrote:

> your code path states `ParseTopLevelDecl`, but that 
> [call](https://searchfox.org/llvm/source/clang/lib/Parse/ParseAST.cpp#170) 
> should be over when we go into the indexing 
> [here](https://searchfox.org/llvm/source/clang/lib/Parse/ParseAST.cpp#174) ?

This is a loop that iterates once for every top-level decl. The instantiation 
happens in the call of `ParseTopLevelDecl` for the last iteration, which 
returns "eof" instead of an actual decl. With the background indexer, each 
iteration of the loop indexes the just-parsed top-level decl in 
`HandleTopLevelDecl`.

> But this still does not make it clear how we deal with this behaviour.

I think we may need to change the background indexer to work more like the 
dynamic indexer (parse entire TU up front, then index all decls).

https://github.com/llvm/llvm-project/pull/169742
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to