WARNING! Access to this system is limited to authorised users only.
Unauthorised users may be subject to prosecution.
Unauthorised access to this system is a criminal offence under Australian law (Federal Crimes Act 1914 Part VIA)
It is a criminal offence to:
(1) Obtain access to data without authority. -Penalty 2 years imprisonment.
(2) Damage, delete, alter or insert data without authority. -Penalty 10 years imprisonment.
User activity is monitored and recorded. Anyone using this system expressly consents to such monitoring and recording.

To protect your data, the CISO officer has suggested users to enable 2FA as soon as possible.
Currently 2.6% of users enabled 2FA.

code_emission.rs 577 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

qinsoon's avatar
qinsoon committed
8 9
use std::any::Any;

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
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
    }
qinsoon's avatar
qinsoon committed
26

qinsoon's avatar
qinsoon committed
27 28 29 30
    fn as_any(&self) -> &Any {
        self
    }

qinsoon's avatar
qinsoon committed
31 32
    fn visit_function(&mut self, vm: &VM, func: &mut MuFunctionVersion) {
        emit_code(func, vm);
33
    }
qinsoon's avatar
qinsoon committed
34
}