[PATCH] D154007: Reland "Try to implement lambdas with inalloca parameters by forwarding without use of inallocas."

Amy Huang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 12 16:11:18 PDT 2023


akhuang added inline comments.


================
Comment at: clang/lib/CodeGen/CodeGenFunction.cpp:1319
+  // Check if the invoker is being emitted (could be in any calling conv).
+  for (CallingConv CC : {CC_C, CC_X86StdCall, CC_X86FastCall, CC_X86ThisCall, CC_X86VectorCall})
+    if (MD->getParent()->getLambdaStaticInvoker(CC)->isUsed())
----------------
> I'm not confident that isUsed() works the way you want it to in this context. In particular, if the code in question runs before we've translated the whole translation unit, the isUsed() bit could change. If you want that's more obviously safe, you could just check if there are any captures. (I'm assuming the point of this is just to reduce the number of lambdas that go through this codepath?)

Oh, checking for captures would be the same as checking for `getLambdaStaticInvoker()`, right? I think I'll just keep with the same check from the original patch, then.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D154007



More information about the cfe-commits mailing list