Struct osmon::code::FunctionBuilder
source · [−]pub struct FunctionBuilder {
pub list: Vec<Instruction>,
pub label_counter: usize,
pub maxtemps: usize,
pub ntemps: usize,
pub nlocals: usize,
pub locals: HashMap<String, usize>,
pub state: [bool; 256],
pub skipclear: [bool; 256],
pub registers: Vec<usize>,
pub context: Vec<Vec<bool>>,
}Fields
list: Vec<Instruction>label_counter: usizemaxtemps: usizentemps: usizenlocals: usizelocals: HashMap<String, usize>state: [bool; 256]skipclear: [bool; 256]registers: Vec<usize>context: Vec<Vec<bool>>Implementations
sourceimpl FunctionBuilder
impl FunctionBuilder
pub fn new(nlocals: usize) -> FunctionBuilder
pub fn new_local(&mut self, n: String, reg: usize)
pub fn get_local(&mut self, n: &str) -> usize
pub fn new_label(&mut self) -> usize
pub fn label_here(&mut self, lc: usize)
pub fn push_op(&mut self, ins: Instruction)
pub fn register_new(&mut self) -> usize
pub fn register_push(&mut self, nreg: usize) -> usize
pub fn register_first_temp_available(&mut self) -> usize
pub fn register_push_temp(&mut self) -> usize
pub fn get_insts(&mut self) -> Vec<Instruction>
pub fn register_pop_context_protect(&mut self, protect: bool) -> usize
pub fn int_const(&mut self, int: i32) -> usize
pub fn long_const(&mut self, long: i64) -> usize
pub fn float_const(&mut self, float: f32) -> usize
pub fn double_const(&mut self, float: f64) -> usize
pub fn register_pop(&mut self) -> usize
pub fn register_clear(&mut self, nreg: usize)
pub fn register_is_temp(&self, nreg: usize) -> bool
Trait Implementations
sourceimpl Clone for FunctionBuilder
impl Clone for FunctionBuilder
sourcefn clone(&self) -> FunctionBuilder
fn clone(&self) -> FunctionBuilder
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
Auto Trait Implementations
impl RefUnwindSafe for FunctionBuilder
impl Send for FunctionBuilder
impl Sync for FunctionBuilder
impl Unpin for FunctionBuilder
impl UnwindSafe for FunctionBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T, U> IntoDuration<U> for T where
U: FromDuration<T>,
impl<T, U> IntoDuration<U> for T where
U: FromDuration<T>,
type Error = <U as FromDuration<T>>::Error
sourcefn into_duration(self) -> Result<U, <U as FromDuration<T>>::Error>
fn into_duration(self) -> Result<U, <U as FromDuration<T>>::Error>
Convert self into a T object.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more