[llvm-size] Switch command line parsing from llvm::cl to OptTable
authorFangrui Song <i@maskray.me>
Fri, 9 Jul 2021 17:26:53 +0000 (10:26 -0700)
committerFangrui Song <i@maskray.me>
Fri, 9 Jul 2021 17:26:53 +0000 (10:26 -0700)
commit47db32e542eb84ca9d4bed798bbdfd40200ac1ef
tree8517a49741d5403e3488773b40d0d0fa8269a3cc
parent214f63b2729d06f8d071f0fe86a8649ba880046c
[llvm-size] 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"

* `--totals=false` and `--totals=0` cannot be used. Omit the option.
* `--help-list` is removed. This is a `cl::` specific option.

OptTable avoids global option collision if we decide to support multiplexing for binary utilities.

Note: because the tool is simple, and its long options are uncommon, I just drop
the one-dash forms except `-arch <value>` (Darwin style).

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D105598
llvm/docs/CommandGuide/llvm-size.rst
llvm/test/tools/llvm-size/help.test
llvm/test/tools/llvm-size/radix.test
llvm/test/tools/llvm-size/unknown-format.test
llvm/tools/llvm-size/CMakeLists.txt
llvm/tools/llvm-size/Opts.td [new file with mode: 0644]
llvm/tools/llvm-size/llvm-size.cpp
llvm/utils/gn/secondary/llvm/tools/llvm-size/BUILD.gn
utils/bazel/llvm-project-overlay/llvm/BUILD.bazel