pub struct WasmABI { /* private fields */ }Expand description
Platform-specific ABI utilities for WASM code generation.
Implementations§
Source§impl WasmABI
impl WasmABI
Sourcepub fn new(target_os: TargetOperatingSystem) -> Self
pub fn new(target_os: TargetOperatingSystem) -> Self
Creates a new ABI instance for the specified target OS.
Sourcepub fn mangle_function_name(&self, name: &str) -> String
pub fn mangle_function_name(&self, name: &str) -> String
Get the WASM function name (currently just the original name). WASM doesn’t require name mangling, but this method exists for consistency with other backends and future extensibility.
Sourcepub fn get_runtime_imports(&self) -> &'static [(&'static str, &'static str)]
pub fn get_runtime_imports(&self) -> &'static [(&'static str, &'static str)]
Helpers the backend calls but emits no body for, each paired with the symbol a call site names. A module that calls none of them imports none, so it needs no host beyond what its own code asks for.
Sourcepub fn get_wasm_type(&self, ty: &MirType) -> &'static str
pub fn get_wasm_type(&self, ty: &MirType) -> &'static str
Get the WASM type for MIR types (currently only i64).
Sourcepub fn generate_local_decl(&self, index: usize) -> String
pub fn generate_local_decl(&self, index: usize) -> String
Generate WASM local variable declaration.
Trait Implementations§
Source§impl Abi for WasmABI
impl Abi for WasmABI
Source§fn target_os(&self) -> TargetOperatingSystem
fn target_os(&self) -> TargetOperatingSystem
Returns the target operating system for this ABI instance.
Source§fn mangle_function_name(&self, name: &str) -> String
fn mangle_function_name(&self, name: &str) -> String
Returns the mangled function name with platform-specific prefix. Read more
fn builtin_library(&self) -> BuiltinLibrary
Auto Trait Implementations§
impl Freeze for WasmABI
impl RefUnwindSafe for WasmABI
impl Send for WasmABI
impl Sync for WasmABI
impl Unpin for WasmABI
impl UnsafeUnpin for WasmABI
impl UnwindSafe for WasmABI
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more