return *this;
}
+ const MachineInstrBuilder &setMemRefs(std::pair<MachineInstr::mmo_iterator,
+ unsigned> MemOperandsRef) const {
+ MI->setMemRefs(MemOperandsRef);
+ return *this;
+ }
const MachineInstrBuilder &addOperand(const MachineOperand &MO) const {
MI->addOperand(*MF, MO);
// Add a displacement from an existing MachineOperand with an added offset.
const MachineInstrBuilder &addDisp(const MachineOperand &Disp, int64_t off,
unsigned char TargetFlags = 0) const {
+ // If caller specifies new TargetFlags then use it, otherwise the
+ // default behavior is to copy the target flags from the existing
+ // MachineOperand. This means if the caller wants to clear the
+ // target flags it needs to do so explicitly.
+ if (0 == TargetFlags)
+ TargetFlags = Disp.getTargetFlags();
+
switch (Disp.getType()) {
default:
llvm_unreachable("Unhandled operand type in addDisp()");
case MachineOperand::MO_Immediate:
return addImm(Disp.getImm() + off);
- case MachineOperand::MO_GlobalAddress: {
- // If caller specifies new TargetFlags then use it, otherwise the
- // default behavior is to copy the target flags from the existing
- // MachineOperand. This means if the caller wants to clear the
- // target flags it needs to do so explicitly.
- if (TargetFlags)
- return addGlobalAddress(Disp.getGlobal(), Disp.getOffset() + off,
- TargetFlags);
+ case MachineOperand::MO_ConstantPoolIndex:
+ return addConstantPoolIndex(Disp.getIndex(), Disp.getOffset() + off,
+ TargetFlags);
+ case MachineOperand::MO_GlobalAddress:
return addGlobalAddress(Disp.getGlobal(), Disp.getOffset() + off,
- Disp.getTargetFlags());
- }
+ TargetFlags);
}
}
/// Copy all the implicit operands from OtherMI onto this one.
- const MachineInstrBuilder ©ImplicitOps(const MachineInstr *OtherMI) {
+ const MachineInstrBuilder &
+ copyImplicitOps(const MachineInstr *OtherMI) const {
MI->copyImplicitOps(*MF, OtherMI);
return *this;
}
const MCInstrDesc &MCID,
unsigned DestReg) {
if (I->isInsideBundle()) {
- MachineBasicBlock::instr_iterator MII = I;
+ MachineBasicBlock::instr_iterator MII(I);
return BuildMI(BB, MII, DL, MCID, DestReg);
}
DebugLoc DL,
const MCInstrDesc &MCID) {
if (I->isInsideBundle()) {
- MachineBasicBlock::instr_iterator MII = I;
+ MachineBasicBlock::instr_iterator MII(I);
return BuildMI(BB, MII, DL, MCID);
}
if (I == Begin) {
if (!empty())
MI->bundleWithSucc();
- Begin = MI;
+ Begin = MI->getIterator();
return *this;
}
if (I == End) {