diff options
| author | Alexey Samsonov <samsonov@google.com> | 2014-04-30 22:17:38 +0000 |
|---|---|---|
| committer | Alexey Samsonov <samsonov@google.com> | 2014-04-30 22:17:38 +0000 |
| commit | f74bde67353df69385c266cee3ba310fa0392d90 (patch) | |
| tree | b01771b350e1da9149ee2d0e5c95208bd3b1ff8e /llvm/lib/CodeGen/LexicalScopes.cpp | |
| parent | 3282af13d4f991235c43f5837252c546db24f7a8 (diff) | |
| download | bcm5719-llvm-f74bde67353df69385c266cee3ba310fa0392d90.tar.gz bcm5719-llvm-f74bde67353df69385c266cee3ba310fa0392d90.zip | |
Convert more loops to range-based equivalents
llvm-svn: 207714
Diffstat (limited to 'llvm/lib/CodeGen/LexicalScopes.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/LexicalScopes.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/llvm/lib/CodeGen/LexicalScopes.cpp b/llvm/lib/CodeGen/LexicalScopes.cpp index f87b890039e..f01dec28e52 100644 --- a/llvm/lib/CodeGen/LexicalScopes.cpp +++ b/llvm/lib/CodeGen/LexicalScopes.cpp @@ -63,25 +63,22 @@ void LexicalScopes::extractLexicalScopes( const MachineInstr *RangeBeginMI = nullptr; const MachineInstr *PrevMI = nullptr; DebugLoc PrevDL; - for (MachineBasicBlock::const_iterator II = MBB.begin(), IE = MBB.end(); - II != IE; ++II) { - const MachineInstr *MInsn = II; - + for (const auto &MInsn : MBB) { // Check if instruction has valid location information. - const DebugLoc MIDL = MInsn->getDebugLoc(); + const DebugLoc MIDL = MInsn.getDebugLoc(); if (MIDL.isUnknown()) { - PrevMI = MInsn; + PrevMI = &MInsn; continue; } // If scope has not changed then skip this instruction. if (MIDL == PrevDL) { - PrevMI = MInsn; + PrevMI = &MInsn; continue; } // Ignore DBG_VALUE. It does not contribute to any instruction in output. - if (MInsn->isDebugValue()) + if (MInsn.isDebugValue()) continue; if (RangeBeginMI) { @@ -94,10 +91,10 @@ void LexicalScopes::extractLexicalScopes( } // This is a beginning of a new instruction range. - RangeBeginMI = MInsn; + RangeBeginMI = &MInsn; // Reset previous markers. - PrevMI = MInsn; + PrevMI = &MInsn; PrevDL = MIDL; } |

