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 | 41b977dffd868839089b5e8e54729ba14a0c4823 (patch) | |
| tree | c19090c4ca36ae4fa5f601efb87e3c2857a060f7 /llvm/lib/CodeGen/LexicalScopes.cpp | |
| parent | deca70559335bf8dbe0876f2f974701725f26c28 (diff) | |
| download | bcm5719-llvm-41b977dffd868839089b5e8e54729ba14a0c4823.tar.gz bcm5719-llvm-41b977dffd868839089b5e8e54729ba14a0c4823.zip | |
Convert several loops over MachineFunction basic blocks to range-based loops
llvm-svn: 207683
Diffstat (limited to 'llvm/lib/CodeGen/LexicalScopes.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/LexicalScopes.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/LexicalScopes.cpp b/llvm/lib/CodeGen/LexicalScopes.cpp index 02ffb01665e..f87b890039e 100644 --- a/llvm/lib/CodeGen/LexicalScopes.cpp +++ b/llvm/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; } |

