[][src]Struct yz_basic_block::Arena

pub struct Arena<S, C> { /* fields omitted */ }

Implementations

impl<S, C> Arena<S, C> where
    BasicBlock<S, C, BbId>: ForeachTarget<JumpTarget = BbId>, 
[src]

pub fn check(&self) -> Result<(), OffendingIds>[src]

Use this method to re-check all references in the Arena after modifications via Arena::bbs_mut.

pub fn push(
    &mut self,
    bb: BasicBlock<S, C, BbId>
) -> Result<usize, (BasicBlock<S, C, BbId>, OffendingIds)>
[src]

Returns the ID of the newly appended BB if successful, or $bb & the invalid BbIds.

pub fn pop(
    &mut self
) -> Option<Result<(usize, BasicBlock<S, C, BbId>, Vec<String>), OffendingIds>>
[src]

Removes the last BB, fails if any references to it exist. If successful, returns the removed BB and all labels which referenced it. Otherwise, returns the offending BBs (which still reference it)

impl<S, C> Arena<S, C> where
    S: ForeachTarget<JumpTarget = BbId>,
    C: ForeachTarget<JumpTarget = BbId>, 
[src]

pub fn optimize(&mut self) -> bool[src]

impl<S, C> Arena<S, C>[src]

pub fn new() -> Self[src]

pub fn bbs(&self) -> &[BasicBlock<S, C, BbId>][src]

pub fn bbs_mut(&mut self) -> &mut [BasicBlock<S, C, BbId>][src]

pub fn labels(&self) -> &Map<String, usize>[src]

pub fn labels_of_bb(&self, bbid: BbId) -> impl Iterator<Item = &str>[src]

pub fn label2bb(&self, label: &str) -> Option<(BbId, &BasicBlock<S, C, BbId>)>[src]

pub fn set_label(
    &mut self,
    label: Label,
    target: BbId,
    overwrite: bool
) -> Result<Option<BbId>, SetBbLabelError>
[src]

If this call replaced the current label->BB-ID association, then the old associated BBID is returned.

pub fn shrink_to_fit(&mut self)[src]

Trait Implementations

impl<S: Debug, C: Debug> Debug for Arena<S, C>[src]

impl<S, C> Default for Arena<S, C>[src]

impl<S, C> ForeachTarget for Arena<S, C> where
    BasicBlock<S, C, BbId>: ForeachTarget<JumpTarget = BbId>, 
[src]

type JumpTarget = BbId

Auto Trait Implementations

impl<S, C> RefUnwindSafe for Arena<S, C> where
    C: RefUnwindSafe,
    S: RefUnwindSafe

impl<S, C> Send for Arena<S, C> where
    C: Send,
    S: Send

impl<S, C> Sync for Arena<S, C> where
    C: Sync,
    S: Sync

impl<S, C> Unpin for Arena<S, C> where
    C: Unpin,
    S: Unpin

impl<S, C> UnwindSafe for Arena<S, C> where
    C: UnwindSafe,
    S: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<C, T> ForeachTarget for C where
    T: ForeachTarget,
    &'a C: for<'a> IntoIterator,
    &'a mut C: for<'a> IntoIterator,
    <&'a C as IntoIterator>::Item == &'a T,
    <&'a mut C as IntoIterator>::Item == &'a mut T, 
[src]

type JumpTarget = <T as ForeachTarget>::JumpTarget

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.