]> granicus.if.org Git - clang/commit
MS ABI: Properly call global delete when invoking virtual destructors
authorDavid Majnemer <david.majnemer@gmail.com>
Fri, 31 Oct 2014 20:09:12 +0000 (20:09 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Fri, 31 Oct 2014 20:09:12 +0000 (20:09 +0000)
commitce0076c36cb194e8b0872caf0895b4105625a70e
tree763ec3559e9bd050994004b97c684f7e7a6b0c89
parent79ac9731ab5c5a20dc68ec83d83b312137921302
MS ABI: Properly call global delete when invoking virtual destructors

Summary:
The Itanium ABI approach of using offset-to-top isn't possible with the
MS ABI, it doesn't have that kind of information lying around.

Instead, we do the following:
- Call the virtual deleting destructor with the "don't delete the object
  flag" set.  The virtual deleting destructor will return a pointer to
  'this' adjusted to the most derived class.
- Call the global delete using the adjusted 'this' pointer.

Reviewers: rnk

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D5996

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220993 91177308-0d34-0410-b5e6-96231b3b80d8
12 files changed:
lib/CodeGen/CGCXXABI.h
lib/CodeGen/CGCall.cpp
lib/CodeGen/CGExprCXX.cpp
lib/CodeGen/CGVTables.cpp
lib/CodeGen/CodeGenFunction.cpp
lib/CodeGen/CodeGenFunction.h
lib/CodeGen/ItaniumCXXABI.cpp
lib/CodeGen/MicrosoftCXXABI.cpp
test/CodeGenCXX/dllexport.cpp
test/CodeGenCXX/microsoft-abi-structors.cpp
test/CodeGenCXX/microsoft-abi-thunks.cpp
test/CodeGenCXX/microsoft-abi-virtual-inheritance.cpp