Parse clang AST from `compile_commands.json` ignoring PCH
I’m trying to parse an AST of the whole project using a compilation database (compile_commands.json), but it contains pch files and commands related to generate those, resulting in errors during parsing:
error: PCH file uses a newer PCH format that cannot be read
1 error generated.
Handling Nested Macro Expansions in Clang LibTooling Application
I am developing a clang libTooling application that instruments (rewrites) C code. In order to prepare the code for the a RecursiveASTVisitor (where the final code is rewritten), I need to pre-expand all the macro invocations in the C code. I am facing challenges with handling nested macros and function-like macros where a parameter is also a macros (I think this could be considered nested macro variant).