================
@@ -101,6 +103,8 @@ class IndexASTConsumer final : public ASTConsumer {
   std::shared_ptr<IndexingContext> IndexCtx;
   std::shared_ptr<Preprocessor> PP;
   std::function<bool(const Decl *)> ShouldSkipFunctionBody;
+  bool DeferIndexingToEndOfTranslationUnit;
+  std::vector<DeclGroupRef> TopLevelDecls;
----------------
HighCommander4 wrote:

I don't think we need this. Instead, in `Initialize` we can save the 
`ASTContext*` to a field, and in `HandleTranslationUnit`, we can do:

```c++
for (auto *D : Context->getTranslationUnitDecl()->decls()) {
  IndexCtx->indexTopLevelDecl(D);
}
```

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