aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/VirtRegMap.cpp
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2014-12-10 23:07:54 +0000
committerMatthias Braun <matze@braunis.de>2014-12-10 23:07:54 +0000
commit96761959d42d8688a3f860b3b01a399a6c91890e (patch)
treece74d4504e59be2ace352d2f2d88f5a91be5e9fd /llvm/lib/CodeGen/VirtRegMap.cpp
parent52276536f8e99659a6b9bb7206cb5e65301c19fd (diff)
downloadllvm-96761959d42d8688a3f860b3b01a399a6c91890e.zip
llvm-96761959d42d8688a3f860b3b01a399a6c91890e.tar.gz
llvm-96761959d42d8688a3f860b3b01a399a6c91890e.tar.bz2
LiveInterval: Use more range based for loops for value numbers and segments.
llvm-svn: 223978
Diffstat (limited to 'llvm/lib/CodeGen/VirtRegMap.cpp')
-rw-r--r--llvm/lib/CodeGen/VirtRegMap.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/VirtRegMap.cpp b/llvm/lib/CodeGen/VirtRegMap.cpp
index a43e334..e9fb913 100644
--- a/llvm/lib/CodeGen/VirtRegMap.cpp
+++ b/llvm/lib/CodeGen/VirtRegMap.cpp
@@ -255,9 +255,8 @@ void VirtRegRewriter::addMBBLiveIns() {
if (LI.hasSubRanges()) {
for (LiveInterval::subrange_iterator S = LI.subrange_begin(),
SE = LI.subrange_end(); S != SE; ++S) {
- for (LiveRange::const_iterator I = S->begin(), E = S->end(); I != E;
- ++I) {
- if (!Indexes->findLiveInMBBs(I->start, I->end, LiveIn))
+ for (const auto &Seg : S->segments) {
+ if (!Indexes->findLiveInMBBs(Seg.start, Seg.end, LiveIn))
continue;
for (MCSubRegIndexIterator SR(PhysReg, TRI); SR.isValid(); ++SR) {
unsigned SubReg = SR.getSubReg();
@@ -275,9 +274,8 @@ void VirtRegRewriter::addMBBLiveIns() {
}
} else {
// Scan the segments of LI.
- for (LiveInterval::const_iterator I = LI.begin(), E = LI.end(); I != E;
- ++I) {
- if (!Indexes->findLiveInMBBs(I->start, I->end, LiveIn))
+ for (const auto &Seg : LI.segments) {
+ if (!Indexes->findLiveInMBBs(Seg.start, Seg.end, LiveIn))
continue;
for (unsigned i = 0, e = LiveIn.size(); i != e; ++i)
if (!LiveIn[i]->isLiveIn(PhysReg))