Struct jit::Val
[−]
[src]
pub struct Val(_);
Vals form the backbone of the storage system in LibJIT
Every value in the system, be it a constant, a local variable, or a
temporary result, is represented by an object of type Val
. The JIT then
allocates registers or memory locations to the values as appropriate. This is
why Val
is always behind a reference
Methods
impl Val
fn new<'a>(func: &UncompiledFunction<'a>, value_type: &Ty) -> &'a Val
Create a new value in the context of a function's current block.
The value initially starts off as a block-specific temporary. It will be converted into a function-wide local variable if it is ever referenced from a different block.
fn get_type(&self) -> &Ty
Get the type of the value
fn get_function(&self) -> UncompiledFunction
Get the function which made this value
fn is_temp(&self) -> bool
Determine if a value is temporary. i.e. its scope extends over a single block within its function.
fn is_addressable(&self) -> bool
Determine if a value is addressable.
fn set_addressable(&self)
Set a flag on a value to indicate that it is addressable.
This should be used when you want to take the address of a value (e.g.
&variable
in Rust/C). The value is guaranteed to not be stored in a
register across a function call.