pub(crate) struct LLVMAbi<A: Architecture = TargetArchitecture> {
pub(crate) architecture: A,
}Expand description
LLVM ABI lowering shared by all supported architectures.
Fields§
§architecture: AImplementations§
Source§impl<A: Architecture> LLVMAbi<A>
We need to produce different LLVM IR for different platforms. (Contrary to
popular knowledge LLVM IR is not intended to be portable in that way.) This
trait deals with differences between function signatures on different
targets.
impl<A: Architecture> LLVMAbi<A>
We need to produce different LLVM IR for different platforms. (Contrary to popular knowledge LLVM IR is not intended to be portable in that way.) This trait deals with differences between function signatures on different targets.
Sourcepub(crate) fn get_vmctx_ptr_param<'ctx>(
&self,
func_value: &FunctionValue<'ctx>,
) -> PointerValue<'ctx>
pub(crate) fn get_vmctx_ptr_param<'ctx>( &self, func_value: &FunctionValue<'ctx>, ) -> PointerValue<'ctx>
Given a function definition, retrieve the parameter that is the vmctx pointer.
Sourcepub(crate) fn get_m0_ptr_param<'ctx>(
&self,
func_value: &FunctionValue<'ctx>,
) -> PointerValue<'ctx>
pub(crate) fn get_m0_ptr_param<'ctx>( &self, func_value: &FunctionValue<'ctx>, ) -> PointerValue<'ctx>
Given a function definition, retrieve the parameter that is the pointer to the first – number 0 – local memory.
Sourcepub(crate) fn args_to_call<'ctx>(
&self,
alloca_builder: &Builder<'ctx>,
func_sig: &FuncSig,
llvm_fn_ty: &FunctionType<'ctx>,
ctx_ptr: PointerValue<'ctx>,
values: &[BasicValueEnum<'ctx>],
intrinsics: &Intrinsics<'ctx>,
m0: Option<PointerValue<'ctx>>,
sret_ptr: Option<PointerValue<'ctx>>,
) -> Result<Vec<BasicValueEnum<'ctx>>, CompileError>
pub(crate) fn args_to_call<'ctx>( &self, alloca_builder: &Builder<'ctx>, func_sig: &FuncSig, llvm_fn_ty: &FunctionType<'ctx>, ctx_ptr: PointerValue<'ctx>, values: &[BasicValueEnum<'ctx>], intrinsics: &Intrinsics<'ctx>, m0: Option<PointerValue<'ctx>>, sret_ptr: Option<PointerValue<'ctx>>, ) -> Result<Vec<BasicValueEnum<'ctx>>, CompileError>
Marshall wasm stack values into function parameters.
Sourcepub(crate) fn llvm_fn_uses_sret<'ctx>(
&self,
llvm_fn_ty: &FunctionType<'ctx>,
func_sig: &FuncSig,
) -> bool
pub(crate) fn llvm_fn_uses_sret<'ctx>( &self, llvm_fn_ty: &FunctionType<'ctx>, func_sig: &FuncSig, ) -> bool
Whether a concrete LLVM function type uses an sret parameter for the given wasm signature.
Source§impl<A: Architecture> LLVMAbi<A>
impl<A: Architecture> LLVMAbi<A>
pub(crate) fn func_type_to_llvm<'ctx>( &self, context: &'ctx Context, intrinsics: &Intrinsics<'ctx>, offsets: Option<&VMOffsets>, sig: &FuncSig, include_m0_param: bool, ) -> Result<(FunctionType<'ctx>, Vec<(Attribute, AttributeLoc)>), CompileError>
pub(crate) fn rets_from_call<'ctx>( &self, builder: &Builder<'ctx>, intrinsics: &Intrinsics<'ctx>, call_site: CallSiteValue<'ctx>, func_sig: &FuncSig, ) -> Result<Vec<BasicValueEnum<'ctx>>, CompileError>
pub(crate) fn pack_values_for_register_return<'ctx>( &self, intrinsics: &Intrinsics<'ctx>, builder: &Builder<'ctx>, values: &[BasicValueEnum<'ctx>], func_sig: &FuncSig, func_type: &FunctionType<'ctx>, ) -> Result<BasicValueEnum<'ctx>, CompileError>
Auto Trait Implementations§
impl<A> Freeze for LLVMAbi<A>where
A: Freeze,
impl<A> RefUnwindSafe for LLVMAbi<A>where
A: RefUnwindSafe,
impl<A> Send for LLVMAbi<A>where
A: Send,
impl<A> Sync for LLVMAbi<A>where
A: Sync,
impl<A> Unpin for LLVMAbi<A>where
A: Unpin,
impl<A> UnsafeUnpin for LLVMAbi<A>where
A: UnsafeUnpin,
impl<A> UnwindSafe for LLVMAbi<A>where
A: UnwindSafe,
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2where
T: SharedNiching<N1, N2>,
N1: Niching<T>,
N2: Niching<T>,
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2where
T: SharedNiching<N1, N2>,
N1: Niching<T>,
N2: Niching<T>,
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Pointee for T
impl<T> Pointee for T
§impl<T> Upcastable for T
impl<T> Upcastable for T
§fn upcast_any_ref(&self) -> &(dyn Any + 'static)
fn upcast_any_ref(&self) -> &(dyn Any + 'static)
upcast ref
§fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
upcast mut ref
§fn upcast_any_box(self: Box<T>) -> Box<dyn Any>
fn upcast_any_box(self: Box<T>) -> Box<dyn Any>
upcast boxed dyn