diff options
author | Andrew Trick <atrick@apple.com> | 2013-04-23 23:45:11 +0000 |
---|---|---|
committer | Andrew Trick <atrick@apple.com> | 2013-04-23 23:45:11 +0000 |
commit | 6982bdd1193551e65effa3737f2a29d55e7901a5 (patch) | |
tree | a795e2acdf3aa8787987a54941e3b79a9dc30154 /utils | |
parent | efa1458ef3cc6b236d30ffe48e14c809de37a72c (diff) |
Machine model: rewrite a tablegen loop to avoid comparing record pointers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180160 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r-- | utils/TableGen/SubtargetEmitter.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/utils/TableGen/SubtargetEmitter.cpp b/utils/TableGen/SubtargetEmitter.cpp index 98892e1144..0d36c4fd46 100644 --- a/utils/TableGen/SubtargetEmitter.cpp +++ b/utils/TableGen/SubtargetEmitter.cpp @@ -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); |