[cfe-dev] RecursiveAstVisitor: How to get the LHS and its type of an assigment inside a VistCallExpr?

Marcel Schaible via cfe-dev cfe-dev at lists.llvm.org
Tue Aug 22 02:26:53 PDT 2017


Hi,

in my source-to-source translation tool I try to get the lefthandside of 
assignment in my VisitCallExpr:

Example:

lhs = foo(42);

I need to retrieve "lhs" and its associated type.

Any hint is welcome!

Marcel

My code snippet:

     bool VisitCallExpr(CallExpr *CallExpression) {
         QualType q = CallExpression->getType();
         const Type *t = q.getTypePtrOrNull();
         const Stmt* callExpression = CallExpression;

         FunctionDecl *func = CallExpression->getDirectCallee();

         ...

         // How to retrieve "LHS" here and its type?

         ...

         return true;
     }





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170822/cb337f24/attachment.html>


More information about the cfe-dev mailing list