diff options
author | Alexey Samsonov <samsonov@google.com> | 2014-04-30 18:29:51 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2014-04-30 18:29:51 +0000 |
commit | 4aef7270c975ed62788ce5956a1763101113bc6f (patch) | |
tree | b5b6df3dc98780fc2a13354ac567cac966a0f657 /lib/CodeGen/LexicalScopes.cpp | |
parent | 78ecea93a30e5fe05277f11b07a2d32a7c68e31d (diff) | |
download | llvm-4aef7270c975ed62788ce5956a1763101113bc6f.tar.gz llvm-4aef7270c975ed62788ce5956a1763101113bc6f.tar.bz2 llvm-4aef7270c975ed62788ce5956a1763101113bc6f.tar.xz |
Convert several loops over MachineFunction basic blocks to range-based loops
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207683 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LexicalScopes.cpp')
-rw-r--r-- | lib/CodeGen/LexicalScopes.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/CodeGen/LexicalScopes.cpp b/lib/CodeGen/LexicalScopes.cpp index 02ffb01665..f87b890039 100644 --- a/lib/CodeGen/LexicalScopes.cpp +++ b/lib/CodeGen/LexicalScopes.cpp @@ -59,12 +59,11 @@ void LexicalScopes::extractLexicalScopes( DenseMap<const MachineInstr *, LexicalScope *> &MI2ScopeMap) { // Scan each instruction and create scopes. First build working set of scopes. - for (MachineFunction::const_iterator I = MF->begin(), E = MF->end(); I != E; - ++I) { + for (const auto &MBB : *MF) { const MachineInstr *RangeBeginMI = nullptr; const MachineInstr *PrevMI = nullptr; DebugLoc PrevDL; - for (MachineBasicBlock::const_iterator II = I->begin(), IE = I->end(); + for (MachineBasicBlock::const_iterator II = MBB.begin(), IE = MBB.end(); II != IE; ++II) { const MachineInstr *MInsn = II; @@ -274,9 +273,8 @@ void LexicalScopes::getMachineBasicBlocks( return; if (Scope == CurrentFnLexicalScope) { - for (MachineFunction::const_iterator I = MF->begin(), E = MF->end(); I != E; - ++I) - MBBs.insert(I); + for (const auto &MBB : *MF) + MBBs.insert(&MBB); return; } |