Function Argument in LLVM


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?

::Saman Zonouz

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...