diff options
author | Akira Hatanaka <ahatanaka@apple.com> | 2019-11-20 18:13:44 -0800 |
---|---|---|
committer | ahatanak <ahatanaka@apple.com> | 2020-03-20 18:34:22 -0700 |
commit | d35a454170da3da9c9bb0b5627f5796113195283 (patch) | |
tree | 156aea7f797256e7aa2cb7c706abd4305a74c659 /clang/lib/CodeGen/CGClass.cpp | |
parent | be10b7e43a3a10fbd3244f826591f3f65c0b7e21 (diff) | |
download | llvm-d35a454170da3da9c9bb0b5627f5796113195283.zip llvm-d35a454170da3da9c9bb0b5627f5796113195283.tar.gz llvm-d35a454170da3da9c9bb0b5627f5796113195283.tar.bz2 |
[CodeGen] Emit destructor calls to destruct non-trivial C struct objects
returned by function calls or loaded from volatile objects
rdar://problem/51867864
Differential Revision: https://reviews.llvm.org/D66094
Diffstat (limited to 'clang/lib/CodeGen/CGClass.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGClass.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGClass.cpp b/clang/lib/CodeGen/CGClass.cpp index acc9a9e..73c522a 100644 --- a/clang/lib/CodeGen/CGClass.cpp +++ b/clang/lib/CodeGen/CGClass.cpp @@ -2869,7 +2869,9 @@ void CodeGenFunction::EmitForwardingCallToLambda( if (!resultType->isVoidType() && calleeFnInfo.getReturnInfo().getKind() == ABIArgInfo::Indirect && !hasScalarEvaluationKind(calleeFnInfo.getReturnType())) - returnSlot = ReturnValueSlot(ReturnValue, resultType.isVolatileQualified()); + returnSlot = + ReturnValueSlot(ReturnValue, resultType.isVolatileQualified(), + /*IsUnused=*/false, /*IsExternallyDestructed=*/true); // We don't need to separately arrange the call arguments because // the call can't be variadic anyway --- it's impossible to forward |