mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-20 10:38:46 +00:00
Machine model: rewrite a tablegen loop to avoid comparing record pointers.
llvm-svn: 180160
This commit is contained in:
parent
ead4a7f8ab
commit
69561e2961
@ -797,7 +797,6 @@ void SubtargetEmitter::ExpandProcResources(RecVec &PRVec,
|
||||
RecVec SubResources;
|
||||
if (PRVec[i]->isSubClassOf("ProcResGroup")) {
|
||||
SubResources = PRVec[i]->getValueAsListOfDefs("Resources");
|
||||
std::sort(SubResources.begin(), SubResources.end(), LessRecord());
|
||||
}
|
||||
else {
|
||||
SubResources.push_back(PRVec[i]);
|
||||
@ -808,15 +807,12 @@ void SubtargetEmitter::ExpandProcResources(RecVec &PRVec,
|
||||
if (*PRI == PRVec[i] || !(*PRI)->isSubClassOf("ProcResGroup"))
|
||||
continue;
|
||||
RecVec SuperResources = (*PRI)->getValueAsListOfDefs("Resources");
|
||||
std::sort(SuperResources.begin(), SuperResources.end(), LessRecord());
|
||||
RecIter SubI = SubResources.begin(), SubE = SubResources.end();
|
||||
RecIter SuperI = SuperResources.begin(), SuperE = SuperResources.end();
|
||||
for ( ; SubI != SubE && SuperI != SuperE; ++SuperI) {
|
||||
if (*SubI < *SuperI)
|
||||
for( ; SubI != SubE; ++SubI) {
|
||||
if (std::find(SuperResources.begin(), SuperResources.end(), *SubI)
|
||||
== SuperResources.end()) {
|
||||
break;
|
||||
else if (*SuperI < *SubI)
|
||||
continue;
|
||||
++SubI;
|
||||
}
|
||||
}
|
||||
if (SubI == SubE) {
|
||||
PRVec.push_back(*PRI);
|
||||
|
Loading…
Reference in New Issue
Block a user