- // 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? On Thu, Oct 10, 2013 at 9:27 AM, Timur Iskhodzhanov <[email protected]>wrote: > I think supporting destructor aliases for classes that have just one > destructor is a wrong thing to do. > > Please take a look at my alternative patch? > > 2013/10/9 Reid Kleckner <[email protected]>: > > Hi timurrrr, > > > > Now that -mconstructor-aliases works for linkonce functions, we should > > use aliases instead. This makes our code less consistent with MSVC's > > code, but that was never really a goal. > > > > http://llvm-reviews.chandlerc.com/D1872 > > > > Files: > > lib/CodeGen/CGCXX.cpp > > test/CodeGenCXX/microsoft-abi-exceptions.cpp > > test/CodeGenCXX/microsoft-abi-sret-and-byval.cpp > > test/CodeGenCXX/microsoft-abi-static-initializers.cpp > > test/CodeGenCXX/microsoft-abi-structors.cpp >
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
