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

Sean Silva silvas at purdue.edu
Mon Jul 22 12:50:07 PDT 2013



================
Comment at: utils/TableGen/IntrinsicEmitter.cpp:145
@@ +144,3 @@
+private:
+  const std::vector<CodeGenIntrinsic>& Ints;
+};
----------------
& on right.

================
Comment at: utils/TableGen/IntrinsicEmitter.cpp:140-142
@@ +139,5 @@
+  // "abd.def.ghi" in the overridden name matcher
+  bool operator()(unsigned i, unsigned j) {
+    return Ints[i].Name.compare(Ints[j].Name) > 0;
+  }
+
----------------
Why are you using .compare? Using > makes it so much clearer that this is just sorting in reverse order of names.


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



More information about the llvm-commits mailing list