[cfe-dev] get value of struct's member

Manuel Klimek klimek at google.com
Thu Mar 21 09:41:46 PDT 2013


On Thu, Mar 21, 2013 at 7:07 AM, huc1985 <huc1985 at 163.com> wrote:

> I'm using a RecursiveASTVisitor and implementing its VisitCallExpr()
> method.
> How can I get the value of struct's member?
>
> bool VisitCallExpr(CallExpr *expr)
> {
>     for (int i=0;i<expr->getNumArgs();i++)
>         {
>             Expr* ex = expr->getArg(i);
>             if (ex->getType()->isStructureType())
>             {
>                 //get the value of struct's member
>             }
>         }
> }
>
> Thanks!
>

I'm not sure I understand what you're asking - in general the value of a
variable (or member of a struct) is only known at runtime.

Cheers,
/Manuel


>
>
>
>
> --
> View this message in context:
> http://clang-developers.42468.n3.nabble.com/get-value-of-struct-s-member-tp4031074.html
> Sent from the Clang Developers mailing list archive at Nabble.com.
> _______________________________________________
> 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/20130321/af57b5ed/attachment.html>


More information about the cfe-dev mailing list