Skip to content

Commit aa32d94

Browse files
committed
Avoid checking NoLifetimeMarkersForTemporaries
1 parent 5d714bd commit aa32d94

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
@@ -6313,10 +6313,11 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
63136313
for (CallLifetimeEnd &LifetimeEnd : CallLifetimeEndAfterCall)
63146314
LifetimeEnd.Emit(*this, /*Flags=*/{});
63156315

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

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

0 commit comments

Comments
 (0)