mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-19 19:03:50 +00:00
Use std::is_sorted instead of manual loops. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256701 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2e0fe4b9e9
commit
4d0731f505
@ -59,6 +59,11 @@ struct SubtargetFeatureKV {
|
||||
bool operator<(StringRef S) const {
|
||||
return StringRef(Key) < S;
|
||||
}
|
||||
|
||||
// Compare routine for std::is_sorted.
|
||||
bool operator<(const SubtargetFeatureKV &Other) const {
|
||||
return StringRef(Key) < StringRef(Other.Key);
|
||||
}
|
||||
};
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
@ -234,14 +234,10 @@ SubtargetFeatures::getFeatureBits(StringRef CPU,
|
||||
return FeatureBitset();
|
||||
|
||||
#ifndef NDEBUG
|
||||
for (size_t i = 1, e = CPUTable.size(); i != e; ++i) {
|
||||
assert(strcmp(CPUTable[i - 1].Key, CPUTable[i].Key) < 0 &&
|
||||
"CPU table is not sorted");
|
||||
}
|
||||
for (size_t i = 1, e = FeatureTable.size(); i != e; ++i) {
|
||||
assert(strcmp(FeatureTable[i - 1].Key, FeatureTable[i].Key) < 0 &&
|
||||
"CPU features table is not sorted");
|
||||
}
|
||||
assert(std::is_sorted(std::begin(CPUTable), std::end(CPUTable)) &&
|
||||
"CPU table is not sorted");
|
||||
assert(std::is_sorted(std::begin(FeatureTable), std::end(FeatureTable)) &&
|
||||
"CPU features table is not sorted");
|
||||
#endif
|
||||
// Resulting bits
|
||||
FeatureBitset Bits;
|
||||
|
Loading…
x
Reference in New Issue
Block a user