@@ -979,8 +979,9 @@ unsigned CodeGenSchedModels::addSchedClass(const Record *ItinClassDef,
979
979
return SC.isKeyEqual (ItinClassDef, OperWrites, OperReads);
980
980
};
981
981
982
- auto I = find_if (make_range (schedClassBegin (), schedClassEnd ()), IsKeyEqual);
983
- unsigned Idx = I == schedClassEnd () ? 0 : std::distance (schedClassBegin (), I);
982
+ auto I = find_if (SchedClasses, IsKeyEqual);
983
+ unsigned Idx =
984
+ I == SchedClasses.end () ? 0 : std::distance (SchedClasses.begin (), I);
984
985
if (Idx || SchedClasses[0 ].isKeyEqual (ItinClassDef, OperWrites, OperReads)) {
985
986
IdxVec PI;
986
987
std::set_union (SchedClasses[Idx].ProcIndices .begin (),
@@ -1103,8 +1104,7 @@ void CodeGenSchedModels::createInstRWClass(const Record *InstRWDef) {
1103
1104
1104
1105
// True if collectProcItins found anything.
1105
1106
bool CodeGenSchedModels::hasItineraries () const {
1106
- for (const CodeGenProcModel &PM :
1107
- make_range (procModelBegin (), procModelEnd ()))
1107
+ for (const CodeGenProcModel &PM : procModels ())
1108
1108
if (PM.hasItineraries ())
1109
1109
return true ;
1110
1110
return false ;
@@ -1129,8 +1129,7 @@ void CodeGenSchedModels::collectProcItins() {
1129
1129
const Record *ItinDef = ItinData->getValueAsDef (" TheClass" );
1130
1130
bool FoundClass = false ;
1131
1131
1132
- for (const CodeGenSchedClass &SC :
1133
- make_range (schedClassBegin (), schedClassEnd ())) {
1132
+ for (const CodeGenSchedClass &SC : schedClasses ()) {
1134
1133
// Multiple SchedClasses may share an itinerary. Update all of them.
1135
1134
if (SC.ItinClassDef == ItinDef) {
1136
1135
ProcModel.ItinDefList [SC.Index ] = ItinData;
@@ -1420,8 +1419,7 @@ void PredTransitions::getIntersectingVariants(
1420
1419
if (AliasProcIdx && AliasProcIdx != TransVec[TransIdx].ProcIndex )
1421
1420
continue ;
1422
1421
if (!Variants.empty ()) {
1423
- const CodeGenProcModel &PM =
1424
- *(SchedModels.procModelBegin () + AliasProcIdx);
1422
+ const CodeGenProcModel &PM = SchedModels.procModels ()[AliasProcIdx];
1425
1423
PrintFatalError ((*AI)->getLoc (),
1426
1424
" Multiple variants defined for processor " +
1427
1425
PM.ModelName +
@@ -1834,8 +1832,7 @@ void CodeGenSchedModels::collectProcResources() {
1834
1832
// Add any subtarget-specific SchedReadWrites that are directly associated
1835
1833
// with processor resources. Refer to the parent SchedClass's ProcIndices to
1836
1834
// determine which processors they apply to.
1837
- for (const CodeGenSchedClass &SC :
1838
- make_range (schedClassBegin (), schedClassEnd ())) {
1835
+ for (const CodeGenSchedClass &SC : schedClasses ()) {
1839
1836
if (SC.ItinClassDef ) {
1840
1837
collectItinProcResources (SC.ItinClassDef );
1841
1838
continue ;
0 commit comments