PR tweaks

This commit is contained in:
Brian Carroll 2022-04-03 01:11:42 +01:00
parent e342b21d43
commit a07cac6682

View file

@ -34,8 +34,7 @@ use crate::{
pub enum ProcSource { pub enum ProcSource {
Roc, Roc,
Helper, Helper,
/// Wrapper function for higher-order calls from Zig to Roc, /// Wrapper function for higher-order calls from Zig to Roc
/// to work around Zig's incorrect implementation of C calling convention in Wasm
HigherOrderWrapper(usize), HigherOrderWrapper(usize),
} }
@ -1009,16 +1008,13 @@ impl<'a> WasmBackend<'a> {
CallConv::C, CallConv::C,
); );
for ( for (roc_proc_index, lookup) in self.proc_lookup.iter().enumerate() {
roc_proc_index, let ProcLookupData {
ProcLookupData {
name: ir_sym, name: ir_sym,
layout: pl, layout: pl,
linker_index: linker_sym_index, linker_index: linker_sym_index,
.. ..
}, } = lookup;
) in self.proc_lookup.iter().enumerate()
{
if *ir_sym == func_sym && pl == proc_layout { if *ir_sym == func_sym && pl == proc_layout {
let wasm_fn_index = self.fn_index_offset + roc_proc_index as u32; let wasm_fn_index = self.fn_index_offset + roc_proc_index as u32;
let num_wasm_args = param_types.len(); let num_wasm_args = param_types.len();