[all-commits] [llvm/llvm-project] 103512: [llvm-objdump] Switch command-line parsing from ll...

Nico Weber via All-commits all-commits at lists.llvm.org
Wed Apr 14 17:12:49 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1035123ac50db21bb2f44f78c040a823d7d064b2
      https://github.com/llvm/llvm-project/commit/1035123ac50db21bb2f44f78c040a823d7d064b2
  Author: Nico Weber <thakis at chromium.org>
  Date:   2021-04-14 (Wed, 14 Apr 2021)

  Changed paths:
    M llvm/test/Support/check-default-options.txt
    M llvm/test/tools/llvm-objdump/X86/source-interleave-prefix.test
    M llvm/test/tools/llvm-objdump/help.test
    M llvm/test/tools/llvm-objdump/section-filter.test
    M llvm/tools/llvm-objdump/CMakeLists.txt
    M llvm/tools/llvm-objdump/MachODump.cpp
    M llvm/tools/llvm-objdump/MachODump.h
    A llvm/tools/llvm-objdump/ObjdumpOptID.h
    A llvm/tools/llvm-objdump/ObjdumpOpts.td
    M llvm/tools/llvm-objdump/llvm-objdump.cpp
    M llvm/tools/llvm-objdump/llvm-objdump.h
    M llvm/utils/gn/secondary/llvm/tools/llvm-objdump/BUILD.gn

  Log Message:
  -----------
  [llvm-objdump] Switch command-line parsing from llvm::cl to OptTable

This is similar to D83530, but for llvm-objdump.

The motivation is the desire to add an `llvm-otool` symlink to
llvm-objdump that behaves like macOS's `otool`, using the same
technique the at llvm-objcopy uses to behave like `strip` (etc).

This change for the most part preserves behavior. In some cases,
it increases compatibility with GNU objdump a bit. For example,
the long options now require two dashes, and the long options
taking arguments for the most part now require a `=` in front
of the value. Exceptions are flags where tests passed the
value separately, for these the separate form is kept as
an alias to the = form.

The one-letter short form args are now joined or separate
and long longer accept a =, which also matches GNU objdump.

cl::opt<>s in libraries now have to be explicitly plumbed
through. This patch does that for --x86-asm-syntax=, but
there's hope that we can remove that again.

Differential Revision: https://reviews.llvm.org/D100433




More information about the All-commits mailing list