diff options
| author | Matthias Braun <matze@braunis.de> | 2014-12-11 00:59:06 +0000 |
|---|---|---|
| committer | Matthias Braun <matze@braunis.de> | 2014-12-11 00:59:06 +0000 |
| commit | 09afa1ea749d5757ffc75f322be01466a372e6e2 (patch) | |
| tree | 5513fe1517cf8246529f939aceec5a05c826e5e5 /llvm/lib/CodeGen/LiveInterval.cpp | |
| parent | 8cb0a28ce6f78f498d429c6377183f940fe8b9c4 (diff) | |
| download | bcm5719-llvm-09afa1ea749d5757ffc75f322be01466a372e6e2.tar.gz bcm5719-llvm-09afa1ea749d5757ffc75f322be01466a372e6e2.zip | |
LiveInterval: Use range based for loops for subregister ranges.
llvm-svn: 223991
Diffstat (limited to 'llvm/lib/CodeGen/LiveInterval.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/LiveInterval.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/llvm/lib/CodeGen/LiveInterval.cpp b/llvm/lib/CodeGen/LiveInterval.cpp index 7953be6fa2b..67e7a8ae85d 100644 --- a/llvm/lib/CodeGen/LiveInterval.cpp +++ b/llvm/lib/CodeGen/LiveInterval.cpp @@ -660,9 +660,8 @@ void LiveInterval::print(raw_ostream &OS) const { OS << PrintReg(reg) << ' '; super::print(OS); // Print subranges - for (const_subrange_iterator I = subrange_begin(), E = subrange_end(); - I != E; ++I) { - OS << format(" L%04X ", I->LaneMask) << *I; + for (const SubRange &SR : subranges()) { + OS << format(" L%04X ", SR.LaneMask) << SR; } } @@ -699,18 +698,17 @@ void LiveInterval::verify(const MachineRegisterInfo *MRI) const { // Make sure SubRanges are fine and LaneMasks are disjunct. unsigned Mask = 0; unsigned MaxMask = MRI != nullptr ? MRI->getMaxLaneMaskForVReg(reg) : ~0u; - for (const_subrange_iterator I = subrange_begin(), E = subrange_end(); I != E; - ++I) { + for (const SubRange &SR : subranges()) { // Subrange lanemask should be disjunct to any previous subrange masks. - assert((Mask & I->LaneMask) == 0); - Mask |= I->LaneMask; + assert((Mask & SR.LaneMask) == 0); + Mask |= SR.LaneMask; // subrange mask should not contained in maximum lane mask for the vreg. assert((Mask & ~MaxMask) == 0); - I->verify(); + SR.verify(); // Main liverange should cover subrange. - assert(covers(*I)); + assert(covers(SR)); } } #endif |

