diff options
| author | Michael Williamson <mike@zwobble.org> | 2026-04-05 22:38:50 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2026-04-05 22:38:50 +0100 |
| commit | 503ac552b80e3d7f488458e8efd8d1e95d2527b0 (patch) | |
| tree | a16813a3b848daca1602398825e327cd075bd943 | |
| parent | c7964e6b2ef1682989488756888ad399f1127034 (diff) | |
Implement calls with destination in patio-to-cranelift
| -rw-r--r-- | patio-to-cranelift/src/codegen/mod.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/patio-to-cranelift/src/codegen/mod.rs b/patio-to-cranelift/src/codegen/mod.rs index 0f7dcff5..75e13ba2 100644 --- a/patio-to-cranelift/src/codegen/mod.rs +++ b/patio-to-cranelift/src/codegen/mod.rs @@ -323,10 +323,15 @@ fn compile_call(call: &PatioCall, context: &mut CompilerFunctionContext<'_>) { let cranelift_args = compile_operands(call.args.iter(), context); let func_ref = context.func_id(&call.function_name); - context + let cranelift_call = context .function_builder .ins() .call(func_ref, &cranelift_args); + + if let Some(destination) = &call.destination { + let cranelift_value = context.function_builder.inst_results(cranelift_call)[0]; + def_destination(destination, cranelift_value, context); + } } fn compile_if(if_: &PatioIf, context: &mut CompilerFunctionContext<'_>) { |
