[PATCH] D150803: [WebAssembly] Add a new `wasm_async` clang attribute for marking async functions.

Derek Schuff via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 1 15:11:56 PDT 2023


dschuff added a comment.

In D150803#4350554 <https://reviews.llvm.org/D150803#4350554>, @sbc100 wrote:

> This change looks really nice.  I like the new relocation type, I think we would have had to add that sooner or later anyway.
>
> My only major concern is making this attribute available outside of emscripten (i.e. wasm32-unknown-emscripten).  It seems like we should maybe called it `em_async` or something like that?  And make it illegal on other targets?
>
> @dschuff WDYT?

Hm, this is interesting because in the long term we plan to have stack switching in wasm, which could allow for similar async behavior that JSPI has, and could be useful in non-web systems. But that's a ways off. The file format we are generating with this CL will be used in emscripten sooner (and we may want to try to stabilize it some point, possibly before pure wasm stack switching is usable in non-web systems).
So overall I kind of feel like I could go either way on this. Curious if @sunfish has had any thoughts about async outside of emscripten.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D150803



More information about the cfe-commits mailing list