Begin generating code for the legalizer.

This is a work in progress. The 'legalizer.rs' file generated by
gen_legalizer.py is not used for anything yet.

Add PEP 484 type annotations to a bunch of Python code.
This commit is contained in:
Jakob Stoklund Olesen
2016-10-25 16:52:15 -07:00
parent 5dc9ea1de4
commit bcd5bc559c
3 changed files with 132 additions and 0 deletions

View File

@@ -391,6 +391,15 @@ impl<'f> Cursor<'f> {
}
}
/// Get the instruction corresponding to the current position, if any.
pub fn current_inst(&self) -> Option<Inst> {
use self::CursorPosition::*;
match self.pos {
At(inst) => Some(inst),
_ => None,
}
}
/// Go to a specific instruction which must be inserted in the layout.
/// New instructions will be inserted before `inst`.
pub fn goto_inst(&mut self, inst: Inst) {