Add an MF argument to MachineInstr::addOperand().
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Wed, 19 Dec 2012 19:19:01 +0000 (19:19 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Wed, 19 Dec 2012 19:19:01 +0000 (19:19 +0000)
commit35641e41eb2efd9d76c5b4d9243b825b1e00e00f
tree1cefb9699668f27f7efa79aaeed5d70fa00538f6
parenta1f8571e849eb935f27f61087a22d0295b079463
Add an MF argument to MachineInstr::addOperand().

Just like for addMemOperand(), the function pointer provides a context
for allocating memory. This will make it possible to use a better memory
allocation strategy for the MI operand list, which is currently a slow
std::vector.

Most calls to addOperand() come from MachineInstrBuilder, so give that
class an MF reference as well. Code using BuildMI() won't need changing
at all since the MF reference is already required to allocate a
MachineInstr.

Future patches will fix code that calls MI::addOperand(Op) directly, as
well as code that uses the now deprecated MachineInstrBuilder(MI)
constructor.

llvm-svn: 170574
llvm/include/llvm/CodeGen/MachineInstr.h
llvm/include/llvm/CodeGen/MachineInstrBuilder.h