mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 14:24:45 +00:00
wasm: code gen for higher order wrapper function
This commit is contained in:
parent
51789f38c2
commit
5db3ae0227
5 changed files with 124 additions and 174 deletions
|
@ -10,7 +10,7 @@ pub const BUILTINS_ZIG_VERSION: ZigVersion = ZigVersion::Zig8;
|
|||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub enum ReturnMethod {
|
||||
/// This layout is returned from a Wasm function "normally" as a Primitive
|
||||
Primitive(ValueType),
|
||||
Primitive(ValueType, u32),
|
||||
/// This layout is returned by writing to a pointer passed as the first argument
|
||||
WriteToPointerArg,
|
||||
/// This layout is empty and requires no return value or argument (e.g. refcount helpers)
|
||||
|
@ -125,7 +125,7 @@ impl WasmLayout {
|
|||
|
||||
pub fn return_method(&self) -> ReturnMethod {
|
||||
match self {
|
||||
Self::Primitive(ty, _) => ReturnMethod::Primitive(*ty),
|
||||
Self::Primitive(ty, size) => ReturnMethod::Primitive(*ty, *size),
|
||||
Self::StackMemory { size, .. } => {
|
||||
if *size == 0 {
|
||||
ReturnMethod::NoReturnValue
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue