[PATCH] [ms-cxxabi] Implement vbtable name mangling
John McCall
rjmccall at apple.com
Fri Apr 12 11:42:46 PDT 2013
On Apr 12, 2013, at 10:59 AM, Reid Kleckner <rnk at google.com> wrote:
> On Wed, Apr 10, 2013 at 4:12 PM, John McCall <rjmccall at apple.com> wrote:
>> On Apr 6, 2013, at 3:44 PM, Reid Kleckner <rnk at google.com> wrote:
>>> + virtual void mangleCXXVBTable(const CXXRecordDecl *Derived,
>>> + llvm::ArrayRef<const CXXRecordDecl *> BasePath,
>>
>> This needs to be a path of CXXBaseSpecifier*s. One, that's probably
>> more straightforward to create, and two, there's an ambiguity here that
>> it'd clean up.
>
> Should I be rolling my own recursion here to discover all unique
> subobjects, or is there some method on CXXBasePaths I should be
> calling to generate these?
A CXXBasePathElement stores the Base.
>> For example:
>> struct A { int x; };
>> struct B : virtual A {}; // vbptrs: B
>> struct C : virtual B {}; // vbptrs: C, virtual B in C
>> struct D : B, C {}; // vbptrs: B in D, C in D, virtual B in D
>>
>> Incidentally, how would these actually be mangled?
>
> That program gives:
> error C2584: 'D' : direct base 'B' is inaccessible; already a base of 'C'
Oh, right, yes, sorry.
> I can indirect B through a non-virtual base, though:
> struct A { int a; };
> struct B : virtual A { int b; };
> struct C : virtual B { int c; };
> struct BB : B { }; // Indirection =/
> struct D : BB, C { int d; };
> D d; // Force vbtable emission.
>
> That gives these manglings:
>
> ??_8B@@7B@
> ??_8C@@7B0@@
> ??_8C@@7BB@@@
> ??_8BB@@7B@
>
> // D's vbtables:
> ??_8D@@7B@ // installed inside the non-virtual B
> ??_8D@@7BC@@@ // installed inside C
> ??_8D@@7BB@@@ // installed inside virtual B
I'm really not getting these manglings. The "...7BC..." in particular is really
throwing me off; is the "B" there a literal part of the mangling rather than a
class name?
John.
More information about the cfe-commits
mailing list