[Coroutines] Catch exceptions in await_resume
authorBrian Gesiak <modocache@gmail.com>
Fri, 4 May 2018 14:02:37 +0000 (14:02 +0000)
committerBrian Gesiak <modocache@gmail.com>
Fri, 4 May 2018 14:02:37 +0000 (14:02 +0000)
commitea9144e8184d4dd208347cc1c961f8a0ebfa1296
tree4964e29c6b890253174258eaead6e668edce18b9
parentaf73d2bdd923896303a7adef61d04f3e3813b56a
[Coroutines] Catch exceptions in await_resume

Summary:
http://wg21.link/P0664r2 section "Evolution/Core Issues 24" describes a
proposed change to Coroutines TS that would have any exceptions thrown
after the initial suspend point of a coroutine be caught by the handler
specified by the promise type's 'unhandled_exception' member function.
This commit provides a sample implementation of the specified behavior.

Test Plan: `check-clang`

Reviewers: GorNishanov, EricWF

Reviewed By: GorNishanov

Subscribers: cfe-commits, lewissbaker, eric_niebler

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

llvm-svn: 331519
clang/lib/CodeGen/CGCoroutine.cpp
clang/test/CodeGenCoroutines/coro-await-resume-eh.cpp [new file with mode: 0644]
clang/test/CodeGenCoroutines/coro-unhandled-exception.cpp