code_emission.rs 506 Bytes
Newer Older
1 2 3 4
#![allow(dead_code)]

use compiler::CompilerPass;
use ast::ir::*;
qinsoon's avatar
qinsoon committed
5
use vm::VM;
6
use compiler::backend::emit_code;
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23

pub struct CodeEmission {
    name: &'static str
}

impl CodeEmission {
    pub fn new() -> CodeEmission {
        CodeEmission {
            name: "Code Emission"
        }
    }
}

impl CompilerPass for CodeEmission {
    fn name(&self) -> &'static str {
        self.name
    }
24

qinsoon's avatar
qinsoon committed
25 26
    fn visit_function(&mut self, vm: &VM, func: &mut MuFunctionVersion) {
        emit_code(func, vm);
27
    }
28
}