wasm: delete CallConv, since now Zig==C (hopefully)

This commit is contained in:
Brian Carroll 2022-09-09 18:47:36 +01:00 committed by Brendan Hansknecht
parent cc2b8b5d19
commit 4c4344b46c
No known key found for this signature in database
GPG key ID: 0EA784685083E75B
4 changed files with 44 additions and 99 deletions

View file

@ -27,7 +27,7 @@ use roc_wasm_module::{
};
use crate::code_builder::CodeBuilder;
use crate::layout::{CallConv, ReturnMethod, WasmLayout};
use crate::layout::{ReturnMethod, WasmLayout};
use crate::low_level::{call_higher_order_lowlevel, LowLevelCall};
use crate::storage::{AddressValue, Storage, StoredValue, StoredVarKind};
use crate::{
@ -411,7 +411,7 @@ impl<'a, 'r> WasmBackend<'a, 'r> {
use ReturnMethod::*;
let ret_layout = WasmLayout::new(self.layout_interner, proc.ret_layout);
let ret_type = match ret_layout.return_method(CallConv::C) {
let ret_type = match ret_layout.return_method() {
Primitive(ty, _) => Some(ty),
NoReturnValue => None,
WriteToPointerArg => {
@ -511,7 +511,7 @@ impl<'a, 'r> WasmBackend<'a, 'r> {
};
let mut n_inner_wasm_args = 0;
let ret_type_and_size = match inner_ret_layout.return_method(CallConv::C) {
let ret_type_and_size = match inner_ret_layout.return_method() {
ReturnMethod::NoReturnValue => None,
ReturnMethod::Primitive(ty, size) => {
// If the inner function returns a primitive, load the address to store it at
@ -853,8 +853,7 @@ impl<'a, 'r> WasmBackend<'a, 'r> {
}
let is_bool = matches!(cond_layout, Layout::BOOL);
let cond_type =
WasmLayout::new(self.layout_interner, cond_layout).arg_types(CallConv::C)[0];
let cond_type = WasmLayout::new(self.layout_interner, cond_layout).arg_types()[0];
// then, we jump whenever the value under scrutiny is equal to the value of a branch
for (i, (value, _, _)) in branches.iter().enumerate() {
@ -1351,7 +1350,6 @@ impl<'a, 'r> WasmBackend<'a, 'r> {
arguments,
ret_sym,
&wasm_layout,
CallConv::C,
);
self.call_host_fn_after_loading_args(name, num_wasm_args, has_return_val)
}
@ -1382,7 +1380,6 @@ impl<'a, 'r> WasmBackend<'a, 'r> {
arguments,
ret_sym,
&wasm_layout,
CallConv::C,
);
let roc_proc_index = self