pub struct Value { /* private fields */ }Expand description
Describes a value definition.
Implementations§
Source§impl Value
impl Value
Sourcepub fn defining_entity(&self) -> DefiningEntity
pub fn defining_entity(&self) -> DefiningEntity
Get the defining entity
Sourcepub fn defining_op(&self) -> Option<Ptr<Operation>>
pub fn defining_op(&self) -> Option<Ptr<Operation>>
Sourcepub fn defining_block(&self) -> Option<Ptr<BasicBlock>>
pub fn defining_block(&self) -> Option<Ptr<BasicBlock>>
If the defining entity of this value is BasicBlock, return it. Otherwise, return None.
Sourcepub fn try_find_index(&self, ctx: &Context) -> Result<usize>
pub fn try_find_index(&self, ctx: &Context) -> Result<usize>
Find the (result / argument) index of this value in its defining entity. Returns Err if this value is not currently defined by its defining entity.
Sourcepub fn find_index(&self, ctx: &Context) -> usize
pub fn find_index(&self, ctx: &Context) -> usize
Find the (result / argument) index of this value in its defining entity. Panics if this value is not currently defined by its defining entity.
Sourcepub fn replace_some_uses_with<P: Fn(&Context, &Use<Value>) -> bool>(
&self,
ctx: &Context,
predicate: P,
other: &Value,
)
pub fn replace_some_uses_with<P: Fn(&Context, &Use<Value>) -> bool>( &self, ctx: &Context, predicate: P, other: &Value, )
Replace uses of the underlying definition, that satisfy pred, with other.
Sourcepub fn replace_all_uses_with(&self, ctx: &Context, other: &Value)
pub fn replace_all_uses_with(&self, ctx: &Context, other: &Value)
Replace all uses of the underlying definition with other.
Sourcepub fn replace_use_with(&self, ctx: &Context, use: Use<Value>, other: &Value)
pub fn replace_use_with(&self, ctx: &Context, use: Use<Value>, other: &Value)
Replace the given use of this Value with other.
Sourcepub fn get_defining_block(&self, ctx: &Context) -> Option<Ptr<BasicBlock>>
pub fn get_defining_block(&self, ctx: &Context) -> Option<Ptr<BasicBlock>>
Get the defining block of this value.
Trait Implementations§
Source§impl Named for Value
impl Named for Value
fn given_name(&self, ctx: &Context) -> Option<Identifier>
fn id(&self, _ctx: &Context) -> Identifier
fn unique_name(&self, ctx: &Context) -> Identifier
Source§impl Printable for Value
impl Printable for Value
impl Copy for Value
impl Eq for Value
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl Freeze for Value
impl !RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnsafeUnpin for Value
impl !UnwindSafe for Value
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,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.