This is an archive of the discontinued LLVM Phabricator instance.

[lld-macho][nfc] lld/Common's `demangle()` is redundant for Mach-O
ClosedPublic

Authored by int3 on Oct 13 2022, 11:04 PM.

Details

Summary

The only thing that the Common implementation does is a check for
config->demangle, but D135189: [lld/mac] With -demangle, strip leading _ from non-mangled names added that check to
maybeDemangleSymbol, so there's no need to go through Common...

Diff Detail

Event Timeline

int3 created this revision.Oct 13 2022, 11:04 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptOct 13 2022, 11:04 PM
int3 requested review of this revision.Oct 13 2022, 11:04 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 13 2022, 11:04 PM
MaskRay accepted this revision as: MaskRay.Oct 14 2022, 11:13 AM
This revision is now accepted and ready to land.Oct 14 2022, 11:13 AM
oontvoo added inline comments.
lld/MachO/Symbols.cpp
35

nit: demangle(symName.str().c_str()); ? (no need to make a new std::string?)

int3 added inline comments.Oct 14 2022, 12:04 PM
lld/MachO/Symbols.cpp
35

demangle takes an std::string, so this would construct two std::strings :)

I can change it to .str() though