[PATCH] D136998: Try to implement lambdas with inalloca parameters by inlining the call operator function.

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 14 16:00:30 PST 2022


rnk added a comment.

In D136998#3906874 <https://reviews.llvm.org/D136998#3906874>, @efriedma wrote:

> Should we try to use this codepath for variadic lambdas as well?

Yes!

> Do we want to try to unify our cloning code?  CodeGenFunction::GenerateVarArgsThunk has code doing something similar.  (It's at least worth comparing to see if you're doing something significantly different...)

Good idea

In D136998#3906881 <https://reviews.llvm.org/D136998#3906881>, @efriedma wrote:

> Might also be worth considering if we can avoid cloning here.  It should be possible to emit the lambda body into a separate function with a calling convention of your choice, and make both the call operator and the static invoker call it.

This would be nice. I wasn't able to provide guidance on how to do that, and I think Amy was struggling to synthesize a new method (`__invoke`, `__impl`) at the AST layer.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136998/new/

https://reviews.llvm.org/D136998



More information about the cfe-commits mailing list