Ygen/CodeGen/
settings.rs

1use super::instr::{MachineInstr, MCInstr};
2
3/// Machine specific settings, like the lowering function
4/// prolog, epilog functions, etc
5#[derive(Debug, Clone, PartialEq, Eq)]
6pub struct MCSettings {
7    lowering: Option<fn(input: Vec<MachineInstr>) -> Vec<Box<dyn MCInstr>>>,
8    prolog: Option<fn() -> Vec<Box<dyn MCInstr>>>,
9    epilog: Option<fn() -> Vec<Box<dyn MCInstr>>>,
10}
11
12impl MCSettings {
13    /// Creates new machine settings
14    pub fn new() -> Self {
15        Self {
16            lowering: None,
17            prolog: None,
18            epilog: None,
19        }
20    }
21}