mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
wasm: delete CallConv, since now Zig==C (hopefully)
This commit is contained in:
parent
cc2b8b5d19
commit
4c4344b46c
4 changed files with 44 additions and 99 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue