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

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

Reply via email to