[all-commits] [llvm/llvm-project] e00a8d: Fix codegen for coroutine with function-try-block

Matthias Braun via All-commits all-commits at lists.llvm.org
Thu Mar 30 11:18:58 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e00a8d081d789cac606cf0749c332c4632132820
  Author: Matthias Braun <matze at braunis.de>
  Date:   2023-03-30 (Thu, 30 Mar 2023)

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

  Log Message:
  Fix codegen for coroutine with function-try-block

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

Differential Revision: https://reviews.llvm.org/D146758

More information about the All-commits mailing list