C++ ABI for IA-64: Code and Implementation Examples
Revised 5 September 2000
Introduction
In this document,
we provide a number of code examples as illustration or tests
for the ABI specifications.
Contents
Class definition | Vtable 1 contents | Vtable 2 contents |
---|---|---|
|
Class X is an auxiliary class to be used only to prevent interesting classes from being primary bases later. | |
|
Vtable A | |
&A::f | ||
|
Vtable A_in_B | |
&A::f | ||
|
Vtable A_in_C (primary) | |
&C::f | ||
|
Vtable A_in_D | |
&A::f | ||
|
Vtable A_in_E | Vtable E |
&thunk(A*,E::f) | &E::f | |
|
Vtable A_in_G | |
&A::f | ||
|
Vtable A_in_H | Vtable H |
&thunk(A*,H::f) vcall(H::A*,H*,f) |
&H::f | |
|
Vtable A_in_I | Vtable H_in_I |
&thunk(A*,H::f) vcall(I::A*,I::H*,f) |
&H::f |
Mangled name (ignore spaces) |
Source name |
---|---|
f | C function or variable "f" or a global namespace variable "f" |
_Z1fv | Ret? f(); or Ret? f(void); |
_Z1fi | Ret? f(int); |
_Z3foo3bar | Ret? foo(bar); |
_Zrm1XS_ | Ret? operator%(X, X); |
_ZplR1XS0_ | Ret? operator+(X&, X&); |
_ZlsRK1XS1_ | Ret? operator<< (X const&, X const&);
(Note: X is S_, X const is S0_) |
_ZN3FooIA4_iE3barE | Type? Foo<int[4]>::bar; |
_Z1fIiEvi | void f<int>(/*nondependent*/int);
(Note: the return type is always explicitly encoded for template functions taking parameters.) |
_Z5firstI3DuoEvS0_ | void first<Duo>(/*nondependent*/Duo);
(Note: first template is S_, Duo is S0_, first Since the function parameter is not dependent, don't use T_.) |
_Z5firstI3DuoEvT_ | void first<Duo>(/*T1=*/Duo); |
_Z3fooIiPFidEiEvv | void foo<int,int(*)(double),int>();
(Note: return type encoded for template function.) |
_ZN1N1fE | Type? N::f |
_ZN6System5Sound4beepEv | Ret? System::Sound::beep(); |
_ZN5Arena5levelE | Type? Arena::level; |
_ZN5StackIiiE5levelE | Type? Stack<int, int>::level; |
_Z1fI1XE vPV N1AIT_E1TE | void f<X>(A</*T1=*/X>::T volatile*); |
_ZngILi42EE v N1A I XplT_Li2EE E 1TE | void operator-</*int J=*/42>(A<J+2>::T); |
_Z4makeI7FactoryiE T_IT0_E v | /*T1=*/Factory</*T2=*/int> make<Factory, int>();
(Note: T_ = factory (a template), T0_ = int) |
_Z3foo 5Hello5WorldS0_S_ | Type? foo(Hello,World,World,Hello)
(Note: Hello is S_, World is S0_, foo(...) is S1_) |
_Z3fooPM2ABi | foo(int AB::**)
// M is a pointer, P adds another level |
_ZlsRSoRKSs | operator<< (std::ostream&,std::string const&) |
_ZTI7a_class | typeid(class a_class) |
Please send corrections to Mark Mitchell.