I want to write a Clang pass that let me do the following:
1. I have a list of names of macros of interest.
2. I want to get the final value of the macro that is included in the
IR after preprocessing. For example:
#if CLASS == 'A'
#define TOTAL_KEYS_LOG_2 23
#if CLASS == 'B'
#define TOTAL_KEYS_LOG_2 25
If in the above example, I compile using definition of CLASS as B, I
want to collect the value 25 for TOTAL_KEYS_LOG_2. Of course,
beforehand I know the name of the macro I am interested in
I have fairly used LLVM middle end but very new to the front end.
Thus any pointer will be greatly appreciated.
Thanks a lot;