Alien-LibJIT

 view release on metacpan or  search on metacpan

libjit/doc/mangling_rules.txt  view on Meta::CPAN


<class-enum-type>   ::= <name>

<template-args>     ::= I <template-arg>+ E

<expression>        ::= <unary operator-name> <expression>
                    ::= <binary operator-name> <expression> <expression>
                    ::= <expr-primary>

<expr-primary>      ::= <template-param>
                    ::= L <type> <value number> E  # literal
                    ::= L <mangled-name> E         # external name

<template-arg>      ::= <type>                        # type
                    ::= L <type> </value/ number> E   # literal
                    ::= LZ <name> E                   # external name
                    ::= X <expression> E              # expression
   
     Literal subcase of non-terminal <template-arg>.

     "Literal arguments, e.g. "A<42L>", are encoded with their type
     and value. Negative integer values are preceded with "n"; for
     example, "A<-42L>" becomes "1AILln42EE". The bool value false is
     encoded as 0, true as 1. If floating-point arguments are accepted
     as an extension, their values should be encoded using a
     fixed-length lowercase hexadecimal string corresponding to the
     internal representation (IEEE on IA-64), high-order bytes first,
     without leading zeroes. For example: "Lfbff000000E" is -1.0f."

<template-template-arg> ::= <name>
                        ::= <substitution>

<array-type>        ::= A [</dimension/ number>] _ </element/ type>
                    ::= A <expression> _ </element/ type>

     "Array types encode the dimension (number of elements) and the
     element type. For variable length arrays, the dimension (but not
     the '_' separator) is omitted."

<pointer-to-member-type> ::= M </class/ type> </member/ type>

<template-param>    ::= T </parameter/ number> _

<template-template-param> ::= <template-param>
                          ::= <substitution>

MSVC 6.0 name mangling rules (determined by trial and error):
------------------------------------------------------------

<global-function>	::= '?' <name> '@@Y' <callconv> <return-type> <parameters>

<member-function>	::= '?' <name> '@' <class-name> '@@' <access>
							[<const>] <callconv> <return-type> <parameters>

<ctor-function>		::= '??0' <class-name> '@@' <access> <const> <callconv>
							'@' <parameters>

<dtor-function>		::= '??1' <class-name> '@@' <access> <const> <callconv>
							'@' <parameters>

<access>			::= 'Q'				# public instance
					::= 'I'				# protected instance
					::= 'A'				# private instance
					::= 'S'				# public static
					::= 'K'				# protected static
					::= 'C'				# private static
					::= 'U'				# public virtual
					::= 'M'				# protected virtual
					::= 'E'				# private virtual

<callconv>			::= 'A'				# cdecl
					::= 'E'				# thiscall
					::= 'G'				# stdcall
					::= 'I'				# fastcall

<const>				::= 'A'				# non-const method (instance only)
					::= 'B'				# const method (instance only)

<return-type>		::= 'X'				# void
					::= <type>

<parameters>		::= 'XZ'			# () or (void)
					::= <type>+ '@Z'	# 1 or more parameters
					::= <type>+ 'ZZ'	# 1 or more, followed by ...

<func-ptr>			::= <callconv> <return-type> <parameters>

<type>				::= <builtin-type>
					::= 'PA' <type>		# pointer to <type>
					::= 'PB' <type>		# const pointer to <type>
					::= 'PC' <type>		# volatile pointer to <type>
					::= 'PD' <type>		# const volatile pointer to <type>
					::= 'P6' <func-ptr>	# function pointer type
					::= 'AA' <type>		# reference to <type>
					::= 'AB' <type>		# const reference to <type>
					::= 'AC' <type>		# volatile reference to <type>
					::= 'AD' <type>		# const volatile reference to <type>
					::= 'T' <name> '@@'	# union name
					::= 'U' <name> '@@'	# struct name
					::= 'V' <name> '@@'	# class name
					::= 'W' <digit> <name> '@@' # enum of a given byte size
					::= <digit>			# backref to identifier 'n' in name

<builtin-type>		::= 'D'				# char
					::= 'C'				# signed char
					::= 'E'				# unsigned char
					::= 'F'				# short
					::= 'G'				# unsigned short
					::= 'H'				# int
					::= 'I'				# unsigned int
					::= 'J'				# long
					::= 'K'				# unsigned long
					::= '_J'			# __int64
					::= '_K'			# unsigned __int64
					::= 'M'				# float
					::= 'N'				# double
					::= 'O'				# long double

<class-name>		::= <name>
					::= <identifier> '@' <name>
					::= <digit> <name>
								# namespaces listed in reverse order
								# i.e. "X::Y::Z" becomes "Z@Y@X".

<name>				::= <identifier>
					::= <digit>			# backref to identifier 'n' in name



( run in 1.301 second using v1.01-cache-2.11-cpan-5623c5533a1 )