From: Duncan P. N. Exon Smith Date: Fri, 1 Jul 2016 16:38:28 +0000 (+0000) Subject: CodeGen: Avoid implicit conversions in TargetInstrInfo, NFC X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1032b93f3a7734ff128bc3691b1f7a78bc221897;p=llvm CodeGen: Avoid implicit conversions in TargetInstrInfo, NFC Avoid implicit conversions from MachineBasicBlock::iterator to MachineInstr* in TargetInstrInfo. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274361 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/TargetInstrInfo.cpp b/lib/CodeGen/TargetInstrInfo.cpp index 4500e890beb..f221fa1ea5e 100644 --- a/lib/CodeGen/TargetInstrInfo.cpp +++ b/lib/CodeGen/TargetInstrInfo.cpp @@ -552,7 +552,7 @@ MachineInstr *TargetInstrInfo::foldMemoryOperand(MachineInstr &MI, storeRegToStackSlot(*MBB, Pos, MO.getReg(), MO.isKill(), FI, RC, TRI); else loadRegFromStackSlot(*MBB, Pos, MO.getReg(), FI, RC, TRI); - return --Pos; + return &*--Pos; } bool TargetInstrInfo::hasReassociableOperands( @@ -793,7 +793,7 @@ MachineInstr *TargetInstrInfo::foldMemoryOperand(MachineInstr &MI, // Fold stackmap/patchpoint. NewMI = foldPatchpoint(MF, MI, Ops, FrameIndex, *this); if (NewMI) - NewMI = MBB.insert(MI, NewMI); + NewMI = &*MBB.insert(MI, NewMI); } else { // Ask the target to do the actual folding. NewMI = foldMemoryOperandImpl(MF, MI, Ops, MI, LoadMI, LIS);