Hi all,
Suppose we have created a ClangTool in libtooling.
Is there a way to record ASTContexts (say, in the consumer), and access them after clangTool.run(…)?
For example:
std::vector<ASTContext*> contexts;
int main(int argc, char **argv) {
CommonOptionsParser OptionsParser(argc, argv, MyToolCategory);
ClangTool Tool(OptionsParser.getCompilations(),
OptionsParser.getSourcePathList());
Tool.run(newFrontendActionFactory().get());
// I want to access contexts[i] here and possibly use the rewriter.
}
Any help is appreciated.