This is an archive of the discontinued LLVM Phabricator instance.

[llvm-symbolizer] Add back --version and add a -v alias
ClosedPublic

Authored by MaskRay on Aug 9 2020, 11:46 PM.

Details

Summary

The switch from llvm::cl to OptTable (D83530) dropped --version, which
is needed by some users.

This patch also adds a -v alias, which is available in GNU addr2line.

The version dumping is similar to llvm-objcopy --version (exotic):

llvm-symbolizer
LLVM (http://llvm.org/):
  LLVM version 12.0.0git
  Optimized build with assertions.
  Default target: x86_64-unknown-linux-gnu
  Host CPU: skylake-avx512

Diff Detail

Event Timeline

MaskRay created this revision.Aug 9 2020, 11:46 PM
MaskRay requested review of this revision.Aug 9 2020, 11:46 PM
dyung accepted this revision.Aug 9 2020, 11:53 PM

Looks good, thanks for fixing this for us!

This revision is now accepted and ready to land.Aug 9 2020, 11:53 PM
jhenderson accepted this revision.Aug 10 2020, 2:22 AM

You should add the short alias to the rst docs, same as other short aliases.

Aside from that and the inline comment, LGTM.

llvm/test/tools/llvm-symbolizer/version.test
4

It probably makes sense to test the -v alias for llvm-symbolizer too, I reckon. Since we're adding support for it, we don't want to drop the alias in the future probably.

MaskRay updated this revision to Diff 284382.Aug 10 2020, 8:15 AM
MaskRay marked an inline comment as done.

Test llvm-symbolizer -v

Add -v to llvm-symbolizer.rst

jhenderson accepted this revision.Aug 10 2020, 8:16 AM
This revision was landed with ongoing or failed builds.Aug 10 2020, 8:21 AM
This revision was automatically updated to reflect the committed changes.