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/X86PadShortFunction.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/X86PadShortFunction.cpp')
-rw-r--r-- | llvm/lib/Target/X86/X86PadShortFunction.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/Target/X86/X86PadShortFunction.cpp b/llvm/lib/Target/X86/X86PadShortFunction.cpp index 77b345352f3..62a9aafc2cf 100644 --- a/llvm/lib/Target/X86/X86PadShortFunction.cpp +++ b/llvm/lib/Target/X86/X86PadShortFunction.cpp @@ -187,19 +187,17 @@ bool PadShortFunc::cyclesUntilReturn(MachineBasicBlock *MBB, unsigned int CyclesToEnd = 0; - for (MachineBasicBlock::iterator MBBI = MBB->begin(); - MBBI != MBB->end(); ++MBBI) { - MachineInstr *MI = MBBI; + for (MachineInstr &MI : *MBB) { // Mark basic blocks with a return instruction. Calls to other // functions do not count because the called function will be padded, // if necessary. - if (MI->isReturn() && !MI->isCall()) { + if (MI.isReturn() && !MI.isCall()) { VisitedBBs[MBB] = VisitedBBInfo(true, CyclesToEnd); Cycles += CyclesToEnd; return true; } - CyclesToEnd += TII->getInstrLatency(STI->getInstrItineraryData(), *MI); + CyclesToEnd += TII->getInstrLatency(STI->getInstrItineraryData(), MI); } VisitedBBs[MBB] = VisitedBBInfo(false, CyclesToEnd); |