This is the mail archive of the
mailing list for the GCC project.
Objective-C name (de)mangling
- From: kaih at khms dot westfalen dot de (Kai Henningsen)
- To: gcc at gcc dot gnu dot org
- Date: 05 Jan 2004 20:02:00 +0200
- Subject: Objective-C name (de)mangling
- Comment: Unsolicited commercial mail will incur an US$100 handling fee per received mail.
- Organization: Organisation? Me?! Are you kidding?
Given how much work is currently done on the demanglers, and reviving
Objective-C++, maybe we ought to review the state of the art wrt.
Objective-C and name mangling.
I believe the demanglers currently handle C++ and (at least one of them)
Java, but not Objective-C. (Correct?)
Objective-C name mangling is fairly simple - perhaps too simple: it is not
always reversible in the face of original identifiers with underscores.
I know of the following mangling rules:
Class methods: _c_<classname>_<category>_<method>
Instance methods: _i_<classname>_<category>_<method>
where <method> is all parts of the selector name concatenated, and colons
translated to underscores.
That is, a mangled name of _i_class1__method2_arg2_ corresponds to a
__PRETTY_FUNCTION__ of "-[class1 method2:arg2:]".
Then there are various prefixes that get put in front of mangled names for
internal data, such as