[PATCH] D139864: [AIX] Demangle the name prefix with '.' in AIX OS for llvm-cxxfilt
James Henderson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 1 00:07:42 PST 2023
jhenderson added inline comments.
================
Comment at: llvm/tools/llvm-cxxfilt/llvm-cxxfilt.cpp:72
+ // In XCOFF, Function entry lable begin with '.'.
+ if (Triple(sys::getProcessTriple()).isOSBinFormatXCOFF() && DecoratedStr[0] == '.') {
+ ++DecoratedStr;
----------------
DiggerLin wrote:
> DiggerLin wrote:
> > jhenderson wrote:
> > > DiggerLin wrote:
> > > > stephenpeckham wrote:
> > > > > Wouldn't it make more sense to introduce a StripDot variable similar to StripUnderscore?
> > > > we do not do StripDot, we just demangle the symbol begin with "dot" if there is. (and this is xcoff specific option) I checked AIX clangtana cxxfilt, it do not has an option for "demangling the symbol begin with 'dot') . So I think we also do not need an option here and not need to introduce a new variable "StripDot".
> > > >
> > > I'm ambivalent about whether there's a `--strip-dot` option (it could be on by default for AIX, and off otherwise). The advantage with having it is that it would be possible to demangle a binary designed for AIX OS on a different platform.
> > >
> > > Also "lable" -> "label".
> > I checked the gnu cxxfilt (in linux OS), it can demangle ._Z3foov to .foo() as you mention in your patch https://reviews.llvm.org/D63722?id=206236#inline-567977
> >
> > I am not sure whether we can enable to decode the name prefixed with '.' by default without any new option for all OS platform ? @James Henderson
> sorry , above comment should be " I checked the gnu c++filt (in linux OS), it can demangle ._Z3foov to .foo() as you mention in your patch ......." @jhenderson
> I am not sure whether we can enable to decode the name prefixed with '.' by default without any new option for all OS platform
I would imagine it would work similarly to how --strip-underscore works, which IIRC is intended to help on Mac. On non-AIX OS, the --strip-dot option would be off by default, so that users don't have the behaviour unless they opt into it. On AIX OS it would be on by default, so users don't have to remember to specify it. Testing would be slightly complicated: you'd need to have testing that shows that the option is off/on by default on the respective OS types, with the rest of the tests having to handle it being in either state. You'd also need to consider how --strip-underscore interacts with it.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D139864/new/
https://reviews.llvm.org/D139864
More information about the llvm-commits
mailing list