Thanks, I'm able to reproduce. Seems to be a difference between -c and -cc1. With -c the global value of the mangled name of the constructor is not being found. Looking into it more...
Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Sep 13 2023
I'm unable to reproduce the crash. What flags are you compiling with?
Sep 12 2023
Sep 6 2023
Rebase and fix unused variable warning.
Aug 24 2023
Aug 8 2023
@efriedma I've updated the patch to fix the decl-use-decl example and added a test for it. Anything else?
Aug 3 2023
Cleanup some extra brackets.
Update deferred annotations whenever EmitGlobalDefinition is called
with a FunctionDecl and it has already been used or defined.
Aug 2 2023
Switch to emitting annotations and the end.
Jul 27 2023
I looked into the above issue with mixing declarations and definitions and I think I can fix that by leaving the AddGlobalAnnotations call in EmitGlobalFunctionDefinition and only calling AddGlobalAnnotations from GetOrCreateLLVMFunction when it's for a definition. However, with that I'm running into some duplicate annotations being created with C++ templates that I need to fix.
Jul 25 2023
That example appears to still work the same with my patch:
A little more context for the new reviewers. Over in this patch I added support for annotations to be emitted into WebAssembly. We'd like to use this to mark imported (declarations) and exported (definitions) of functions with special attributes.
Jul 24 2023
Jul 11 2023
Rebase on main.
Jun 27 2023
Remove annotate arguments. Change name from func_attr to llvm.func_attr.
Marking as requested changes so it's clear there's more worth discussing, so we don't accidentally land this.
Use the annotate attribute to generate custom sections.
Jun 22 2023
Jun 21 2023
Jun 20 2023
Jun 14 2023
Jun 13 2023
Fix few remaining issues.
After some feedback, a few people have indicated they'd like to do something similar to this, but for their own attributes. I've changed to a more generic attribute that allows arbitrary strings. Now a custom section will be created for each unique attribute.
Jun 6 2023
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.
When we do have stack switching, would you anticipate still using this wasm_async attribute, or would we switch to something else at that point?
Review comments. Add tombstone for unused functions.
Jun 1 2023
May 31 2023
May 24 2023