Convert more loops to range-based equivalents

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207714 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Alexey Samsonov
2014-04-30 22:17:38 +00:00
parent fff0879df0
commit 846781235d
13 changed files with 103 additions and 130 deletions

View File

@ -277,20 +277,19 @@ void WinCodeViewLineTables::beginFunction(const MachineFunction *MF) {
// for the first instruction of the function, not the last of the prolog?
DebugLoc PrologEndLoc;
bool EmptyPrologue = true;
for (MachineFunction::const_iterator I = MF->begin(), E = MF->end();
I != E && PrologEndLoc.isUnknown(); ++I) {
for (MachineBasicBlock::const_iterator II = I->begin(), IE = I->end();
II != IE; ++II) {
const MachineInstr *MI = II;
if (MI->isDebugValue())
for (const auto &MBB : *MF) {
if (!PrologEndLoc.isUnknown())
break;
for (const auto &MI : MBB) {
if (MI.isDebugValue())
continue;
// First known non-DBG_VALUE and non-frame setup location marks
// the beginning of the function body.
// FIXME: do we need the first subcondition?
if (!MI->getFlag(MachineInstr::FrameSetup) &&
(!MI->getDebugLoc().isUnknown())) {
PrologEndLoc = MI->getDebugLoc();
if (!MI.getFlag(MachineInstr::FrameSetup) &&
(!MI.getDebugLoc().isUnknown())) {
PrologEndLoc = MI.getDebugLoc();
break;
}
EmptyPrologue = false;