import ByteCodeAsm
import ByteCodeLink
import ByteCodeFFI
-#ifdef USE_LIBFFI
import LibFFI
-#endif
import Outputable
import Name
stk_offset = d_after_r - s
-- in
-#if !defined(USE_LIBFFI)
- -- In the native case, we build marshalling code and attach the
- -- address of that to the CCALL instruction
- addr_of_marshaller <- ioToBc (mkMarshalCode cconv
- (r_offW, r_rep) addr_offW
- (zip args_offW a_reps))
-#else
-- the only difference in libffi mode is that we prepare a cif
-- describing the call type by calling libffi, and we attach the
-- address of this to the CCALL instruction.
token <- ioToBc $ prepForeignCall cconv a_reps r_rep
let addr_of_marshaller = castPtrToFunPtr token
-#endif
recordItblMallocBc (ItblPtr (castFunPtrToPtr addr_of_marshaller))
let