[PATCH] D34831: Fix opt --help ordering of available optimizations.

Erich Keane via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 30 11:44:54 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL306857: Fix opt --help ordering of available optimizations. (authored by erichkeane).

Changed prior to commit:
  https://reviews.llvm.org/D34831?vs=104723&id=104902#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D34831

Files:
  llvm/trunk/include/llvm/IR/LegacyPassNameParser.h


Index: llvm/trunk/include/llvm/IR/LegacyPassNameParser.h
===================================================================
--- llvm/trunk/include/llvm/IR/LegacyPassNameParser.h
+++ llvm/trunk/include/llvm/IR/LegacyPassNameParser.h
@@ -81,15 +81,15 @@
   // default implementation to sort the table before we print...
   void printOptionInfo(const cl::Option &O, size_t GlobalWidth) const override {
     PassNameParser *PNP = const_cast<PassNameParser*>(this);
-    array_pod_sort(PNP->Values.begin(), PNP->Values.end(), ValLessThan);
+    array_pod_sort(PNP->Values.begin(), PNP->Values.end(), ValCompare);
     cl::parser<const PassInfo*>::printOptionInfo(O, GlobalWidth);
   }
 
 private:
-  // ValLessThan - Provide a sorting comparator for Values elements...
-  static int ValLessThan(const PassNameParser::OptionInfo *VT1,
-                         const PassNameParser::OptionInfo *VT2) {
-    return VT1->Name < VT2->Name;
+  // ValCompare - Provide a sorting comparator for Values elements...
+  static int ValCompare(const PassNameParser::OptionInfo *VT1,
+                        const PassNameParser::OptionInfo *VT2) {
+    return VT1->Name.compare(VT2->Name);
   }
 };
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34831.104902.patch
Type: text/x-patch
Size: 1187 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170630/aaec04db/attachment.bin>


More information about the llvm-commits mailing list