<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hi;</p>
<p><br>
</p>
<p>There is no such thing as 'lhs' for <tt>VisitCallExpr</tt>.
Visiting a <tt>VisitCallExpr</tt> will give you access to
foo(42).</p>
<p>You need to visit <tt>BinaryOperator </tt>to get your hand on a
<tt>LHS. <br>
</tt></p>
<p><tt><br>
</tt></p>
<p><tt>David<br>
</tt></p>
<br>
<div class="moz-cite-prefix">On 22/08/2017 11:26, Marcel Schaible
via cfe-dev wrote:<br>
</div>
<blockquote type="cite"
cite="mid:bedcb254-b911-46d6-ea92-ed574100fa67@schaible-consulting.de">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<p>Hi,</p>
<p>in my source-to-source translation tool I try to get the
lefthandside of assignment in my VisitCallExpr:</p>
<p>Example:</p>
<p>lhs = foo(42);</p>
<p>I need to retrieve "lhs" and its associated type.</p>
<p>Any hint is welcome!</p>
<p>Marcel<br>
</p>
<p>My code snippet:</p>
<p><font face="Courier New, Courier, monospace"> bool
VisitCallExpr(CallExpr *CallExpression) {<br>
QualType q = CallExpression->getType();<br>
const Type *t = q.getTypePtrOrNull(); <br>
const Stmt* callExpression = CallExpression;</font></p>
<p><font face="Courier New, Courier, monospace">
FunctionDecl *func = CallExpression->getDirectCallee();</font></p>
<p><font face="Courier New, Courier, monospace"> ...<br>
</font></p>
<p><font face="Courier New, Courier, monospace"> // How to
retrieve "LHS" here and its type? <br>
</font></p>
<p><font face="Courier New, Courier, monospace"> ...<br>
</font></p>
<p><font face="Courier New, Courier, monospace"> return
true;<br>
}<br>
<br>
<br>
</font></p>
<p><font face="Courier New, Courier, monospace"><br>
</font></p>
<p><br>
</p>
<p><br>
</p>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
cfe-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a>
</pre>
</blockquote>
<br>
</body>
</html>