From: Duncan P. N. Exon Smith Date: Thu, 8 Oct 2015 22:43:26 +0000 (+0000) Subject: AArch64: Stop using MachineInstr::getNextNode() X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=9c2fb736df3c6b378c8f7531aa5e101628925c18;p=oota-llvm.git 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249764 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/AArch64/AArch64CleanupLocalDynamicTLSPass.cpp b/lib/Target/AArch64/AArch64CleanupLocalDynamicTLSPass.cpp index 06ff9af37fd..2499b2c8875 100644 --- a/lib/Target/AArch64/AArch64CleanupLocalDynamicTLSPass.cpp +++ b/lib/Target/AArch64/AArch64CleanupLocalDynamicTLSPass.cpp @@ -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; }