forked from OSchip/llvm-project
parent
ea831ee11c
commit
9356d8f74d
|
@ -406,6 +406,8 @@ void MachineInstr::addOperand(const MachineOperand &Op) {
|
||||||
assert((isImpReg || !OperandsComplete()) &&
|
assert((isImpReg || !OperandsComplete()) &&
|
||||||
"Trying to add an operand to a machine instr that is already done!");
|
"Trying to add an operand to a machine instr that is already done!");
|
||||||
|
|
||||||
|
MachineRegisterInfo *RegInfo = getRegInfo();
|
||||||
|
|
||||||
// If we are adding the operand to the end of the list, our job is simpler.
|
// If we are adding the operand to the end of the list, our job is simpler.
|
||||||
// This is true most of the time, so this is a reasonable optimization.
|
// This is true most of the time, so this is a reasonable optimization.
|
||||||
if (isImpReg || NumImplicitOps == 0) {
|
if (isImpReg || NumImplicitOps == 0) {
|
||||||
|
@ -419,7 +421,7 @@ void MachineInstr::addOperand(const MachineOperand &Op) {
|
||||||
|
|
||||||
// If the operand is a register, update the operand's use list.
|
// If the operand is a register, update the operand's use list.
|
||||||
if (Op.isReg())
|
if (Op.isReg())
|
||||||
Operands.back().AddRegOperandToRegInfo(getRegInfo());
|
Operands.back().AddRegOperandToRegInfo(RegInfo);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -427,8 +429,6 @@ void MachineInstr::addOperand(const MachineOperand &Op) {
|
||||||
// Otherwise, we have to insert a real operand before any implicit ones.
|
// Otherwise, we have to insert a real operand before any implicit ones.
|
||||||
unsigned OpNo = Operands.size()-NumImplicitOps;
|
unsigned OpNo = Operands.size()-NumImplicitOps;
|
||||||
|
|
||||||
MachineRegisterInfo *RegInfo = getRegInfo();
|
|
||||||
|
|
||||||
// If this instruction isn't embedded into a function, then we don't need to
|
// If this instruction isn't embedded into a function, then we don't need to
|
||||||
// update any operand lists.
|
// update any operand lists.
|
||||||
if (RegInfo == 0) {
|
if (RegInfo == 0) {
|
||||||
|
|
Loading…
Reference in New Issue