[PATCH] [TableGen] Sort intrinsics in reverse order for intrinsic name matcher

Sean Silva silvas at purdue.edu
Mon Jul 15 13:24:07 PDT 2013



================
Comment at: utils/TableGen/IntrinsicEmitter.cpp:140-143
@@ +139,6 @@
+  // "abd.def.ghi" in the overridden name matcher
+  bool operator()(unsigned i, unsigned j) {
+    const std::string &IName = Ints[i].Name;
+    const std::string &JName = Ints[j].Name;
+    return IName.compare(JName) >= 0;
+  }
----------------
Can you just use `Ints[i].Name > Ints[j].Name`? Also, the comparator needs to be a "<", but your comparator will return true for the equality case.


http://llvm-reviews.chandlerc.com/D1128



More information about the llvm-commits mailing list