[PATCH] D92217: [llvm-objdump] Remove -mcpu=help from help text

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 27 03:44:16 PST 2020


jhenderson added a comment.

In D92217#2419893 <https://reviews.llvm.org/D92217#2419893>, @DavidSpickett wrote:

> (why it prints twice is another matter, --mattr doesn't)

Sounds like a possible bug, and worth either reporting, or investigating further and fixing, as I can't imagine it'll be too complex.

> Seems to me that:
>
> - --mattr=help should be documented too

Seems reasonable. If you do, make sure to add it to both help text and the user guide.

> - The "--mcpu/attr=help" output should be on stdout (which is probably more tricky than I think it is)

Also seems reasonable (since --help does this). However, in this case, it would be good to get a few more opinions.

> - llvm-objdump shouldn't disassemble the file if you use those options (like `llvm-objdump -d foo.o --help` doesn't)

I can see the logic behind this, although I'm slightly less certain about it. Again, other's opinions would be useful. If we do go down this route, it would make sense for --help + --mcpu=help to result in both bits being printed.

>> It would probably make sense to promote --mcpu=help specifically (i.e. not --mcpu=<some cpu>) to a "Command".
>
> I assume doing this would help with the above?

For documentation purposes, it would definitely be a command, inasmuch as --help can be specified without other options with no problem (In llvm-objdump terminology, at least one "Command" (as opposed to "option") must be specified). I'm not sure off the top of my head the code semantics in this area. Even if we decide not to suppress other output for --mcpu=help (also --mattr=help), we should allow them to be specified without other options, I think, to avoid the sort of confusion you ran into.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D92217/new/

https://reviews.llvm.org/D92217



More information about the llvm-commits mailing list