[all-commits] [llvm/llvm-project] cae3b8: [llvm-nm] Switch command line parsing from llvm::c...

Fangrui Song via All-commits all-commits at lists.llvm.org
Wed Jul 7 13:34:50 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cae3b831f4304d4487dd7c767ff88face51ea0dc
      https://github.com/llvm/llvm-project/commit/cae3b831f4304d4487dd7c767ff88face51ea0dc
  Author: Fangrui Song <i at maskray.me>
  Date:   2021-07-07 (Wed, 07 Jul 2021)

  Changed paths:
    M llvm/docs/CommandGuide/llvm-nm.rst
    M llvm/docs/ReleaseNotes.rst
    M llvm/test/Object/nm-universal-binary.test
    M llvm/test/tools/llvm-nm/X86/radix.s
    M llvm/test/tools/llvm-nm/format-bsd.test
    M llvm/test/tools/llvm-nm/format-sysv-layout.test
    M llvm/test/tools/llvm-nm/help.test
    M llvm/test/tools/llvm-nm/just-symbols.test
    M llvm/test/tools/llvm-nm/libtool-version.test
    M llvm/tools/llvm-nm/CMakeLists.txt
    A llvm/tools/llvm-nm/Opts.td
    M llvm/tools/llvm-nm/llvm-nm.cpp
    M llvm/utils/gn/secondary/llvm/tools/llvm-nm/BUILD.gn
    M utils/bazel/llvm-project-overlay/llvm/BUILD.bazel

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

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

Users should generally observe no difference as long as they only use intended
option forms. Behavior changes:

* `-t=d` is removed. Use `-t d` instead.
* `--demangle=0` cannot be used. Omit the option or use `--no-demangle` instead.
* `--help-list` is removed. This is a `cl::` specific option.

Note:

* `-t` diagnostic gets improved.
* This patch avoids cl::opt collision if we decide to support multiplexing for binary utilities
* One-dash long options are still supported.
* The `-s` collision (`-s segment section` for Mach-O) is unfortunate. `-s` means `--print-armap` in GNU nm.
* This patch removes the last `cl::multi_val` use case from the `llvm/lib/Support/CommandLine.cpp` library

`-M` (`--print-armap`), `-U` (`--defined-only`), and `-W` (`--no-weak`)
are now deprecated. They could conflict with future GNU nm options.
(--print-armap has an existing alias -s, so GNU will unlikely add a new one.
--no-weak (not in GNU nm) is rarely used anyway.)

`--just-symbol-name` is now deprecated in favor of
`--format=just-symbols` and `-j`.

Reviewed By: jhenderson

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




More information about the All-commits mailing list