[AArch64] Fix invalid use of references to BuildMI.

This was found in GCC PR65773 (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65773).

We shouldn't be taking a reference to the temporary that BuildMI returns, we must copy it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235088 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
James Molloy 2015-04-16 11:37:40 +00:00
parent 5ade5fcee4
commit 5717e28019

View File

@ -1526,7 +1526,7 @@ void AArch64InstrInfo::copyPhysRegTuple(
}
for (; SubReg != End; SubReg += Incr) {
const MachineInstrBuilder &MIB = BuildMI(MBB, I, DL, get(Opcode));
const MachineInstrBuilder MIB = BuildMI(MBB, I, DL, get(Opcode));
AddSubReg(MIB, DestReg, Indices[SubReg], RegState::Define, TRI);
AddSubReg(MIB, SrcReg, Indices[SubReg], 0, TRI);
AddSubReg(MIB, SrcReg, Indices[SubReg], getKillRegState(KillSrc), TRI);
@ -1904,7 +1904,7 @@ void AArch64InstrInfo::storeRegToStackSlot(
}
assert(Opc && "Unknown register class");
const MachineInstrBuilder &MI = BuildMI(MBB, MBBI, DL, get(Opc))
const MachineInstrBuilder MI = BuildMI(MBB, MBBI, DL, get(Opc))
.addReg(SrcReg, getKillRegState(isKill))
.addFrameIndex(FI);
@ -2002,7 +2002,7 @@ void AArch64InstrInfo::loadRegFromStackSlot(
}
assert(Opc && "Unknown register class");
const MachineInstrBuilder &MI = BuildMI(MBB, MBBI, DL, get(Opc))
const MachineInstrBuilder MI = BuildMI(MBB, MBBI, DL, get(Opc))
.addReg(DestReg, getDefRegState(true))
.addFrameIndex(FI);
if (Offset)