This is an archive of the discontinued LLVM Phabricator instance.

[MS] Always use base dtors in place of complete/vbase dtors when possible
ClosedPublic

Authored by rnk on Mar 14 2018, 6:16 PM.

Details

Summary

Previously we tried too hard to uphold the fiction that destructor
variants work like they do on Itanium throughout the ABI-neutral parts
of clang. This lead to MS C++ ABI incompatiblities and other bugs. Now,
-mconstructor-aliases will no longer control this ABI detail, and clang
-cc1's LLVM IR output will be this much closer to the clang driver's.

Based on a patch by Zahira Ammarguellat:

https://reviews.llvm.org/D39063

I've tried to move the logic that Zahira added into MicrosoftCXXABI.cpp.
There is only one ABI-specific detail sticking out, and that is in
CodeGenModule::getAddrOfCXXStructor, where we collapse complete dtors to
base dtors in the MS ABI.

This fixes PR32990.

Diff Detail

Repository
rC Clang

Event Timeline

rnk created this revision.Mar 14 2018, 6:16 PM
rjmccall accepted this revision.Mar 15 2018, 6:34 PM

LGTM.

This revision is now accepted and ready to land.Mar 15 2018, 6:34 PM

LGTM 2. It fixes PR32990.

zahiraam accepted this revision.Mar 16 2018, 12:08 PM
This revision was automatically updated to reflect the committed changes.
rnk added a comment.Mar 16 2018, 12:46 PM

Thanks! I'm sorry I wasn't able to express these ideas better in D39063.

rnk added a comment.Mar 16 2018, 2:32 PM

And, this appears to have broken clang's self-host:
http://lab.llvm.org:8011/builders/clang-x86-windows-msvc2015/builds/10799

Time to debug.

rnk added a comment.Mar 16 2018, 3:34 PM

Should be fixed in rL327754.