summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErich Keane <erich.keane@intel.com>2017-06-30 18:44:33 +0000
committerErich Keane <erich.keane@intel.com>2017-06-30 18:44:33 +0000
commit60cb75fd59ff0930450b82bd55cbb38f67800133 (patch)
tree5351dcce7aea2d2b5065877537e047d909b9a07a
parent990f01f8c6c5dca397b341d97648bc43478a39ef (diff)
downloadbcm5719-llvm-60cb75fd59ff0930450b82bd55cbb38f67800133.tar.gz
bcm5719-llvm-60cb75fd59ff0930450b82bd55cbb38f67800133.zip
Fix opt --help ordering of available optimizations.
Introduced in -r283004, the PassNameParser sorts Optimization options in reverse. This is because the commit replaced a compare function with "<" (which would seemingly be proper based on the name of the comparison function). The result is the 'true' result is converted to '1', which is inverted. This patch fixes this by replacing the '<' operator call on StringRef with a call to the StringRef compare function. It also renames the function to better reflect its meaning. Differential Revision: https://reviews.llvm.org/D34831 llvm-svn: 306857
-rw-r--r--llvm/include/llvm/IR/LegacyPassNameParser.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/include/llvm/IR/LegacyPassNameParser.h b/llvm/include/llvm/IR/LegacyPassNameParser.h
index fd9d468b06c..4cec0819640 100644
--- a/llvm/include/llvm/IR/LegacyPassNameParser.h
+++ b/llvm/include/llvm/IR/LegacyPassNameParser.h
@@ -81,15 +81,15 @@ public:
// 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);
}
};
OpenPOWER on IntegriCloud