Keeping AST data for includes

Hello, cfe-dev!

While processing big source code trees with ASTFrontendAction and custom
ASTConsumer, same include files are getting hit and parsed all over and
over again.
Is there any technique (except precompiled header) to prevent such
actions? Like keeping header-related AST data and referencing it within
next files' AST?


That's what precompiled headers do.

If you want each header to have an independent, stored AST, then you're in trouble, since every #include can affect every #include that follows it, and the dependencies between those #includes are very fine-grained.

  - Doug

Hi Douglas!

No, it isn't. You'd still have to manage dependencies:

struct Foo { };

#include "a.h"

#define Foo Bar
#include "a.h"

  - Doug