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



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to