[CodeGen] Add public function to emit C++ destructor call.
authorzoecarver <z.zoelec2@gmail.com>
Wed, 1 Jul 2020 17:57:45 +0000 (10:57 -0700)
committerzoecarver <z.zoelec2@gmail.com>
Wed, 1 Jul 2020 18:01:23 +0000 (11:01 -0700)
commite7c5da57a5f3fdb6649ff92cb8ba0ce3c4978668
tree2b0f5ded309ffc5da82378bce9571f51d2173f96
parentba3bafe46a474dca34155043c8cc0ea603db2214
[CodeGen] Add public function to emit C++ destructor call.

Adds `CodeGen::getCXXDestructorImplicitParam`, to retrieve a C++ destructor's implicit parameter (after the "this" pointer) based on the ABI in the given CodeGenModule.

This will allow other frontends (Swift, for example) to easily emit calls to object destructors with correct ABI semantics and calling convetions.

This is needed for Swift C++ interop. Here's the corresponding Swift change: https://github.com/apple/swift/pull/32291

Differential Revision: https://reviews.llvm.org/D82392
clang/include/clang/CodeGen/CodeGenABITypes.h
clang/lib/CodeGen/ABIInfo.h
clang/lib/CodeGen/CGCXXABI.h
clang/lib/CodeGen/CodeGenABITypes.cpp
clang/lib/CodeGen/ItaniumCXXABI.cpp
clang/lib/CodeGen/MicrosoftCXXABI.cpp