[PATCH] D25349: [coroutines] Build fallthrough and set_exception statements.

Gor Nishanov via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 17 10:05:03 PDT 2016


GorNishanov added a comment.

@rsmith, I am wondering what were your thoughts on where to generate try { body } catch (...) { p.set_exception(std::exception()); }

Would it be in SemaCoroutine.cpp? Essentially, add something like this:

  `
    bool makeBody() {
      if (!OnException)
        return true;
  
      StmtResult CatchBlock = S.ActOnCXXCatchBlock(Loc, nullptr, OnException);
      if (CatchBlock.isInvalid())
        return false;
  
      StmtResult TryBlock = S.ActOnCXXTryBlock(Loc, Body, {CatchBlock.get()});
      if (TryBlock.isInvalid())
        return false;
  
      Body = TryBlock.get();
  
      return true;
    }
  `


https://reviews.llvm.org/D25349





More information about the cfe-commits mailing list