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

Matthias Braun via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 23 14:04:55 PDT 2023


MatzeB created this revision.
MatzeB added reviewers: GorNishanov, EricWF, ChuanqiXu, bruno.
Herald added subscribers: modimo, wenlei, martong, mcrosier.
Herald added a reviewer: shafik.
Herald added a project: All.
MatzeB requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

This fixes an assertion error when writing a coroutine with a function-try-block. In this case the function body is not a `CompoundStmt` so the code constructing an artificial CXXTryStmt must also construct a `CompoundStmt` for it.

While on it adjust the `CXXStmt::Create` function to only accept `CompoundStmt*`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D146758

Files:
  clang/include/clang/AST/StmtCXX.h
  clang/lib/AST/ASTImporter.cpp
  clang/lib/AST/StmtCXX.cpp
  clang/lib/CodeGen/CGCoroutine.cpp
  clang/lib/Sema/SemaStmt.cpp
  clang/test/CodeGenCoroutines/coro-function-try-block.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146758.507876.patch
Type: text/x-patch
Size: 4867 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230323/d6554b41/attachment.bin>


More information about the cfe-commits mailing list