Skip to content

Commit 1f7a5a3

Browse files
committed
Avoid checking NoLifetimeMarkersForTemporaries
1 parent 9dc7e8d commit 1f7a5a3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

clang/lib/CodeGen/CGCall.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6312,10 +6312,11 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
63126312
for (CallLifetimeEnd &LifetimeEnd : CallLifetimeEndAfterCall)
63136313
LifetimeEnd.Emit(*this, /*Flags=*/{});
63146314

6315-
if (!CGM.getCodeGenOpts().NoLifetimeMarkersForTemporaries)
6316-
for (const CallArgList::EndLifetimeInfo &LT :
6317-
CallArgs.getLifetimeCleanups())
6318-
EmitLifetimeEnd(LT.Addr);
6315+
// Add lifetime end markers for any temporary aggregates. Under
6316+
// NoLifetimeMarkersForTemporaries LifetimeCleanups will be empty, so this is
6317+
// still correct.
6318+
for (const CallArgList::EndLifetimeInfo &LT : CallArgs.getLifetimeCleanups())
6319+
EmitLifetimeEnd(LT.Addr);
63196320

63206321
if (!ReturnValue.isExternallyDestructed() &&
63216322
RetTy.isDestructedType() == QualType::DK_nontrivial_c_struct)

0 commit comments

Comments
 (0)