pub struct Ptr<T: ArenaObj> { /* private fields */ }Expand description
Pointer to an IR Object owned by Context.
Implementations§
Source§impl<'a, T: ArenaObj> Ptr<T>
impl<'a, T: ArenaObj> Ptr<T>
Sourcepub fn deref(&self, ctx: &'a Context) -> Ref<'a, T>
pub fn deref(&self, ctx: &'a Context) -> Ref<'a, T>
Return a Ref to the pointee.
This borrows from a RefCell and the borrow is live
as long as the returned Ref lives.
Run cargo with options +nightly -Zbuild-std -Zbuild-std-features="debug_refcell"
to enable printing the interior mutability violation locations.
Sourcepub fn deref_mut(&self, ctx: &'a Context) -> RefMut<'a, T>
pub fn deref_mut(&self, ctx: &'a Context) -> RefMut<'a, T>
Return a RefMut to the pointee.
This mutably borrows from a RefCell and the borrow is live
as long as the returned RefMut lives.
Run cargo with options +nightly -Zbuild-std -Zbuild-std-features="debug_refcell"
to enable printing the interior mutability violation locations.
Sourcepub fn try_deref(&self, ctx: &'a Context) -> Option<Ref<'a, T>>
pub fn try_deref(&self, ctx: &'a Context) -> Option<Ref<'a, T>>
Try and return a Ref to the pointee. This borrows from a RefCell and the borrow is live as long as the returned Ref lives.
Sourcepub fn try_deref_mut(&self, ctx: &'a Context) -> Option<RefMut<'a, T>>
pub fn try_deref_mut(&self, ctx: &'a Context) -> Option<RefMut<'a, T>>
Try and return a RefMut to the pointee. This mutably borrows from a RefCell and the borrow is live as long as the returned RefMut lives.
Source§impl<T> Ptr<T>where
T: LinkedList,
Linked list operations on Ptr<T: LinkedList> for convenience and safety.
impl<T> Ptr<T>where
T: LinkedList,
Linked list operations on Ptr<T: LinkedList> for convenience and safety.
Sourcepub fn insert_after(&self, ctx: &Context, mark: Ptr<T>)
pub fn insert_after(&self, ctx: &Context, mark: Ptr<T>)
Insert self after mark.
Sourcepub fn insert_before(&self, ctx: &Context, mark: Ptr<T>)
pub fn insert_before(&self, ctx: &Context, mark: Ptr<T>)
Insert self before mark.
Sourcepub fn insert_at_front(&self, container: Ptr<T::ContainerType>, ctx: &Context)
pub fn insert_at_front(&self, container: Ptr<T::ContainerType>, ctx: &Context)
Insert self as the head of the list.
Sourcepub fn insert_at_back(&self, container: Ptr<T::ContainerType>, ctx: &Context)
pub fn insert_at_back(&self, container: Ptr<T::ContainerType>, ctx: &Context)
Insert self as the tail of the list.
Source§impl Ptr<BasicBlock>
impl Ptr<BasicBlock>
Sourcepub fn is_succ_of(&self, ctx: &Context, pred: Ptr<BasicBlock>) -> bool
pub fn is_succ_of(&self, ctx: &Context, pred: Ptr<BasicBlock>) -> bool
Checks whether self is a successor of pred.
O(n) in the number of successors of pred.
Sourcepub fn retarget_some_preds_to<P: Fn(&Context, Ptr<BasicBlock>) -> bool>(
&self,
ctx: &Context,
predicate: P,
other: Ptr<BasicBlock>,
)
pub fn retarget_some_preds_to<P: Fn(&Context, Ptr<BasicBlock>) -> bool>( &self, ctx: &Context, predicate: P, other: Ptr<BasicBlock>, )
Retarget predecessors (that satisfy pred) to other.
Sourcepub fn retarget_pred_to(
&self,
ctx: &Context,
block_use: Use<Ptr<BasicBlock>>,
other: Ptr<BasicBlock>,
)
pub fn retarget_pred_to( &self, ctx: &Context, block_use: Use<Ptr<BasicBlock>>, other: Ptr<BasicBlock>, )
Retarget the given pred (block_use) of this Ptr<BasicBlock> to other.
Trait Implementations§
Source§impl Named for Ptr<BasicBlock>
impl Named for Ptr<BasicBlock>
fn given_name(&self, ctx: &Context) -> Option<Identifier>
fn id(&self, ctx: &Context) -> Identifier
fn unique_name(&self, ctx: &Context) -> Identifier
Source§impl Parsable for Ptr<TypeObj>
impl Parsable for Ptr<TypeObj>
Source§fn parse<'a>(
state_stream: &mut StateStream<'a>,
_arg: Self::Arg,
) -> ParseResult<'a, Self::Parsed>
fn parse<'a>( state_stream: &mut StateStream<'a>, _arg: Self::Arg, ) -> ParseResult<'a, Self::Parsed>
into on Parser::parse_stream to get the final ParseResult.
Use state_stream.state as necessary.Source§fn parser<'a>(
arg: Self::Arg,
) -> Box<dyn Parser<StateStream<'a>, Output = Self::Parsed, PartialState = ()> + 'a>
fn parser<'a>( arg: Self::Arg, ) -> Box<dyn Parser<StateStream<'a>, Output = Self::Parsed, PartialState = ()> + 'a>
Source§impl<T: ArenaObj + Printable> Printable for Ptr<T>
impl<T: ArenaObj + Printable> Printable for Ptr<T>
impl<T: ArenaObj> Copy for Ptr<T>
impl DefUseParticipant for Ptr<BasicBlock>
impl<T: ArenaObj> Eq for Ptr<T>
Auto Trait Implementations§
impl<T> Freeze for Ptr<T>
impl<T> RefUnwindSafe for Ptr<T>where
T: RefUnwindSafe,
impl<T> Send for Ptr<T>where
T: Send,
impl<T> Sync for Ptr<T>where
T: Sync,
impl<T> Unpin for Ptr<T>where
T: Unpin,
impl<T> UnwindSafe for Ptr<T>where
T: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.