From b2d7b67806d54be1de6fe07f190e93c91f5aa4d9 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Wed, 11 Nov 2015 02:04:08 +0000 Subject: [PATCH] Fix a FIXME about using std::is_sorted. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@252691 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGBuiltin.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/CodeGen/CGBuiltin.cpp b/lib/CodeGen/CGBuiltin.cpp index e2bd9fc2c9..1696991879 100644 --- a/lib/CodeGen/CGBuiltin.cpp +++ b/lib/CodeGen/CGBuiltin.cpp @@ -2258,6 +2258,9 @@ struct NeonIntrinsicInfo { bool operator<(unsigned RHSBuiltinID) const { return BuiltinID < RHSBuiltinID; } + bool operator<(const NeonIntrinsicInfo &TE) const { + return BuiltinID < TE.BuiltinID; + } }; } // end anonymous namespace @@ -2816,9 +2819,7 @@ findNeonIntrinsicInMap(ArrayRef IntrinsicMap, #ifndef NDEBUG if (!MapProvenSorted) { - // FIXME: use std::is_sorted once C++11 is allowed - for (unsigned i = 0; i < IntrinsicMap.size() - 1; ++i) - assert(IntrinsicMap[i].BuiltinID <= IntrinsicMap[i + 1].BuiltinID); + assert(std::is_sorted(std::begin(IntrinsicMap), std::end(IntrinsicMap))); MapProvenSorted = true; } #endif -- 2.40.0