[LLVMdev] Question about function arguments
hm2474 at columbia.edu
Thu Jul 22 00:17:13 PDT 2010
Thanks for the clarification. My doubt is to know how I can extract the
values contained in the arguments from LLVM IR.
On Thu, Jul 22, 2010 at 2:28 AM, Duncan Sands <baldrick at free.fr> wrote:
> Hi Hemanth,
> > I was wondering how I could determine the values of function arguments
> > using the iterators defined in Function.cpp.
> are you sure you aren't confusing values and names? In something like
> int foo(int a, int b)
> there are names "a" and "b". To make it easier for humans to read LLVM
> IR, most front-ends will use the same names for the function arguments
> in the LLVM IR. But names are entirely optional, and everything works
> fine if all function arguments are nameless. So in general you can't hope
> to extract "a" and "b" from the LLVM IR.
> What do you want the names for? They aren't needed to use and manipulate
> > This piece of code works if 'module' contains the definition of function
> > foo. Otherwise, I just get blanks even though the number returned by
> > arg_size() is two.
> No names :)
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev