I create the function with Module->declare_function and Module ->define_function.
And how can I get the FuncRef to this (to call this declared fn)?
You can do it with get_finalized_function
, but then have to do some transmute tricks (be careful here!).
@Afonso Bordado Is there some official way to Call a JIT compiled function by another function?
Not really. As far as I know its pretty much that.
However, in our current test runner we do build a trampoline and call functions via that. The trampoline deals with the ABI issues that may occur if we used the transmute
method.
Moving the trampoline to cranelift-jit
would probably be a good idea.
@Afonso Bordado
I mean that I call ".call" via InstBuilder and the first argument must be a FuncRef.
Does this apply here?
Oh, i missunderstood.
To call clif functions from clif functions you need to declare_func_in_func
and then pass that to call
Last updated: Nov 22 2024 at 17:03 UTC