rnk added inline comments.

================
Comment at: clang/lib/CodeGen/CGClass.cpp:3064
+    if (I.getName().equals("this")) {
+      VMap[&I] = llvm::PoisonValue::get(I.getType());
+    } else {
----------------
Let's use getNullValue instead, just to avoid any complications for msan or 
ubsan, which may check for defined-ness.


================
Comment at: clang/lib/CodeGen/CodeGenModule.cpp:3588
         ABI->emitCXXStructor(GD);
+      // Hack for lambda forwarding calls with inalloca parameters.
+      else if (isa<CXXMethodDecl>(FD) && 
cast<CXXMethodDecl>(FD)->isLambdaStaticInvoker() &&
----------------
Can you move most of the details of this out of line to try to keep this as 
high level as possible?


================
Comment at: clang/lib/CodeGen/CodeGenModule.cpp:3590-3593
+          getTarget().getCXXABI().isMicrosoft() &&
+          llvm::any_of(cast<CXXMethodDecl>(FD)->parameters(), [&](ParmVarDecl 
*P) {
+            return isInAllocaArgument(getCXXABI(), P->getType());
+            })) {
----------------
For simplicity, what if we always emitted the call operator for all lambda 
static invokers into the IR first? So, this logic would then become almost 
exactly the same as the emitCXXStructor logic above.

Later, in EmitLambdaStaticInvokeBody, we can detect the inalloca case and start 
the cloning.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136998

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

Reply via email to