This is an archive of the discontinued LLVM Phabricator instance.

Fix opt --help ordering of available optimizations.
ClosedPublic

Authored by erichkeane on Jun 29 2017, 12:41 PM.

Details

Summary

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.

Diff Detail

Repository
rL LLVM

Event Timeline

erichkeane created this revision.Jun 29 2017, 12:41 PM
erichkeane added inline comments.Jun 29 2017, 12:45 PM
include/llvm/IR/LegacyPassNameParser.h
91 ↗(On Diff #104723)

Craig pointed out this line needs to be -1 char, I've fixed it in my local WS, and will get it when I commit.

This revision is now accepted and ready to land.Jun 30 2017, 10:36 AM
This revision was automatically updated to reflect the committed changes.