From cfe-dev Fri Jul 31 05:39:07 2015 From: Richard Smith Date: Fri, 31 Jul 2015 05:39:07 +0000 To: cfe-dev Subject: Re: [cfe-dev] Finding Macro Argument Value Message-Id: X-MARC-Message: https://marc.info/?l=cfe-dev&m=143832131327272 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============6115827784301821926==" --===============6115827784301821926== Content-Type: multipart/alternative; boundary=20cf30334c17193c80051c253df3 --20cf30334c17193c80051c253df3 Content-Type: text/plain; charset=UTF-8 On Thu, Jul 30, 2015 at 10:29 PM, Uri Mann 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@cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev > --20cf30334c17193c80051c253df3 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On T= hu, Jul 30, 2015 at 10:29 PM, Uri Mann <umann@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 ) =3D 5;

I have a chained=C2=A0 PPCallbacks class which overrides PPCallbacks::Macro= Expands(). Enumerating tokens for the MacroInfo class representing DCLR_INT= allows me to see the token 'x'. How do I find the value of 'x&= #39; (i.e. 'i')?

That should be= in the MacroArgs parameter to MacroExpands.
=C2=A0
Thanks in advance.
-Uri


_______________________________________________
cfe-dev mailing list
cfe-dev@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

--20cf30334c17193c80051c253df3-- --===============6115827784301821926== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ cfe-dev mailing list cfe-dev@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev --===============6115827784301821926==--