<div dir="ltr">Ohk..this looks cool. Let me try that. Thanks.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Sep 26, 2013 at 6:37 PM, Gabor Kozar <span dir="ltr"><<a href="mailto:kozargabor@gmail.com" target="_blank">kozargabor@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>




<div><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><div>-- <br></div>
<div>  Gábor Kozár -- ShdNx<br></div>
<div>  <a href="mailto:kozargabor@gmail.com" target="_blank">kozargabor@gmail.com</a><br></div>
<div> </div>
</div><div><div class="h5">
<div> </div>
<div> </div>
<div>On Thu, Sep 26, 2013, at 15:00, Madhur Amilkanthwar wrote:<br></div>
</div></div><blockquote type="cite"><div><div class="h5"><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></div><div><u>_______________________________________________</u><br></div>
<div>cfe-dev mailing list<br></div>
<div><a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a><br></div>
<div><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br></div>
</blockquote></div>

<br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Thank You.<br>Madhur D. Amilkanthwar<br>RISE lab,<br>IIT Madras.<br>
</div>