diff options
Diffstat (limited to 'lib/Target/Mips/MipsCCState.cpp')
-rw-r--r-- | lib/Target/Mips/MipsCCState.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/lib/Target/Mips/MipsCCState.cpp b/lib/Target/Mips/MipsCCState.cpp index b8081295ca64..d82063e3d2a9 100644 --- a/lib/Target/Mips/MipsCCState.cpp +++ b/lib/Target/Mips/MipsCCState.cpp @@ -29,22 +29,16 @@ 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 /// originally a fp128. -static bool originalTypeIsF128(const Type *Ty, const SDNode *CallNode) { +static bool originalTypeIsF128(Type *Ty, const SDNode *CallNode) { if (Ty->isFP128Ty()) return true; |