sway_core/asm_generation/
asm_builder.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use super::FinalizedAsm;
use crate::{asm_lang::Label, BuildConfig};
use sway_error::handler::{ErrorEmitted, Handler};
use sway_ir::{ConfigContent, Function};

pub trait AsmBuilder {
    fn func_to_labels(&mut self, func: &Function) -> (Label, Label);
    fn compile_configurable(&mut self, config: &ConfigContent);
    fn compile_function(
        &mut self,
        handler: &Handler,
        function: Function,
    ) -> Result<(), ErrorEmitted>;
    fn finalize(
        self,
        handler: &Handler,
        build_config: Option<&BuildConfig>,
        fallback_fn: Option<Label>,
    ) -> Result<FinalizedAsm, ErrorEmitted>;
}