[PATCH] D44505: [MS] Always use base dtors in place of complete/vbase dtors when possible

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 14 18:18:14 PDT 2018


rnk created this revision.
rnk added reviewers: erichkeane, zahiraam, majnemer, rjmccall.

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.


https://reviews.llvm.org/D44505

Files:
  clang/lib/CodeGen/CGCXX.cpp
  clang/lib/CodeGen/CGCXXABI.cpp
  clang/lib/CodeGen/CGCXXABI.h
  clang/lib/CodeGen/CodeGenModule.cpp
  clang/lib/CodeGen/MicrosoftCXXABI.cpp
  clang/test/CodeGenCXX/cxx2a-destroying-delete.cpp
  clang/test/CodeGenCXX/debug-info-ms-dtor-thunks.cpp
  clang/test/CodeGenCXX/dllexport-dtor-thunks.cpp
  clang/test/CodeGenCXX/dllimport-dtor-thunks.cpp
  clang/test/CodeGenCXX/exceptions-cxx-new.cpp
  clang/test/CodeGenCXX/inheriting-constructor.cpp
  clang/test/CodeGenCXX/microsoft-abi-dynamic-cast.cpp
  clang/test/CodeGenCXX/microsoft-abi-methods.cpp
  clang/test/CodeGenCXX/regcall.cpp
  clang/test/CodeGenCoroutines/coro-eh-cleanup.cpp
  clang/test/CodeGenCoroutines/coro-promise-dtor.cpp
  clang/test/CodeGenCoroutines/coro-unhandled-exception.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44505.138485.patch
Type: text/x-patch
Size: 21283 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180315/4dc2166f/attachment-0001.bin>


More information about the cfe-commits mailing list