Correct way to access Function ArgumentList?

Hey All,

I’m working with Mac OS X 10.10, and everything seems generally fine but when I started working on a FunctionPass I get the following:

error: call to deleted constructor of
‘Function::ArgumentListType’ (aka ‘iplistllvm::Argument’)
Function::ArgumentListType argList = f.getArgumentList();

Any pointers as to the correct way access the Arguments of a Function object? From what I saw on the docs it seems like this ought to work…

Thanks,

Jared

Jared Carlson <jared.carlson23@gmail.com> writes:

I’m working with Mac OS X 10.10, and everything seems generally fine but when
I started working on a FunctionPass I get the following:

error: call to deleted constructor of
      'Function::ArgumentListType' (aka 'iplist<llvm::Argument>')
  Function::ArgumentListType argList = f.getArgumentList();

Any pointers as to the correct way access the Arguments of a Function object?
From what I saw on the docs it seems like this ought to work...

The above tries to make a copy of the argument list, but the type
doesn't allow it. You probably want a reference instead:

    Function::ArgumentListType &argList = f.getArgumentList();

Thanks! Worked perfectly