1 // Origin: Mark Mitchell <mark@codesourcery.com>
3 #if defined (__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100
12 struct S1 : virtual public S0
17 struct S2 : virtual public S1
28 struct S4 : public S3, virtual public S2
57 /* The vtables should look like:
109 S2-in-S4 secondary vtable
122 // These are tricks to allow us to get raw function pointers for
135 // Set vtbl to point at the beginning of S4's primary vtable.
136 vptr = (ptrdiff_t **) &s4;
140 if (*vtbl++ != ((char*) (S0*) &s4) - (char*) &s4)
142 if (*vtbl++ != ((char*) (S1*) &s4) - (char*) &s4)
144 if (*vtbl++ != ((char*) (S2*) &s4) - (char*) &s4)
148 // Skip the RTTI entry.
150 if (*vtbl++ != (ptrdiff_t) &s3__2S3)
152 if (*vtbl++ != (ptrdiff_t) &s1__2S4)
154 // The S1 vbase offset.
157 // The S4::s1 vcall offset is negative; once you convert to S2, you
158 // have to convert to S4 to find the final overrider.
159 if (*vtbl++ != ((char*) &s4 - (char*) (S2*) &s4))
165 // Now we're at the S2 offset to top entry.
166 if (*vtbl++ != ((char*) &s4 - (char*) (S2*) &s4))
168 // Skip the RTTI entry.
170 // Skip the remaining virtual functions -- they are thunks.
175 #else /* !(defined (__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100) */
181 #endif /* !(defined (__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100) */