<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body><div>The simplest probably would be finding all relevant loop nodes, i.e. ForExpr-s, identifying the loop induction variable, i.e. the VarDecl-s (if any), and finally running a RecursiveASTVisitor on its body, looking for a DeclRefExpr referring to any of the VarDecl-s you identified in the previous step.<br></div>
<div> </div>
<div id="sig19426269"><div class="signature">-- <br></div>
<div class="signature">  Gábor Kozár -- ShdNx<br></div>
<div class="signature">  kozargabor@gmail.com<br></div>
<div class="signature"> </div>
</div>
<div> </div>
<div> </div>
<div>On Thu, Sep 26, 2013, at 15:00, Madhur Amilkanthwar wrote:<br></div>
<blockquote type="cite"><div dir="ltr"><div><div><div><div><div>Hi,<br></div>
<div>I am interested in knowing if an expression is derived from loop induction variable or not. As of now, I am able to inspect every expression after locating "if" statement in the code.

<br></div>
<div>Assume following code:<br></div>
</div>
<div>for(int i=0;i<32;i++)<br></div>
</div>
<div>  i=i+2;<br></div>
<div> </div>
</div>
<div>in above code, I am able to get access to the expression "i+2" but how should I analyze its LHS and RHS for induction variable?<br></div>
<div> </div>
</div>
<div>Any help appreciated. <br></div>
<div><div><div><div><div><div> </div>
<div>-- <br></div>
<div>Thank You.<br></div>
<div>Madhur D. Amilkanthwar<br></div>
<div>RISE lab,<br></div>
<div>IIT Madras.
<br></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div><u>_______________________________________________</u><br></div>
<div>cfe-dev mailing list<br></div>
<div><a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br></div>
<div><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br></div>
</blockquote></body>
</html>