]> granicus.if.org Git - clang/commit
[coroutines] Wrap the body of the coroutine in try-catch
authorGor Nishanov <GorNishanov@gmail.com>
Mon, 22 May 2017 22:33:17 +0000 (22:33 +0000)
committerGor Nishanov <GorNishanov@gmail.com>
Mon, 22 May 2017 22:33:17 +0000 (22:33 +0000)
commita882e8619ffb19dd808e62f8c0f82ed73d0bff00
tree7ec2c1f9b615020ed90f617faf6e121643d4135a
parentecac99cbb4fc1411a821718d6c254333641c1198
[coroutines] Wrap the body of the coroutine in try-catch

Summary:
If unhandled_exception member function is present in the coroutine promise,
wrap the body of the coroutine in:

```
try {
  body
} catch(...) { promise.unhandled_exception(); }
```

Reviewers: EricWF, rnk, rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303583 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticSemaKinds.td
lib/CodeGen/CGCoroutine.cpp
lib/Sema/SemaCoroutine.cpp
test/CodeGenCoroutines/coro-cleanup.cpp
test/CodeGenCoroutines/coro-eh-cleanup.cpp
test/SemaCXX/coroutine-seh.cpp [new file with mode: 0644]