Page MenuHomePhabricator

Remove the is_mangled flag from Mangled and Symbol
ClosedPublic

Authored by aprantl on Tue, Oct 8, 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.Tue, Oct 8, 5:14 PM
aprantl updated this revision to Diff 223965.Tue, Oct 8, 5:29 PM

Updated unit test.

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

LGTM

This revision is now accepted and ready to land.Tue, Oct 8, 5:53 PM
labath accepted this revision.Wed, Oct 9, 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 TranscriptWed, Oct 9, 9:22 AM