Use MachineInstrBuilder in a few CodeGen passes.

This automatically passes a context pointer to MI->addOperand().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170711 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jakob Stoklund Olesen
2012-12-20 18:08:06 +00:00
parent ffc7d3b0ad
commit 7b79b9862c
5 changed files with 12 additions and 18 deletions

View File

@ -315,8 +315,7 @@ public:
/// the specified predecessor block.
static void AddPHIOperand(MachineInstr *PHI, unsigned Val,
MachineBasicBlock *Pred) {
PHI->addOperand(MachineOperand::CreateReg(Val, false));
PHI->addOperand(MachineOperand::CreateMBB(Pred));
MachineInstrBuilder(*Pred->getParent(), PHI).addReg(Val).addMBB(Pred);
}
/// InstrIsPHI - Check if an instruction is a PHI.