rnk added a comment.

I went ahead and implemented my suggested changes and pushed this with 
attribution. Thanks for the fix!



================
Comment at: clang/lib/CodeGen/CGException.cpp:1966
 
   StartFunction(GlobalDecl(), RetTy, Fn, FnInfo, Args,
                 OutlinedStmt->getBeginLoc(), OutlinedStmt->getBeginLoc());
----------------
I think passing `GlobalDecl()` here is intentional, there must have been some 
reason to have the helper CGF have a null function. This noexcept thing seems 
like one such example.


================
Comment at: clang/lib/CodeGen/CGExpr.cpp:4188
 LValue CodeGenFunction::EmitLValueForLambdaField(const FieldDecl *Field) {
-  assert(cast<CXXMethodDecl>(CurCodeDecl)->getParent()->isLambda());
-  assert(cast<CXXMethodDecl>(CurCodeDecl)->getParent() == Field->getParent());
+  assert(IsOutlinedSEHHelper || 
cast<CXXMethodDecl>(CurCodeDecl)->getParent()->isLambda());
+  assert(IsOutlinedSEHHelper || cast<CXXMethodDecl>(CurCodeDecl)->getParent() 
== Field->getParent());
----------------
Other uses of CurCodeDecl check it for null, so I think it makes sense to go 
ahead and do the same here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102027

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

Reply via email to