================
@@ -4947,7 +4948,23 @@ void CodeGenFunction::EmitCallArg(CallArgList &args,
const Expr *E,
return;
}
- args.add(EmitAnyExprToTemp(E), type);
+ AggValueSlot ArgSlot = AggValueSlot::ignored();
+ // If the callee returns a reference, skip this stack saving optimization;
----------------
ilovepi wrote:
This was brought up in https://reviews.llvm.org/D74094. In a complex
expression, a reference to the temporary could be returned (e.g. passed in via
a parameter and back out via return) and which is then used in another part of
the expression.
I left that logic (and comment) in place from the original patch, since it
seems to be to be conservative w.r.t. preserving the status quo.
https://github.com/llvm/llvm-project/pull/170517
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits