summaryrefslogtreecommitdiff
path: root/lib/CodeGen/LexicalScopes.cpp
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2014-04-30 18:29:51 +0000
committerAlexey Samsonov <samsonov@google.com>2014-04-30 18:29:51 +0000
commit4aef7270c975ed62788ce5956a1763101113bc6f (patch)
treeb5b6df3dc98780fc2a13354ac567cac966a0f657 /lib/CodeGen/LexicalScopes.cpp
parent78ecea93a30e5fe05277f11b07a2d32a7c68e31d (diff)
downloadllvm-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.cpp10
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;
}