pub struct BodyDataStore { /* private fields */ }
Expand description
A collection of basic block, instructions and values appear in a function body.
Implementations§
Source§impl BodyDataStore
impl BodyDataStore
pub fn store_inst(&mut self, inst: Inst) -> InstId
pub fn inst_data(&self, inst: InstId) -> &Inst
pub fn inst_data_mut(&mut self, inst: InstId) -> &mut Inst
pub fn replace_inst(&mut self, inst: InstId, new: Inst) -> Inst
pub fn store_value(&mut self, value: Value) -> ValueId
pub fn is_nop(&self, inst: InstId) -> bool
pub fn is_terminator(&self, inst: InstId) -> bool
pub fn branch_info(&self, inst: InstId) -> BranchInfo<'_>
pub fn value_data(&self, value: ValueId) -> &Value
pub fn value_data_mut(&mut self, value: ValueId) -> &mut Value
pub fn values(&self) -> impl Iterator<Item = &Value>
pub fn values_mut(&mut self) -> impl Iterator<Item = &mut Value>
pub fn store_block(&mut self, block: BasicBlock) -> BasicBlockId
Sourcepub fn inst_result(&self, inst: InstId) -> Option<&AssignableValue>
pub fn inst_result(&self, inst: InstId) -> Option<&AssignableValue>
Returns an instruction result
pub fn map_result(&mut self, inst: InstId, result: AssignableValue)
pub fn remove_inst_result(&mut self, inst: InstId) -> Option<AssignableValue>
pub fn rewrite_branch_dest( &mut self, inst: InstId, from: BasicBlockId, to: BasicBlockId, )
pub fn value_ty(&self, vid: ValueId) -> TypeId
pub fn locals(&self) -> &[ValueId]
pub fn locals_mut(&mut self) -> &[ValueId]
pub fn func_args(&self) -> impl Iterator<Item = ValueId> + '_
pub fn func_args_mut(&mut self) -> impl Iterator<Item = &mut Value>
Sourcepub fn local_name(&self, value: ValueId) -> Option<&str>
pub fn local_name(&self, value: ValueId) -> Option<&str>
Returns Some(local_name
) if value is Value::Local
.
pub fn replace_value(&mut self, value: ValueId, to: Value) -> Value
Trait Implementations§
Source§impl Clone for BodyDataStore
impl Clone for BodyDataStore
Source§fn clone(&self) -> BodyDataStore
fn clone(&self) -> BodyDataStore
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for BodyDataStore
impl Debug for BodyDataStore
Source§impl Default for BodyDataStore
impl Default for BodyDataStore
Source§fn default() -> BodyDataStore
fn default() -> BodyDataStore
Returns the “default value” for a type. Read more
Source§impl PartialEq for BodyDataStore
impl PartialEq for BodyDataStore
impl Eq for BodyDataStore
impl StructuralPartialEq for BodyDataStore
Auto Trait Implementations§
impl Freeze for BodyDataStore
impl RefUnwindSafe for BodyDataStore
impl Send for BodyDataStore
impl Sync for BodyDataStore
impl Unpin for BodyDataStore
impl UnwindSafe for BodyDataStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.