Skip to content

Commit 764b73c

Browse files
committed
Use more accurate comment
1 parent 503dc33 commit 764b73c

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
@@ -4962,10 +4962,13 @@ void CodeGenFunction::EmitCallArg(CallArgList &args, const Expr *E,
49624962
}
49634963

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

0 commit comments

Comments
 (0)