[PATCH] D104889: [llvm-strings] Switch command line parsing from llvm::cl to OptTable

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 24 17:36:34 PDT 2021


MaskRay created this revision.
MaskRay added reviewers: compnerd, jhenderson.
Herald added subscribers: rupprecht, mgorny.
MaskRay requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Some behavior changes:

- `-t=d` is removed. Use `-t d` instead.
- one-dash long options like `-all` are supported. Use `--all` instead.
- `--all=0` or `--all=false` cannot be used.
- `--help-list` is removed. This is a `cl::` specific option.

Nobody is likely leveraging any of the above.

Advantages:

- `-t` diagnostic gets improved.
- in the absence of `HideUnrelatedOptions`, `--help` will not list unrelated options if linking against libLLVM-13git.so or linker GC is not used.
- Decrease the probability of cl::opt collision if we do decide to support multiplexing


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D104889

Files:
  llvm/test/tools/llvm-strings/grouped.test
  llvm/test/tools/llvm-strings/help.test
  llvm/test/tools/llvm-strings/length.test
  llvm/test/tools/llvm-strings/radix.test
  llvm/tools/llvm-strings/CMakeLists.txt
  llvm/tools/llvm-strings/Opts.td
  llvm/tools/llvm-strings/llvm-strings.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104889.354403.patch
Type: text/x-patch
Size: 10974 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210625/53441414/attachment.bin>


More information about the llvm-commits mailing list