pub struct EvmCodegen { /* private fields */ }Expand description
EVM code generator.
Implementations§
Source§impl EvmCodegen
impl EvmCodegen
Sourcepub fn new(config: impl Into<EvmCodegenConfig>) -> EvmCodegen
pub fn new(config: impl Into<EvmCodegenConfig>) -> EvmCodegen
Creates a new EVM code generator.
Sourcepub fn generate_module(&mut self, module: &mut Module) -> Vec<u8> ⓘ
pub fn generate_module(&mut self, module: &mut Module) -> Vec<u8> ⓘ
Generates bytecode for a module (runtime code only). Returns empty bytecode for interfaces (they have no implementation).
This runs optimization passes (including DCE) on the module before codegen unless disabled.
Sourcepub fn generate_deployment_bytecode(
&mut self,
module: &mut Module,
) -> (Vec<u8>, Vec<u8>)
pub fn generate_deployment_bytecode( &mut self, module: &mut Module, ) -> (Vec<u8>, Vec<u8>)
Generates deployment bytecode for a module. Returns (deployment_bytecode, runtime_bytecode). Returns empty bytecodes for interfaces (they have no implementation).
This runs optimization passes (including DCE) on the module before codegen unless disabled.
Trait Implementations§
Source§impl Backend for EvmCodegen
impl Backend for EvmCodegen
Source§type Output = EvmArtifact
type Output = EvmArtifact
The artifact this backend produces from a module.
Source§fn lower_module(&mut self, module: &mut Module) -> EvmArtifact
fn lower_module(&mut self, module: &mut Module) -> EvmArtifact
Lowers a module to this backend’s output artifact. Takes
&mut so the
backend can run its own target-specific passes over the MIR first.Source§impl Default for EvmCodegen
impl Default for EvmCodegen
Source§fn default() -> EvmCodegen
fn default() -> EvmCodegen
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for EvmCodegen
impl RefUnwindSafe for EvmCodegen
impl Send for EvmCodegen
impl Sync for EvmCodegen
impl Unpin for EvmCodegen
impl UnsafeUnpin for EvmCodegen
impl UnwindSafe for EvmCodegen
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
Source§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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