Struct rustc_middle::mir::BasicBlock [−][src]
pub struct BasicBlock {
private: u32,
}Expand description
A node in the MIR control-flow graph.
There are no branches (e.g., ifs, function calls, etc.) within a basic block, which makes
it easier to do data-flow analyses and optimizations. Instead, branches are represented
as an edge in a graph between basic blocks.
Basic blocks consist of a series of statements, ending with a
terminator. Basic blocks can have multiple predecessors and successors,
however there is a MIR pass (CriticalCallEdges) that removes critical edges, which
are edges that go from a multi-successor node to a multi-predecessor node. This pass is
needed because some analyses require that there are no critical edges in the CFG.
Note that this type is just an index into Body.basic_blocks;
the actual data that a basic block holds is in BasicBlockData.
Read more about basic blocks in the rustc-dev-guide.
Fields
private: u32Implementations
impl BasicBlock[src]
impl BasicBlock[src]pub const MAX_AS_U32: u32[src]
pub const MAX: Self[src]
pub const fn from_usize(value: usize) -> Self[src]
pub const fn from_u32(value: u32) -> Self[src]
pub const unsafe fn from_u32_unchecked(value: u32) -> Self[src]
impl BasicBlock[src]
impl BasicBlock[src]pub fn start_location(self) -> Location[src]
Trait Implementations
impl Add<usize> for BasicBlock[src]
impl Add<usize> for BasicBlock[src]impl Clone for BasicBlock[src]
impl Clone for BasicBlock[src]impl Debug for BasicBlock[src]
impl Debug for BasicBlock[src]impl<D: Decoder> Decodable<D> for BasicBlock[src]
impl<D: Decoder> Decodable<D> for BasicBlock[src]impl<E: Encoder> Encodable<E> for BasicBlock[src]
impl<E: Encoder> Encodable<E> for BasicBlock[src]impl Hash for BasicBlock[src]
impl Hash for BasicBlock[src]impl<'__ctx> HashStable<StableHashingContext<'__ctx>> for BasicBlock[src]
impl<'__ctx> HashStable<StableHashingContext<'__ctx>> for BasicBlock[src]fn hash_stable(
&self,
__hcx: &mut StableHashingContext<'__ctx>,
__hasher: &mut StableHasher
)[src]
&self,
__hcx: &mut StableHashingContext<'__ctx>,
__hasher: &mut StableHasher
)
impl Idx for BasicBlock[src]
impl Idx for BasicBlock[src]impl<'tcx> Index<BasicBlock> for Body<'tcx>[src]
impl<'tcx> Index<BasicBlock> for Body<'tcx>[src]type Output = BasicBlockData<'tcx>
type Output = BasicBlockData<'tcx>The returned type after indexing.
fn index(&self, index: BasicBlock) -> &BasicBlockData<'tcx>[src]
fn index(&self, index: BasicBlock) -> &BasicBlockData<'tcx>[src]Performs the indexing (container[index]) operation. Read more
impl<'tcx> IndexMut<BasicBlock> for Body<'tcx>[src]
impl<'tcx> IndexMut<BasicBlock> for Body<'tcx>[src]fn index_mut(&mut self, index: BasicBlock) -> &mut BasicBlockData<'tcx>[src]
fn index_mut(&mut self, index: BasicBlock) -> &mut BasicBlockData<'tcx>[src]Performs the mutable indexing (container[index]) operation. Read more
impl Ord for BasicBlock[src]
impl Ord for BasicBlock[src]impl PartialEq<BasicBlock> for BasicBlock[src]
impl PartialEq<BasicBlock> for BasicBlock[src]fn eq(&self, other: &BasicBlock) -> bool[src]
fn eq(&self, other: &BasicBlock) -> bool[src]This method tests for self and other values to be equal, and is used
by ==. Read more
fn ne(&self, other: &BasicBlock) -> bool[src]
fn ne(&self, other: &BasicBlock) -> bool[src]This method tests for !=.
impl PartialOrd<BasicBlock> for BasicBlock[src]
impl PartialOrd<BasicBlock> for BasicBlock[src]fn partial_cmp(&self, other: &BasicBlock) -> Option<Ordering>[src]
fn partial_cmp(&self, other: &BasicBlock) -> Option<Ordering>[src]This method returns an ordering between self and other values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool1.0.0[src]This method tests less than (for self and other) and is used by the < operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool1.0.0[src]This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl Step for BasicBlock[src]
impl Step for BasicBlock[src]fn steps_between(start: &Self, end: &Self) -> Option<usize>[src]
fn steps_between(start: &Self, end: &Self) -> Option<usize>[src]🔬 This is a nightly-only experimental API. (step_trait)
recently redesigned
Returns the number of successor steps required to get from start to end. Read more
fn forward_checked(start: Self, u: usize) -> Option<Self>[src]
fn forward_checked(start: Self, u: usize) -> Option<Self>[src]🔬 This is a nightly-only experimental API. (step_trait_ext)
recently added
Returns the value that would be obtained by taking the successor
of self count times. Read more
fn backward_checked(start: Self, u: usize) -> Option<Self>[src]
fn backward_checked(start: Self, u: usize) -> Option<Self>[src]🔬 This is a nightly-only experimental API. (step_trait_ext)
recently added
Returns the value that would be obtained by taking the predecessor
of self count times. Read more
fn forward(start: Self, count: usize) -> Self[src]
fn forward(start: Self, count: usize) -> Self[src]🔬 This is a nightly-only experimental API. (step_trait_ext)
recently added
Returns the value that would be obtained by taking the successor
of self count times. Read more
unsafe fn forward_unchecked(start: Self, count: usize) -> Self[src]
unsafe fn forward_unchecked(start: Self, count: usize) -> Self[src]🔬 This is a nightly-only experimental API. (step_trait_ext)
recently added
Returns the value that would be obtained by taking the successor
of self count times. Read more
fn backward(start: Self, count: usize) -> Self[src]
fn backward(start: Self, count: usize) -> Self[src]🔬 This is a nightly-only experimental API. (step_trait_ext)
recently added
Returns the value that would be obtained by taking the predecessor
of self count times. Read more
unsafe fn backward_unchecked(start: Self, count: usize) -> Self[src]
unsafe fn backward_unchecked(start: Self, count: usize) -> Self[src]🔬 This is a nightly-only experimental API. (step_trait_ext)
recently added
Returns the value that would be obtained by taking the predecessor
of self count times. Read more
impl Copy for BasicBlock[src]
impl Eq for BasicBlock[src]
impl StructuralEq for BasicBlock[src]
impl StructuralPartialEq for BasicBlock[src]
Auto Trait Implementations
impl RefUnwindSafe for BasicBlock
impl Send for BasicBlock
impl Sync for BasicBlock
impl Unpin for BasicBlock
impl UnwindSafe for BasicBlock
Blanket Implementations
impl<'tcx, T> ArenaAllocatable<'tcx, ()> for T where
T: Copy, [src]
impl<'tcx, T> ArenaAllocatable<'tcx, ()> for T where
T: Copy, [src]pub fn allocate_on(Self, &'a Arena<'tcx>) -> &'a mut T[src]
pub fn allocate_from_iter(
&'a Arena<'tcx>,
impl IntoIterator<Item = T>
) -> &'a mut [T]ⓘ[src]
&'a Arena<'tcx>,
impl IntoIterator<Item = T>
) -> &'a mut [T]ⓘ
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> MaybeResult<T> for T[src]
impl<T> MaybeResult<T> for T[src]impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn to_owned(&self) -> T[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)[src]
pub fn clone_into(&self, target: &mut T)[src]🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> WithConstness for T[src]
impl<T> WithConstness for T[src]fn with_constness(self, constness: Constness) -> ConstnessAnd<Self>[src]
fn with_const(self) -> ConstnessAnd<Self>[src]
fn without_const(self) -> ConstnessAnd<Self>[src]
impl<'a, T> Captures<'a> for T where
T: ?Sized, [src]
T: ?Sized,