r252691 - Fix a FIXME about using std::is_sorted.

Eric Christopher via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 10 18:04:08 PST 2015


Author: echristo
Date: Tue Nov 10 20:04:08 2015
New Revision: 252691

URL: http://llvm.org/viewvc/llvm-project?rev=252691&view=rev
Log:
Fix a FIXME about using std::is_sorted.

Modified:
    cfe/trunk/lib/CodeGen/CGBuiltin.cpp

Modified: cfe/trunk/lib/CodeGen/CGBuiltin.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBuiltin.cpp?rev=252691&r1=252690&r2=252691&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGBuiltin.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp Tue Nov 10 20:04:08 2015
@@ -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<NeonIntr
 
 #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




More information about the cfe-commits mailing list