This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Objective-C name (de)mangling

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


MfG Kai

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]