[cfe-dev] Macro expansion with Clang

Alexander Basov coopht at gmail.com
Mon Oct 14 21:48:41 PDT 2013


Hello.
Could somebody help me with macro expansion?

I have a header with the following macroses defined:

#define foo(x) x + 2
#define A 1
#define B foo(A)

And I need get the following map:
A = 1
B = 3

How can I do it?

I'm ale to get list of MacroInfo * classes with PPCallbacks or get it with
Preprocessor::macro_begin() iterator, but I don't know how to get expaneded
value.

Thank you in advance.

-- 
Alexander
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20131015/9c1e3278/attachment.html>


More information about the cfe-dev mailing list