<font class="Apple-style-span" face="arial, helvetica, sans-serif">Hi <span class="Apple-style-span" style="white-space:pre-wrap">Duncan Sands,</span></font><div><font class="Apple-style-span" face="arial, helvetica, sans-serif"><span class="Apple-style-span" style="white-space:pre-wrap">I frankly don't know what a variable gets converted to (SSA register or memory chunk). What I meant is, for example</span></font></div>
<div><font class="Apple-style-span" face="arial, helvetica, sans-serif"><span class="Apple-style-span" style="white-space:pre-wrap"><br></span></font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif"><span class="Apple-style-span" style="white-space:pre-wrap">    I1:     int i, j=10;
        I2:     scanf("%d", &j);
        I3:     i = j + 1;</span></font></div><div><div><br></div><div>Here I want to know whether the value of j in I1 reaches I3 or not.</div><div><br></div><div><br></div>Best Regards,<div>Srikanth Vaindam</div><br><span class="Apple-style-span" style="font-family:fixed-width,monospace;font-size:12px;background-color:rgb(255,255,255)"><br>
</span></div><div><span class="Apple-style-span" style="font-family:fixed-width,monospace;font-size:12px;background-color:rgb(255,255,255)">you didn't define what you mean by a variable.  LLVM has virtual registers which </span><br style="font-family:fixed-width,monospace;font-size:12px;background-color:rgb(255,255,255)">
<span class="Apple-style-span" style="font-family:fixed-width,monospace;font-size:12px;background-color:rgb(255,255,255)">are always in SSA form, and memory (such as created by an AllocaInst).  By a </span><br style="font-family:fixed-width,monospace;font-size:12px;background-color:rgb(255,255,255)">
<span class="Apple-style-span" style="font-family:fixed-width,monospace;font-size:12px;background-color:rgb(255,255,255)">"variable" do you mean an SSA register, or do you mean a chunk of memory? </span><br style="font-family:fixed-width,monospace;font-size:12px;background-color:rgb(255,255,255)">
<p style="font-family:fixed-width,monospace;font-size:12px;background-color:rgb(255,255,255)">Ciao, Duncan. </p>
<br>On Thu, Apr 19, 2012 at 11:35 AM, srikanth vaindam <span dir="ltr"><<a href="mailto:srikanth.vaindam@gmail.com">srikanth.vaindam@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<div>I need to find out all the places where the value of a variable is being used. For this I have to implement reaching definitions(def-use chains).</div><div>When I searched for its implementation I found <a href="http://llvm.org/docs/ProgrammersManual.html#iterate_chains" target="_blank">Iterating over def-use & use-def chains</a>. will this work for finding the places where a variable is reaching?</div>


<div><br></div><div>I tried to use "use_iterator", but couldn't make it out. Is it a must to write LLVM Pass to use op_iterator and use_iterator?</div><div>please give me any references or examples to understand more about use_iterator.</div>


<div><br></div><div><div><br></div>Best Regards,<div>Srikanth Vaindam</div><br><br>
</div>
</blockquote></div><br></div>