This is an archive of the discontinued LLVM Phabricator instance.

Mangled class additions for handling language dependent demangling cases
AbandonedPublic

Authored by KLapshin on Feb 4 2015, 7:27 AM.

Details

Summary

This patch includes following changes:

•Add Language member to Mangled class with corresponding constructor. Minor refactoring in places where Mangled instances used.
•Function name demangling depending on its compile unit actual language - for example taking Pascal and Java namespace separator into account.
•Enable demangling for case if function/sym language still unknown at moment when demangling requested.
•Flag indicating known language was set added. Demangler now is able to re-demangle given sym name if it language was actualized since Mangled object creation. Demangling against unknown language is allowed because in lldb unknown language means C++/ObjC in most cases implicitly.

Diff Detail

Repository
rL LLVM

Event Timeline

KLapshin updated this revision to Diff 19318.Feb 4 2015, 7:27 AM
KLapshin retitled this revision from to Mangled class additions for handling language dependent demangling cases.
KLapshin updated this object.
KLapshin edited the test plan for this revision. (Show Details)
KLapshin added reviewers: clayborg, zturner, ki.stfu.
KLapshin set the repository for this revision to rL LLVM.
KLapshin added a subscriber: KLapshin.
clayborg requested changes to this revision.Feb 4 2015, 10:51 AM
clayborg edited edge metadata.

As I stated in another change that was submitted, nothing can be added to the Mangled class. It is used in lldb_private::Symbol and this is one of the largest contributor to memory in LLDB.

The language should be able to be calculated on the fly using the mangled name. We already have an accessor that can get the language from a mangled name and that should be made to work.

To be very clear: no new members in the Mangled class.

This revision now requires changes to proceed.Feb 4 2015, 10:51 AM
dawn added a subscriber: dawn.Feb 4 2015, 12:22 PM
ki.stfu edited edge metadata.Feb 4 2015, 3:20 PM
ki.stfu added a subscriber: Unknown Object (MLST).

Hello Greg,

Thank you so much for review, I got your main points regarding how language should be taken into account in demangling - your proposal is do demangling upon mangled string prefixes stored in mangled string by itself, not on additional members (flags and Language) in Mangled class.

So my patch should be redesigned from scratch.

Thank you.

KLapshin abandoned this revision.Feb 5 2015, 7:55 AM

Patch recalled due to concept was not accepted as good enough to apply.