This is an archive of the discontinued LLVM Phabricator instance.

Remove the is_mangled flag from Mangled and Symbol
ClosedPublic

Authored by aprantl on Oct 8 2019, 5:14 PM.

Details

Summary

Testing whether a name is mangled or not is extremely cheap and can be done by looking at the first two characters. Mangled knows how to do it. On the flip side, many call sites that currently pass in an is_mangled determination do not know how to correctly do it (for example, they leave out Swift mangling prefixes).

This patch removes this entry point and just forced Mangled to determine the mangledness of a string itself.

Diff Detail

Event Timeline

aprantl created this revision.Oct 8 2019, 5:14 PM
aprantl updated this revision to Diff 223965.Oct 8 2019, 5:29 PM

Updated unit test.

davide accepted this revision.Oct 8 2019, 5:53 PM
davide added a subscriber: davide.

LGTM

This revision is now accepted and ready to land.Oct 8 2019, 5:53 PM
labath accepted this revision.Oct 9 2019, 4:59 AM

Looks like a nice cleanup, if we can get away with that. I tried to come up with a situation where we would have a more authoritative source on whether something is mangled or not than just looking at the string, but I haven't come up with anything, so the answer is hopefully yes.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptOct 9 2019, 9:22 AM