This is an archive of the discontinued LLVM Phabricator instance.

[NFC] refactor demangle of llvm-nm
AbandonedPublic

Authored by DiggerLin on Sep 21 2023, 1:28 PM.

Details

Summary

refactor demangle of llvm-nm .

Diff Detail

Event Timeline

DiggerLin created this revision.Sep 21 2023, 1:28 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 21 2023, 1:28 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
DiggerLin requested review of this revision.Sep 21 2023, 1:28 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 21 2023, 1:28 PM
MaskRay added a comment.EditedSep 21 2023, 1:52 PM

llvm::demangle is used by a lot of ELF tools to assume ELF style mangling where there is no extra prefix. I think many don't expect demangling ._Zxxxx symbols.
If XCOFF needs ., I think separate functions are needed. You can add a new utility function or extending demangle with an optional parameter about XCOFF.

DiggerLin added a comment.EditedSep 21 2023, 5:32 PM

llvm::demangle is used by a lot of ELF tools to assume ELF style mangling where there is no extra prefix. I think many don't expect demangling ._Zxxxx symbols.

I tried in gnu-c++filt in linux which is elf format in linux OS. it demangle ._Zxxxx symbols.

bash> /opt/at15.0/bin/powerpc64le-linux-gnu-c++filt ._ZL5func0v
.func0()

jhenderson added a comment.EditedSep 22 2023, 1:23 AM

This patch should have been created using a GitHub Pull Request. See the big red notice at the top of the page...

DiggerLin abandoned this revision.Sep 29 2023, 12:56 PM