diff options
author | Craig Topper <craig.topper@gmail.com> | 2016-01-03 07:33:45 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2016-01-03 07:33:45 +0000 |
commit | 5f167729aa3a3ff55758ac94e725bccc7f81fb55 (patch) | |
tree | b495d531231dc7da296b931b6463a55e0cf98b88 /llvm/lib/MC/SubtargetFeature.cpp | |
parent | 1097df3b4ac0daf4f7dabb2fd4a8887280617e93 (diff) | |
download | bcm5719-llvm-5f167729aa3a3ff55758ac94e725bccc7f81fb55.tar.gz bcm5719-llvm-5f167729aa3a3ff55758ac94e725bccc7f81fb55.zip |
Use std::is_sorted instead of manual loops. NFC
llvm-svn: 256701
Diffstat (limited to 'llvm/lib/MC/SubtargetFeature.cpp')
-rw-r--r-- | llvm/lib/MC/SubtargetFeature.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/llvm/lib/MC/SubtargetFeature.cpp b/llvm/lib/MC/SubtargetFeature.cpp index b642f17f0e7..c1f5fc95cf5 100644 --- a/llvm/lib/MC/SubtargetFeature.cpp +++ b/llvm/lib/MC/SubtargetFeature.cpp @@ -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; |