[PATCH] D146758: Fix codegen for coroutine with function-try-block

Chuanqi Xu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 27 23:38:42 PDT 2023


ChuanqiXu added inline comments.


================
Comment at: clang/lib/CodeGen/CGCoroutine.cpp:724-730
+      Stmt *BodyStmt = S.getBody();
+      CompoundStmt *Body = dyn_cast<CompoundStmt>(BodyStmt);
+      if (Body == nullptr) {
+        Body =
+            CompoundStmt::Create(getContext(), {BodyStmt}, FPOptionsOverride(),
+                                 SourceLocation(), SourceLocation());
+      }
----------------
ChuanqiXu wrote:
> Can we try to move the logic to `CoroutineStmtBuilder`? That makes me feel better. And it will be helpful to add a comment to tell that we're handling the case the function body is function-try-block.
It looks like you didn't address the comments. Would you like to address it? I don't mind to address it later myself.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146758



More information about the cfe-commits mailing list