/// Determine the simplest strategy by which a type may be passed. Value always preferred over
/// Pointer.
Determine the simplest strategy by which a type may be passed. Value always preferred over
Pointer.
Determine the simplest strategy by which a type may be passed . Value always preferred over Pointer .
pub fn passed_by(&self) -> TypePassedBy {
        match self {
            Type::Builtin(b) => match b {
                BuiltinType::String => TypePassedBy::PointerLengthPair,
                BuiltinType::U8
                | BuiltinType::U16
                | BuiltinType::U32
                | BuiltinType::S8
                | BuiltinType::S16
                | BuiltinType::S32
                | BuiltinType::Char8
                | BuiltinType::USize => TypePassedBy::Value(AtomType::I32),
                BuiltinType::U64 | BuiltinType::S64 => TypePassedBy::Value(AtomType::I64),
                BuiltinType::F32 => TypePassedBy::Value(AtomType::F32),
                BuiltinType::F64 => TypePassedBy::Value(AtomType::F64),
            },
            Type::Array { .. } => TypePassedBy::PointerLengthPair,
            Type::Pointer { .. } | Type::ConstPointer { .. } => TypePassedBy::Value(AtomType::I32),
            Type::Enum(e) => TypePassedBy::Value(e.repr.into()),
            Type::Int(i) => TypePassedBy::Value(i.repr.into()),
            Type::Flags(f) => TypePassedBy::Value(f.repr.into()),
            Type::Struct { .. } | Type::Union { .. } => TypePassedBy::Pointer,
            Type::Handle { .. } => TypePassedBy::Value(AtomType::I32),
        }
    }
pub fn passed_by ( & self ) -> TypePassedBy { match self { Type :: Builtin ( b ) => match b { BuiltinType :: String => TypePassedBy :: PointerLengthPair , BuiltinType :: U8 | BuiltinType :: U16 | BuiltinType :: U32 | BuiltinType :: S8 | BuiltinType :: S16 | BuiltinType :: S32 | BuiltinType :: Char8 | BuiltinType :: USize => TypePassedBy :: Value ( AtomType :: I32 ) , BuiltinType :: U64 | BuiltinType :: S64 => TypePassedBy :: Value ( AtomType :: I64 ) , BuiltinType :: F32 => TypePassedBy :: Value ( AtomType :: F32 ) , BuiltinType :: F64 => TypePassedBy :: Value ( AtomType :: F64 ) , } , Type :: Array { .. } => TypePassedBy :: PointerLengthPair , Type :: Pointer { .. } | Type :: ConstPointer { .. } => TypePassedBy :: Value ( AtomType :: I32 ) , Type :: Enum ( e ) => TypePassedBy :: Value ( e . repr . into ( ) ) , Type :: Int ( i ) => TypePassedBy :: Value ( i . repr . into ( ) ) , Type :: Flags ( f ) => TypePassedBy :: Value ( f . repr . into ( ) ) , Type :: Struct { .. } | Type :: Union { .. } => TypePassedBy :: Pointer , Type :: Handle { .. } => TypePassedBy :: Value ( AtomType :: I32 ) , } }
Determine the simplest strategy by which a type may be passed.
Determine the simplest strategy by which a type may be passed .
&self