pub(crate) struct Cx<'db> {
db: &'db dyn Db,
function_section: FunctionSection,
type_section: TypeSection,
code_section: CodeSection,
functions: Map<FnKey<'db>, FnIndex>,
codegen_queue: Vec<CodegenQueueItem<'db>>,
}Expand description
Core codegen context.
Fields§
§db: &'db dyn Db§function_section: FunctionSection§type_section: TypeSection§code_section: CodeSection§functions: Map<FnKey<'db>, FnIndex>§codegen_queue: Vec<CodegenQueueItem<'db>>Implementations§
Source§impl<'db> Cx<'db>
impl<'db> Cx<'db>
Sourcepub(crate) fn declare_fn(
&mut self,
function: SymFunction<'db>,
generics: Vec<SymGenericTerm<'db>>,
) -> FnIndex
pub(crate) fn declare_fn( &mut self, function: SymFunction<'db>, generics: Vec<SymGenericTerm<'db>>, ) -> FnIndex
Declares an instantiation of a function with a given set of arguments and returns its index. If the function is already declared, nothing happens. If the function is not already declared, it is enqueued for code-generation.
pub(crate) fn codegen_fn(&mut self, FnKey: FnKey<'db>)
fn codegen_signature( &self, function: SymFunction<'db>, generics: &[SymGenericTerm<'db>], ) -> CodegenSignature<'db>
Source§impl Cx<'_>
impl Cx<'_>
Sourcepub(crate) fn declare_fn_type(
&mut self,
inputs: Vec<ValType>,
outputs: Vec<ValType>,
) -> FnTypeIndex
pub(crate) fn declare_fn_type( &mut self, inputs: Vec<ValType>, outputs: Vec<ValType>, ) -> FnTypeIndex
Declares an instantiation of a function with a given set of arguments and returns its index. If the function is already declared, nothing happens. If the function is not already declared, it is enqueued for code-generation.
Auto Trait Implementations§
impl<'db> Freeze for Cx<'db>
impl<'db> !RefUnwindSafe for Cx<'db>
impl<'db> !Send for Cx<'db>
impl<'db> !Sync for Cx<'db>
impl<'db> Unpin for Cx<'db>
impl<'db> UnsafeUnpin for Cx<'db>
impl<'db> !UnwindSafe for Cx<'db>
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
§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