1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

AArch64: Stop using MachineInstr::getNextNode()

Stop using `getNextNode()` to get an insertion point (at least, in this
one place).  Instead, use iterator logic directly.

The `getNextNode()` interface isn't actually supposed to work for
creating iterators; it's supposed to return `nullptr` (not a real
iterator) if this is the last node.  It's currently broken and will
"happen" to work, but if we ever fix the function, we'll get some
strange failures in places like this.

llvm-svn: 249764
This commit is contained in:
Duncan P. N. Exon Smith 2015-10-08 22:43:26 +00:00
parent 697c3504ca
commit c536535bb8

View File

@ -117,10 +117,10 @@ struct LDTLSCleanup : public MachineFunctionPass {
*TLSBaseAddrReg = RegInfo.createVirtualRegister(&AArch64::GPR64RegClass);
// Insert a copy from X0 to TLSBaseAddrReg for later.
MachineInstr *Next = I->getNextNode();
MachineInstr *Copy = BuildMI(*I->getParent(), Next, I->getDebugLoc(),
TII->get(TargetOpcode::COPY),
*TLSBaseAddrReg).addReg(AArch64::X0);
MachineInstr *Copy =
BuildMI(*I->getParent(), ++MachineBasicBlock::iterator(I),
I->getDebugLoc(), TII->get(TargetOpcode::COPY), *TLSBaseAddrReg)
.addReg(AArch64::X0);
return Copy;
}