This is an archive of the discontinued LLVM Phabricator instance.

[llvm-readobj] Remove one-dash long options
ClosedPublic

Authored by MaskRay on Jul 14 2021, 9:50 PM.

Details

Summary

llvm-readelf is a user-facing tool which emulates GNU readelf. Remove one-dash
long options which are not recognized by GNU style getopt_long. This ensures
long options cannot collide with grouped short options.

Note: the documentation (D63719)/help messages have recommended the double-dash
forms since LLVM 9.0.0.
llvm-readobj is intended as an internal tool which has some flexibility.
llvm-readelf/llvm-readobj use the same option parsing code and llvm-readobj's
one-dash long options aren't used.

Diff Detail

Event Timeline

MaskRay created this revision.Jul 14 2021, 9:50 PM
MaskRay requested review of this revision.Jul 14 2021, 9:50 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 14 2021, 9:50 PM

Is there anything in the docs that needs updating, or has that all been taken care of now?

llvm/tools/llvm-readobj/Opts.td
4

I might be being dumb, but don't you need to remove the "-" from here too? Otherwise, many options will still allow a single-dash, as far as I can tell (e.g. -addrsig, -all etc).

MaskRay updated this revision to Diff 359042.Jul 15 2021, 10:28 AM
MaskRay edited the summary of this revision. (Show Details)

address comment

the doc has recommended -- since D63719

jhenderson accepted this revision.Jul 16 2021, 12:28 AM

Pre-merge tests are showing up several LLD failures due to this change now. Best run the tests again and fix. Otherwise, LGTM.

This revision is now accepted and ready to land.Jul 16 2021, 12:28 AM

Pre-merge tests are showing up several LLD failures due to this change now. Best run the tests again and fix. Otherwise, LGTM.

Migrated the tests in 3c9d86f9515e2cdc57dd76095ab9099aa399f652

This revision was landed with ongoing or failed builds.Jul 16 2021, 12:03 PM
This revision was automatically updated to reflect the committed changes.