Skip to content

Add support for Wasm EH#5162

Draft
QuantumSegfault wants to merge 1 commit into
ldc-developers:masterfrom
QuantumSegfault:wasm-eh
Draft

Add support for Wasm EH#5162
QuantumSegfault wants to merge 1 commit into
ldc-developers:masterfrom
QuantumSegfault:wasm-eh

Conversation

@QuantumSegfault

Copy link
Copy Markdown
Contributor

Adds codegen and DRuntime support for WebAssembly exception handling.

@QuantumSegfault

Copy link
Copy Markdown
Contributor Author

Some IR comparisons for reference

C++/Clang: https://godbolt.org/z/heMqqGvbb
D/LDC (this PR): https://godbolt.org/z/vMYWYvPE5

@QuantumSegfault

Copy link
Copy Markdown
Contributor Author

@kinke

Maybe @rainers?

It works, but maybe one of you has a better idea on how to organize the modifications to gen/trycatchfinally.cpp.

Wasm EH follows MSVC style catchpad/catchswitch/catchret & cleanpad/cleanupret. However there is only one catchswitch per catchpad, after which an Itanium-landingpad-style comparison chain needs to be emitted to determine the correct catch block (if any).

Right now I'm treating it more like MSVC, and just dumping everything in emitCatchBodies...though this requires exposing some TryCatchFinallyScope internals...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant