pub struct BeamBackend {
pub module: BeamModule,
/* private fields */
}Expand description
BEAM VM code generation backend.
Converts LCNF IR into Core Erlang source representation suitable for
further compilation by the Erlang compiler (erlc).
Fields§
§module: BeamModuleThe module being generated
Implementations§
Source§impl BeamBackend
impl BeamBackend
Sourcepub fn new(module_name: impl Into<String>) -> Self
pub fn new(module_name: impl Into<String>) -> Self
Create a new BEAM backend for the given module name.
Sourcepub fn emit_literal(&self, lit: &LcnfLit) -> BeamExpr
pub fn emit_literal(&self, lit: &LcnfLit) -> BeamExpr
Convert an LCNF literal to a BeamExpr.
Sourcepub fn emit_let_value(&mut self, val: &LcnfLetValue) -> BeamExpr
pub fn emit_let_value(&mut self, val: &LcnfLetValue) -> BeamExpr
Convert an LCNF let-value to a BeamExpr.
Sourcepub fn emit_expr(&mut self, expr: &LcnfExpr) -> BeamExpr
pub fn emit_expr(&mut self, expr: &LcnfExpr) -> BeamExpr
Emit a Core Erlang expression from an LCNF expression.
Sourcepub fn emit_fun_decl(&mut self, decl: &LcnfFunDecl) -> BeamFunction
pub fn emit_fun_decl(&mut self, decl: &LcnfFunDecl) -> BeamFunction
Emit a complete LCNF function declaration as a BeamFunction.
Sourcepub fn emit_core_erlang(&mut self) -> String
pub fn emit_core_erlang(&mut self) -> String
Emit a full Core Erlang source file for the module.
Auto Trait Implementations§
impl Freeze for BeamBackend
impl RefUnwindSafe for BeamBackend
impl Send for BeamBackend
impl Sync for BeamBackend
impl Unpin for BeamBackend
impl UnsafeUnpin for BeamBackend
impl UnwindSafe for BeamBackend
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