LiveInterval: Use more range based for loops for value numbers and segments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223978 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Matthias Braun
2014-12-10 23:07:54 +00:00
parent 1e9d355499
commit 218d20a48b
8 changed files with 67 additions and 90 deletions

View File

@ -449,7 +449,7 @@ void LiveIntervals::computeDeadValues(LiveRange &Segments, LiveRange &LR,
bool *CanSeparateRes, unsigned Reg,
SmallVectorImpl<MachineInstr*> *dead) {
bool CanSeparate = false;
for (auto VNI : make_range(LR.vni_begin(), LR.vni_end())) {
for (auto VNI : LR.valnos) {
if (VNI->isUnused())
continue;
LiveRange::iterator LRI = Segments.FindSegmentContaining(VNI->def);
@ -729,9 +729,7 @@ LiveIntervals::intervalIsInOneMBB(const LiveInterval &LI) const {
bool
LiveIntervals::hasPHIKill(const LiveInterval &LI, const VNInfo *VNI) const {
for (LiveInterval::const_vni_iterator I = LI.vni_begin(), E = LI.vni_end();
I != E; ++I) {
const VNInfo *PHI = *I;
for (const VNInfo *PHI : LI.valnos) {
if (PHI->isUnused() || !PHI->isPHIDef())
continue;
const MachineBasicBlock *PHIMBB = getMBBFromIndex(PHI->def);