ChuanqiXu added a comment.

In D115219#3175582 <https://reviews.llvm.org/D115219#3175582>, @rjmccall wrote:

> I agree that you shouldn't call `suspend`, but doesn't `coro.end` have the 
> behavior of marking the coroutine done?  Should we just be calling `coro.end` 
> on this path?

@rjmccall great insight! `coro.end` wouldn't marking the coroutine done 
previously. But its place is perfect to do so. I have added the codes to mark 
the coroutine as done for `coro.end` in the unwind path. And I have checked the 
behavior. The exception happened earlier wouldn't run into the path of coro.end 
exists. So the behavior is satisfying. The only defect might be that the 
behavior is C++'s semantic. Although, there might be a problem if there is 
another language also uses switch-resumed ABI one day. I think the current 
approach is much better at least it has and would generate less code.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115219/new/

https://reviews.llvm.org/D115219

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

Reply via email to