akhuang added a comment.

In D137872#4327615 <https://reviews.llvm.org/D137872#4327615>, @efriedma wrote:

> I'm having a bit of trouble following how exactly the thunk creation is 
> working here... do we generate different code depending on whether the call 
> operator and/or the static invoker are referenced?

So I think it used to be that the static invoker calls the call operator which 
contains the body of the lambda? And now both the static invoker and the call 
operator are delegating to this new __impl function. In 
EmitLambdaStaticInvokeBody it first calls EmitLambdaInAllocaCallOpFn to make 
the new call operator (which is populated using 
EmitLambdaDelegatingInvokeBody). And then inside EmitLambdaDelegatingInvokeBody 
it generates the new impl function and calls it in the body. Not sure if that 
answers the question, I agree the code is a bit roundabout.

> Why is the function in EmitLambdaInAllocaCallOpFn not getting defined using 
> the normal CodeGenModule machinery?

Do you mean why it's not using CodeGenModule machinery to generate the new call 
op body or why we're changing the original call op body?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137872

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to