[PATCH] D105330: [llvm-nm] Switch command line parsing from llvm::cl to OptTable

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 2 10:28:42 PDT 2021


MaskRay added a comment.

In D105330#2854841 <https://reviews.llvm.org/D105330#2854841>, @jhenderson wrote:

> @gbreynoo, could you do a check to see if any of our internal code bases would be broken by the changes made in this patch?
>
> @MaskRay: not that I mind, but any particular reason single-dash long options are still supported for llvm-nm, but not other tools? That could be explained in the patch description, I think.

I am in favor of dropping support for single-dash long options, but just want to do it separately.
I expect most users will not observe any difference. `-t=d` `--demangle=0` are rare.

`nm -arch` is a Mach-O specific option which might be controversial:  https://lists.llvm.org/pipermail/llvm-dev/2021-July/151622.html

>> The -s collision (-s segment section for Mach-O) is unfortunate. -s means --print-armap in GNU nm.
>
> I wonder if (in a separate patch), we should add a long option and deprecate this short alias? Then, in a future release, we can switch the meaning over, whilst giving people a path forward to migrate any scripts they may have.

The problem is that Darwin nm uses `-s` differently from GNU nm.
For `-s` it is fine for me because `nm -s` is not used that much and I can remember to use `--print-armap`.
To my surprise Darwin nm and GNU nm do share many command line options... otherwise I guess we would need something similar to llvm-libtool-darwin.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105330/new/

https://reviews.llvm.org/D105330



More information about the llvm-commits mailing list