[LLVMdev] Function Argument in LLVM

Bill Wendling isanbard at gmail.com
Fri Jul 17 10:50:30 PDT 2009


On Fri, Jul 17, 2009 at 6:02 AM, Saman Zonouz<samy_442 at yahoo.com> wrote:
> Hi,
>
> I am new to LLVM, and want to get the name of each argument for a given
> Function in a .bc file.
> Function.Argument.getName() returns "". Could somebody please help me figure
> this out?
>
This is untested, but maybe something like this:

for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end();
       I != E; ++I) {
  std::string &Name = I->getName();
  // Do with it what you will...
}

-bw



More information about the llvm-dev mailing list