[cfe-dev] def-use chains and use-def chains
srikanth.vaindam at gmail.com
Fri Apr 20 06:00:20 PDT 2012
Hi Duncan Sands,
I frankly don't know what a variable gets converted to (SSA register or
memory chunk). What I meant is, for example
I1: int i, j=10; I2: scanf("%d", &j); I3: i = j + 1;
Here I want to know whether the value of j in I1 reaches I3 or not.
you didn't define what you mean by a variable. LLVM has virtual registers
are always in SSA form, and memory (such as created by an AllocaInst). By
"variable" do you mean an SSA register, or do you mean a chunk of memory?
On Thu, Apr 19, 2012 at 11:35 AM, srikanth vaindam <
srikanth.vaindam at gmail.com> wrote:
> 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).
> When I searched for its implementation I found Iterating over def-use &
> use-def chains<http://llvm.org/docs/ProgrammersManual.html#iterate_chains>.
> will this work for finding the places where a variable is reaching?
> 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?
> please give me any references or examples to understand more about
> Best Regards,
> Srikanth Vaindam
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-dev