]> granicus.if.org Git - clang/commit
[CodeGen] Do not push a destructor cleanup for a struct that doesn't
authorAkira Hatanaka <ahatanaka@apple.com>
Wed, 18 Apr 2018 23:33:15 +0000 (23:33 +0000)
committerAkira Hatanaka <ahatanaka@apple.com>
Wed, 18 Apr 2018 23:33:15 +0000 (23:33 +0000)
commit52ccd68b9a7052e64e89d8fbee94dd3bd01a5528
treef434cd17a16a382c2684bdd7968a84895a19e92c
parent4c8eda063b03450e54b88bdac1e91ca9be5acc2b
[CodeGen] Do not push a destructor cleanup for a struct that doesn't
have a non-trivial destructor.

This fixes a bug introduced in r328731 where CodeGen emits calls to
synthesized destructors for non-trivial C structs in C++ mode when the
struct passed to EmitCallArg doesn't have a non-trivial destructor.
Under Microsoft's ABI, ASTContext::isParamDestroyedInCallee currently
always returns true, so it's necessary to check whether the struct has a
non-trivial destructor before pushing a cleanup in EmitCallArg.

This fixes PR37146.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@330304 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGCall.cpp
test/CodeGenCXX/microsoft-abi-eh-cleanups.cpp