aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CGVTables.cpp
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@apple.com>2019-11-20 18:13:44 -0800
committerahatanak <ahatanaka@apple.com>2020-03-20 18:34:22 -0700
commitd35a454170da3da9c9bb0b5627f5796113195283 (patch)
tree156aea7f797256e7aa2cb7c706abd4305a74c659 /clang/lib/CodeGen/CGVTables.cpp
parentbe10b7e43a3a10fbd3244f826591f3f65c0b7e21 (diff)
downloadllvm-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/CGVTables.cpp')
-rw-r--r--clang/lib/CodeGen/CGVTables.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGVTables.cpp b/clang/lib/CodeGen/CGVTables.cpp
index 412fc693..6a0a848 100644
--- a/clang/lib/CodeGen/CGVTables.cpp
+++ b/clang/lib/CodeGen/CGVTables.cpp
@@ -364,7 +364,8 @@ void CodeGenFunction::EmitCallAndReturnForThunk(llvm::FunctionCallee Callee,
ReturnValueSlot Slot;
if (!ResultType->isVoidType() &&
CurFnInfo->getReturnInfo().getKind() == ABIArgInfo::Indirect)
- Slot = ReturnValueSlot(ReturnValue, ResultType.isVolatileQualified());
+ Slot = ReturnValueSlot(ReturnValue, ResultType.isVolatileQualified(),
+ /*IsUnused=*/false, /*IsExternallyDestructed=*/true);
// Now emit our call.
llvm::CallBase *CallOrInvoke;