[cfe-dev] Finding Macro Argument Value

Richard Smith richard at metafoo.co.uk
Thu Jul 30 22:39:07 PDT 2015


On Thu, Jul 30, 2015 at 10:29 PM, Uri Mann <umann at symantec.com> wrote:

> I'm trying to find the value of an argument for function type macro.
> Example:
>
> #define DCLR_INT( x ) int x
> DCLR_INT( I ) = 5;
>
> I have a chained  PPCallbacks class which overrides
> PPCallbacks::MacroExpands(). Enumerating tokens for the MacroInfo class
> representing DCLR_INT allows me to see the token 'x'. How do I find the
> value of 'x' (i.e. 'i')?
>

That should be in the MacroArgs parameter to MacroExpands.


> Thanks in advance.
> -Uri
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150730/3bc71a1c/attachment.html>


More information about the cfe-dev mailing list