[PATCH] D45860: [Coroutines] Catch exceptions in await_resume

Gor Nishanov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 2 16:02:06 PDT 2018


GorNishanov added a comment.

Looks good. Make sure to run the tests in release and debug mode.
On my box, these three test failed in release mode.

  Clang :: CodeGenCoroutines/coro-await-resume-eh.cpp
  Clang :: CodeGenCoroutines/coro-promise-dtor.cpp
  Clang :: CodeGenCoroutines/coro-unhandled-exception.cpp

There is a small difference in friendly names emission in release mode



================
Comment at: lib/CodeGen/CGCoroutine.cpp:220
   CGF.EmitBlock(ReadyBlock);
+  CXXTryStmt *TryStmt = nullptr;
+  if (Coro.ExceptionHandler && Kind == AwaitKind::Init) {
----------------
I suggest to check whether await_resume expression is noexcept and omit emission of all of the goo. Most of the time the await_ready for initial_suspend will be noexcept and thus we would not need to emit extra stuff.



Repository:
  rC Clang

https://reviews.llvm.org/D45860





More information about the cfe-commits mailing list