binaryen icon indicating copy to clipboard operation
binaryen copied to clipboard

Add documentation to BinaryenIf

Open alexdovzhanyn opened this issue 1 year ago • 2 comments

Adds a comment to explain that a (result) is only added to BinaryenIf statements if both arms return concrete types.

Relates to https://github.com/WebAssembly/binaryen/issues/6868

alexdovzhanyn avatar Aug 22 '24 21:08 alexdovzhanyn

Thanks for the PR!

I'm not sure where the best place to put this documentation is. We should perhaps point to wasm-builder.h or wasm.cpp as containing the implementations of the expression constructors. That is, I'm not sure if it's worth duplicating such docs into the C API, though at the same, the wasm-builder.h/wasm.cpp code is more code and not documentation, so maybe we need a new place for it..?

kripken avatar Aug 26 '24 19:08 kripken

@kripken I'm happy to move it wherever you'd like! I put it in the header file for the binaryen api directly as I see that as the point of interface for most people who are using the binaryen api -- but I could be wrong. That is, as I've been building my application using Binaryen, I've been referring to the header file as the "source of truth" for how things work.

It may be more tedious / less discoverable if it is moved into the source of the implementation itself

alexdovzhanyn avatar Aug 26 '24 20:08 alexdovzhanyn