Emit custom byte code for the static invoker function.
Unfortunately, there are a few (RVO-related) cases we can't handle yet. There's a bigger refactoring for the initialization stuff coming that will hopefully take care of that.
Paths 
  |  Differential  D150111  
[clang][Interp] Implement lambda static invokers ClosedPublic Authored by tbaeder on May 8 2023, 4:43 AM. 
Details Summary Emit custom byte code for the static invoker function. Unfortunately, there are a few (RVO-related) cases we can't handle yet. There's a bigger refactoring for the initialization stuff coming that will hopefully take care of that. 
Diff Detail 
 Event Timeline
 
 tbaeder marked an inline comment as done. This revision is now accepted and ready to land.May 16 2023, 7:32 AM This revision was landed with ongoing or failed builds.Jul 25 2023, 11:42 PM Closed by commit rG6d2e141e5c0d: [clang][Interp] Handle lambda static invokers (authored by tbaeder).  ·  Explain Why This revision was automatically updated to reflect the committed changes. 
Revision Contents 
 
Diff 544223 clang/lib/AST/Interp/ByteCodeEmitter.cpp
 clang/lib/AST/Interp/ByteCodeStmtGen.h
 clang/lib/AST/Interp/ByteCodeStmtGen.cpp
 clang/lib/AST/Interp/Function.h
 clang/lib/AST/Interp/Interp.h
 clang/test/AST/Interp/lambda.cpp
  | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
I don't like the isa followed by a cast code smell, but rewriting it to use dyn_cast is perhaps kind of ugly:
WDYT?