[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
Fri Feb 17 01:04:18 PST 2023
jhenderson added a comment.
Please remember to upload your diff with full context.
================
Comment at: llvm/test/tools/llvm-cxxfilt/delimiters.test:35
COM: around this. See D111072.
-RUN: '_Z3Foo$ ._Z3Foo' > %t
+RUN: '_Z3Foo$' > %t
RUN: llvm-cxxfilt -n < %t | FileCheck %s
----------------
I don't think this test should be changing, except possibly to mark it unsupported on AIX (since we don't want the behaviour changing otherwise). You could have an AIX version of the test that shows the behaviour difference, I guess.
================
Comment at: llvm/test/tools/llvm-cxxfilt/with-dot-prefix-aix.test:5
+
+RUN: llvm-cxxfilt ._ZL5func0v ._Z5func1i | FileCheck %s -check-prefix CHECK
+
----------------
================
Comment at: llvm/test/tools/llvm-cxxfilt/with-dot-prefix-non-aix.test:1
+## Show the behaviour of demangling name with '.' prefix on Non-AIX os.
+REQUIRES: !system-aix
----------------
================
Comment at: llvm/test/tools/llvm-cxxfilt/with-dot-prefix-non-aix.test:2
+## Show the behaviour of demangling name with '.' prefix on Non-AIX os.
+REQUIRES: !system-aix
+
----------------
`UNSUPPORTED: system-aix` is perhaps more idiomatic.
================
Comment at: llvm/test/tools/llvm-cxxfilt/with-dot-prefix-non-aix.test:4
+
+RUN: llvm-cxxfilt ._ZL5func0v ._Z5func1i | FileCheck %s -check-prefix CHECK
+
----------------
================
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:
> 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".
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