Access to Preprocessor macros

Dear all,

I created a clang plugin which is a class derived from ASTConsumer class. I use that plugin to move functions between files.
I would like to ask if there is a way to access preprocessor macros and includes at this AST level.

Thanks in advance.

You can get the Preprocessor object from the CompilerInstance available to the plugin, and make it available to your ASTConsumer instance.

See the Preprocessor class for more information on its APIs. Be forewarned that it’s APIs aren’t really targeted at higher level clients.

  • Daniel