Skip to content

Commit 764a10c

Browse files
committed
Use more accurate comment
1 parent e0f9bcc commit 764a10c

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

clang/lib/CodeGen/CGCall.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4949,10 +4949,13 @@ void CodeGenFunction::EmitCallArg(CallArgList &args, const Expr *E,
49494949
}
49504950

49514951
AggValueSlot ArgSlot = AggValueSlot::ignored();
4952-
// If the callee returns a reference, skip this stack saving optimization;
4953-
// we don't want to prematurely end the lifetime of the temporary. It may be
4954-
// possible to still perform this optimization if the return type is a
4955-
// reference to a different type than the parameter.
4952+
// For arguments with aggregate type, create an alloca to store
4953+
// the value. If the argument's type has a destructor, that destructor
4954+
// will run at the end of the full-expression; emit matching lifetime
4955+
// markers.
4956+
//
4957+
// FIXME: For types which don't have a destructor, consider using a
4958+
// narrower lifetime bound.
49564959
if (hasAggregateEvaluationKind(E->getType())) {
49574960
RawAddress ArgSlotAlloca = Address::invalid();
49584961
ArgSlot = CreateAggTemp(E->getType(), "agg.tmp", &ArgSlotAlloca);

0 commit comments

Comments
 (0)