This is an archive of the discontinued LLVM Phabricator instance.

[llvm-size] Switch command line parsing from llvm::cl to OptTable
ClosedPublic

Authored by MaskRay on Jul 7 2021, 4:05 PM.

Details

Summary

Part of https://lists.llvm.org/pipermail/llvm-dev/2021-July/151622.html
"Binary utilities: switch command line parsing from llvm::cl to OptTable"

  • --totals=false and --totals=0 cannot be used. Omit the option.
  • --help-list is removed. This is a cl:: specific option.

OptTable avoids global option collision if we decide to support multiplexing for binary utilities.

Note: because the tool is simple, and its long options are uncommon, I just drop
the one-dash forms except -arch <value> (Darwin style).

Diff Detail

Event Timeline

MaskRay created this revision.Jul 7 2021, 4:05 PM
MaskRay requested review of this revision.Jul 7 2021, 4:05 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 7 2021, 4:05 PM
MaskRay updated this revision to Diff 357108.Jul 7 2021, 5:47 PM

forgot to include Opts.td

MaskRay updated this revision to Diff 357280.Jul 8 2021, 10:52 AM

update doc about removal of --help-list

Note: because the tool is simple, and its long options are uncommon, I just drop

the one-dash forms in this patch.

No objection from me here, but just a thought about Mach-O users: if I'm not mistaken, single-dash long options are the norm on that platform. Might be worth pinging some Mach-O developers about that.

llvm/tools/llvm-size/llvm-size.cpp
919

(assuming we're dropping long form)

jhenderson accepted this revision.Jul 9 2021, 12:50 AM
jhenderson added a subscriber: gbreynoo.

Forgot the LGTM, and obligatory @gbreynoo ping.

This revision is now accepted and ready to land.Jul 9 2021, 12:50 AM
MaskRay updated this revision to Diff 357563.Jul 9 2021, 10:23 AM
MaskRay edited the summary of this revision. (Show Details)

Keep -arch <value> (Darwin style one-dash long option)

This revision was landed with ongoing or failed builds.Jul 9 2021, 10:27 AM
This revision was automatically updated to reflect the committed changes.