[PATCH] [ms-cxxabi] Remove hack from GetAddrOfCXXDestructor for complete dtors
Timur Iskhodzhanov
timurrrr at google.com
Thu Oct 10 09:45:12 PDT 2013
2013/10/10 Reid Kleckner <rnk at google.com>:
> - // classes with no virtual bases, so try to emit it as an alias.
> - if (dtorType == Dtor_Complete &&
> - !dtor->getParent()->getNumVBases() &&
> - !TryEmitDefinitionAsAlias(GlobalDecl(dtor, Dtor_Complete),
> - GlobalDecl(dtor, Dtor_Base)))
> + // classes with no virtual bases, so try to emit it as an alias or just
> skip
> + // entirely if the ABI doesn't need it.
> + if (dtorType == Dtor_Complete && dtor->getParent()->getNumVBases() == 0
> &&
> + (getCXXABI().useThunkForDtorVariant(dtor, Dtor_Complete) ||
> + !TryEmitDefinitionAsAlias(GlobalDecl(dtor, Dtor_Complete),
> + GlobalDecl(dtor, Dtor_Base))))
>
> One thing that worries me about this is, how do we guarantee that Dtor_Base
> gets emitted?
EmitCXXDestructor(Dtor_Base) will be called if you define a dtor out-of-line.
Are you worried about the in-line case?
Another way is to override the type with Base when handling
EmitCXXDestructor(Complete)
and exit in EmitCXXDestructor(Base).
-
btw, I've landed the addition of -fno-rtti to sret-and-byval.cpp in r192359.
More information about the cfe-commits
mailing list