Hi Duncan,<div><br></div><div>Thanks for the clarification. My doubt is to know how I can extract the values contained in the arguments from LLVM IR.</div><div><br></div><div>Thanks,</div><div>Hemanth<br><br><div class="gmail_quote">
On Thu, Jul 22, 2010 at 2:28 AM, Duncan Sands <span dir="ltr"><<a href="mailto:baldrick@free.fr">baldrick@free.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi Hemanth,<br>
<div class="im"><br>
> I was wondering how I could determine the values of function arguments<br>
> using the iterators defined in Function.cpp.<br>
<br>
</div>are you sure you aren't confusing values and names?  In something like<br>
this<br>
<div class="im">   int foo(int a, int b)<br>
</div>there are names "a" and "b".  To make it easier for humans to read LLVM<br>
IR, most front-ends will use the same names for the function arguments<br>
in the LLVM IR.  But names are entirely optional, and everything works<br>
fine if all function arguments are nameless.  So in general you can't hope<br>
to extract "a" and "b" from the LLVM IR.<br>
<br>
What do you want the names for?  They aren't needed to use and manipulate<br>
arguments.<br>
<div class="im"><br>
> This piece of code works if 'module' contains the definition of function<br>
> foo. Otherwise, I just get blanks even though the number returned by<br>
> arg_size() is two.<br>
<br>
</div>No names :)<br>
<br>
Ciao,<br>
<br>
Duncan.<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</blockquote></div><br><br clear="all"><br>-- <br><br>Cheers,<br>Hemanth<br>
</div>