I am working on clang libtooling.
So far I am managed to get the macro where it is getting referred in the source file through visitDeclRefExpr(DeclRefExpr *DR)
But can I get a list of macros with its name and its expansion as string.
exampleprogram.c
#define abc ab
#define sum 0
int main()
{
int ab;
abc = abc + 0;
return 0;
}
can I get the output like the following
abc -- ab
sum -- 0
How can I achieve this output with clang libtooling. How can I implement with the clang libtooling?
Please let me know if solution is available for this problem.