@@ -136,14 +136,12 @@ void InterferenceCache::Entry::update(unsigned MBBNum) {
136
136
// Use advanceTo only when possible.
137
137
if (PrevPos != Start) {
138
138
if (!PrevPos.isValid () || Start < PrevPos) {
139
- for (unsigned i = 0 , e = RegUnits.size (); i != e; ++i) {
140
- RegUnitInfo &RUI = RegUnits[i];
139
+ for (RegUnitInfo &RUI : RegUnits) {
141
140
RUI.VirtI .find (Start);
142
141
RUI.FixedI = RUI.Fixed ->find (Start);
143
142
}
144
143
} else {
145
- for (unsigned i = 0 , e = RegUnits.size (); i != e; ++i) {
146
- RegUnitInfo &RUI = RegUnits[i];
144
+ for (RegUnitInfo &RUI : RegUnits) {
147
145
RUI.VirtI .advanceTo (Start);
148
146
if (RUI.FixedI != RUI.Fixed ->end ())
149
147
RUI.FixedI = RUI.Fixed ->advanceTo (RUI.FixedI , Start);
@@ -162,8 +160,8 @@ void InterferenceCache::Entry::update(unsigned MBBNum) {
162
160
BI->First = BI->Last = SlotIndex ();
163
161
164
162
// Check for first interference from virtregs.
165
- for (unsigned i = 0 , e = RegUnits. size (); i != e; ++i ) {
166
- LiveIntervalUnion::SegmentIter &I = RegUnits[i] .VirtI ;
163
+ for (RegUnitInfo &RUI : RegUnits) {
164
+ LiveIntervalUnion::SegmentIter &I = RUI .VirtI ;
167
165
if (!I.valid ())
168
166
continue ;
169
167
SlotIndex StartI = I.start ();
@@ -174,9 +172,9 @@ void InterferenceCache::Entry::update(unsigned MBBNum) {
174
172
}
175
173
176
174
// Same thing for fixed interference.
177
- for (unsigned i = 0 , e = RegUnits. size (); i != e; ++i ) {
178
- LiveInterval::const_iterator I = RegUnits[i] .FixedI ;
179
- LiveInterval::const_iterator E = RegUnits[i] .Fixed ->end ();
175
+ for (RegUnitInfo &RUI : RegUnits) {
176
+ LiveInterval::const_iterator I = RUI .FixedI ;
177
+ LiveInterval::const_iterator E = RUI .Fixed ->end ();
180
178
if (I == E)
181
179
continue ;
182
180
SlotIndex StartI = I->start ;
@@ -213,8 +211,8 @@ void InterferenceCache::Entry::update(unsigned MBBNum) {
213
211
}
214
212
215
213
// Check for last interference in block.
216
- for (unsigned i = 0 , e = RegUnits. size (); i != e; ++i ) {
217
- LiveIntervalUnion::SegmentIter &I = RegUnits[i] .VirtI ;
214
+ for (RegUnitInfo &RUI : RegUnits) {
215
+ LiveIntervalUnion::SegmentIter &I = RUI .VirtI ;
218
216
if (!I.valid () || I.start () >= Stop)
219
217
continue ;
220
218
I.advanceTo (Stop);
@@ -229,9 +227,9 @@ void InterferenceCache::Entry::update(unsigned MBBNum) {
229
227
}
230
228
231
229
// Fixed interference.
232
- for (unsigned i = 0 , e = RegUnits. size (); i != e; ++i ) {
233
- LiveInterval::iterator &I = RegUnits[i] .FixedI ;
234
- LiveRange *LR = RegUnits[i] .Fixed ;
230
+ for (RegUnitInfo &RUI : RegUnits) {
231
+ LiveInterval::iterator &I = RUI .FixedI ;
232
+ LiveRange *LR = RUI .Fixed ;
235
233
if (I == LR->end () || I->start >= Stop)
236
234
continue ;
237
235
I = LR->advanceTo (I, Stop);
0 commit comments