diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2016-07-12 03:18:50 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2016-07-12 03:18:50 +0000 |
commit | 7b4c18e8f38a0139e1f2ece643df9f7c21246b39 (patch) | |
tree | 219505b2f5c6f43af05c1c1f45aeeffa54774d4b /llvm/lib/Target/X86/X86MCInstLower.cpp | |
parent | 99933f1b51d314d4eb7813f59911e14ecc07d4ff (diff) | |
download | bcm5719-llvm-7b4c18e8f38a0139e1f2ece643df9f7c21246b39.tar.gz bcm5719-llvm-7b4c18e8f38a0139e1f2ece643df9f7c21246b39.zip |
X86: Avoid implicit iterator conversions, NFC
Avoid implicit conversions from MachineInstrBundleIterator to
MachineInstr*, mainly by preferring MachineInstr& over MachineInstr* and
using range-based for loops.
llvm-svn: 275149
Diffstat (limited to 'llvm/lib/Target/X86/X86MCInstLower.cpp')
-rw-r--r-- | llvm/lib/Target/X86/X86MCInstLower.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Target/X86/X86MCInstLower.cpp b/llvm/lib/Target/X86/X86MCInstLower.cpp index c00338f4c2f..00a7c2540c4 100644 --- a/llvm/lib/Target/X86/X86MCInstLower.cpp +++ b/llvm/lib/Target/X86/X86MCInstLower.cpp @@ -1025,7 +1025,7 @@ PrevCrossBBInst(MachineBasicBlock::const_iterator MBBI) { const MachineBasicBlock *MBB = MBBI->getParent(); while (MBBI == MBB->begin()) { if (MBB == &MBB->getParent()->front()) - return nullptr; + return MachineBasicBlock::const_iterator(); MBB = MBB->getPrevNode(); MBBI = MBB->end(); } @@ -1305,7 +1305,9 @@ void X86AsmPrinter::EmitInstruction(const MachineInstr *MI) { case X86::SEH_Epilogue: { MachineBasicBlock::const_iterator MBBI(MI); // Check if preceded by a call and emit nop if so. - for (MBBI = PrevCrossBBInst(MBBI); MBBI; MBBI = PrevCrossBBInst(MBBI)) { + for (MBBI = PrevCrossBBInst(MBBI); + MBBI != MachineBasicBlock::const_iterator(); + MBBI = PrevCrossBBInst(MBBI)) { // Conservatively assume that pseudo instructions don't emit code and keep // looking for a call. We may emit an unnecessary nop in some cases. if (!MBBI->isPseudo()) { |