import * as binaryen from "./wasm-encoder.js"; import type { IRCall, IRLambdaRef } from "../ir/types.js"; import { type CompilationContext, FunctionContext } from "./types.js"; /** * Compile an IR function call to binaryen. * * Dispatches by `expr.callKind` (pre-classified during IR lowering): * - "direct" → known user function, emit `mod.call()` with __env=0 prepended * - "builtin" → host import, emit `mod.call()` without __env * - "indirect" → closure pair, emit `mod.call_indirect()` via function table */ export declare function compileIRCall(expr: IRCall, cc: CompilationContext, ctx: FunctionContext): binaryen.ExpressionRef; /** * Compile an IR lambda reference to a closure pair allocation. * * The lifted function was already compiled and registered in the function table * by the top-level codegen loop (iterating IRModule.functions). This function * only needs to: * 1. Allocate a closure environment on the heap (if captures exist) * 2. Return a closure pair: [table_index, env_ptr] * * Eliminates `collectFreeVariables()` — captures are pre-computed in IR. */ export declare function compileIRLambdaRef(expr: IRLambdaRef, cc: CompilationContext, ctx: FunctionContext): binaryen.ExpressionRef; //# sourceMappingURL=compile-ir-calls.d.ts.map