Skip to content

Commit

Permalink
Do not assert when trying to add a meta data operand with
Browse files Browse the repository at this point in the history
MachineInstr::addOperand().



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192707 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
pjaaskel committed Oct 15, 2013
1 parent 62e87cb commit 8623851
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/CodeGen/MachineInstr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -647,11 +647,12 @@ void MachineInstr::addOperand(MachineFunction &MF, const MachineOperand &Op) {
}
}

bool isMetaDataOp = Op.getType() == MachineOperand::MO_Metadata;
// OpNo now points as the desired insertion point. Unless this is a variadic
// instruction, only implicit regs are allowed beyond MCID->getNumOperands().
// RegMask operands go between the explicit and implicit operands.
assert((isImpReg || Op.isRegMask() || MCID->isVariadic() ||
OpNo < MCID->getNumOperands()) &&
OpNo < MCID->getNumOperands() || isMetaDataOp) &&
"Trying to add an operand to a machine instr that is already done!");

MachineRegisterInfo *MRI = getRegInfo();
Expand Down

0 comments on commit 8623851

Please sign in to comment.