use crate::z80::Insn;
use crate::Constrain;
use crate::Sequence;
#[derive(Clone, Copy, Default, Debug)]
pub struct Constraints {
bb: bool,
leaffn: bool,
purefn: bool,
}
impl Constraints {
pub fn new() -> Self {
Self::default()
}
pub fn basic_block(&mut self) -> Self {
self.bb = true;
*self
}
pub fn leaf_function(&mut self) -> Self {
self.leaffn = true;
*self
}
pub fn pure_function(&mut self) -> Self {
self.purefn = true;
*self
}
}
impl Constrain<Insn> for Constraints {
fn fixup(&self, _candidate: &mut Sequence<Insn>) -> Option<(usize, &'static str)> {
None
}
}