llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.44k stars 11.76k forks source link

llvm-cxxfilt help text/documentation conflates "gnu" (legacy) format with Itanium #81209

Open hubert-reinterpretcast opened 8 months ago

hubert-reinterpretcast commented 8 months ago

The documentation claims:

llvm-cxxfilt is a symbol demangler that can be used as a replacement for the GNU c++filt tool.

llvm-cxxfilt claims to support gnu "GNU/Itanium" style mangling; however, gnu is not Itanium-style mangling for GNU c++filt (gnu-v3 is).

For example:

$ c++filt --format=gnu foo__Fv _Z3foov
foo(void)
_Z3foov
$ c++filt --format=gnu-v3 foo__Fv _Z3foov
foo__Fv
foo()

From the output of llvm-cxxfilt --help:

  --format=<value>      Specify mangling format. Currently ignored because only 'gnu' is supported

and in the documentation (https://llvm.org/docs/CommandGuide/llvm-cxxfilt.html):

--format=, -s Mangling scheme to assume. Valid values are auto (default, auto-detect the style) and gnu (assume GNU/Itanium style).

It seems an update from gnu to gnu-v3 is in order. The option does not appear to check what is passed to it, so it is probably just an update to the text.

llvmbot commented 8 months ago

@llvm/issue-subscribers-tools-llvm-cxxfilt

Author: Hubert Tong (hubert-reinterpretcast)

The documentation claims: > `llvm-cxxfilt` is a symbol demangler that can be used as a replacement for the GNU `c++filt` tool. `llvm-cxxfilt` claims to support `gnu` "GNU/Itanium" style mangling; however, `gnu` is not Itanium-style mangling for GNU `c++filt` (`gnu-v3` is). For example: ``` $ c++filt --format=gnu foo__Fv _Z3foov foo(void) _Z3foov $ c++filt --format=gnu-v3 foo__Fv _Z3foov foo__Fv foo() ``` From the output of `llvm-cxxfilt --help`: ``` --format=<value> Specify mangling format. Currently ignored because only 'gnu' is supported ``` and in the documentation (https://llvm.org/docs/CommandGuide/llvm-cxxfilt.html): > `--format=`<value>, `-s` > Mangling scheme to assume. Valid values are auto (default, auto-detect the style) and gnu (assume GNU/Itanium style). It seems an update from `gnu` to `gnu-v3` is in order. The option does not appear to check what is passed to it, so it is probably just an update to the text.
dwblaikie commented 8 months ago

Sounds OK to me

hubert-reinterpretcast commented 8 months ago

Sounds OK to me

@dwblaikie, I'm having trouble understanding the comment. Does this mean that you are unconcerned with the (currently documentation-only) discrepancy between llvm-cxxfilt and GNU c++filt? Or does it mean "PR welcome" (but no hurry to fix)?

dwblaikie commented 8 months ago

PR welcome (: sorry for the ambiguity