Repository navigation
wasm2c: Cleanup of handling of WASM_RT_USE_SEGUE macro - #2487
Conversation
|
Rather than creating a new |
a89e89e to
e899b22
Compare
@sbc100 Sure, that would work too. I think, on balance, I think its a bit more confusing though. Let me know if you have a strong preference for your approach, and I can make the change. If neutral, I prefer this as it is more explicit about the intent. |
Its up to you. This change LGTM as is if you prefer it that way. It makes the diff bigger but I guess that in an of itself is not a strong argument. |
The
WASM_RT_USE_SEGUEmacro was previously overloaded for two checks:Check 2 means that
WASM_RT_USE_SEGUEis only available in the generated C file, and not in the runtime (wasm-rt-impl.c).However, the runtime needs this information as it must include certain headers only if Segue is supported (Check 1 above), and thus this macro must be available in
wasm-rt.h. We thus split this macro into two partsWASM_RT_USE_SEGUEandWASM_RT_USE_SEGUE_FOR_THIS_MODULEto address the two use cases: "check if Segue is supported" and "check if Segue should be used for the current module"