aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/Mips/MipsCCState.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2015-10-17 21:32:26 +0000
committerCraig Topper <craig.topper@gmail.com>2015-10-17 21:32:26 +0000
commita8334511738f59d24da10ec4dfd6189fc7c84dc1 (patch)
treeacfc829a915e3690e7db38dde2bc1e8c6f462a0a /llvm/lib/Target/Mips/MipsCCState.cpp
parent01cb379fedfbe322d315afb9fad629315ab407d6 (diff)
downloadllvm-a8334511738f59d24da10ec4dfd6189fc7c84dc1.zip
llvm-a8334511738f59d24da10ec4dfd6189fc7c84dc1.tar.gz
llvm-a8334511738f59d24da10ec4dfd6189fc7c84dc1.tar.bz2
Use std::is_sorted to replace a custom version. Also replace a comparison predicate struct with a lambda.
llvm-svn: 250623
Diffstat (limited to 'llvm/lib/Target/Mips/MipsCCState.cpp')
-rw-r--r--llvm/lib/Target/Mips/MipsCCState.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/llvm/lib/Target/Mips/MipsCCState.cpp b/llvm/lib/Target/Mips/MipsCCState.cpp
index 7fc364c..d82063e 100644
--- a/llvm/lib/Target/Mips/MipsCCState.cpp
+++ b/llvm/lib/Target/Mips/MipsCCState.cpp
@@ -29,17 +29,11 @@ static bool isF128SoftLibCall(const char *CallSym) {
"powl", "rintl", "sinl", "sqrtl",
"truncl"};
- const char *const *End = LibCalls + array_lengthof(LibCalls);
-
// Check that LibCalls is sorted alphabetically.
- MipsTargetLowering::LTStr Comp;
-
-#ifndef NDEBUG
- for (const char *const *I = LibCalls; I < End - 1; ++I)
- assert(Comp(*I, *(I + 1)));
-#endif
-
- return std::binary_search(LibCalls, End, CallSym, Comp);
+ auto Comp = [](const char *S1, const char *S2) { return strcmp(S1, S2) < 0; };
+ assert(std::is_sorted(std::begin(LibCalls), std::end(LibCalls), Comp));
+ return std::binary_search(std::begin(LibCalls), std::end(LibCalls),
+ CallSym, Comp);
}
/// This function returns true if Ty is fp128, {f128} or i128 which was