Enum rustc::mir::repr::TerminatorKind
[−]
[src]
pub enum TerminatorKind<'tcx> { Goto { target: BasicBlock, }, If { cond: Operand<'tcx>, targets: (BasicBlock, BasicBlock), }, Switch { discr: Lvalue<'tcx>, adt_def: AdtDef<'tcx>, targets: Vec<BasicBlock>, }, SwitchInt { discr: Lvalue<'tcx>, switch_ty: Ty<'tcx>, values: Vec<ConstVal>, targets: Vec<BasicBlock>, }, Resume, Return, Drop { value: Lvalue<'tcx>, target: BasicBlock, unwind: Option<BasicBlock>, }, Call { func: Operand<'tcx>, args: Vec<Operand<'tcx>>, destination: Option<(Lvalue<'tcx>, BasicBlock)>, cleanup: Option<BasicBlock>, }, }
rustc_private
)Variants
Goto
rustc_private
)block should have one successor in the graph; we jump there
Fields
target: BasicBlock | Unstable ( rustc_private ) |
If
rustc_private
)jump to branch 0 if this lvalue evaluates to true
Fields
cond: Operand<'tcx> | Unstable ( rustc_private ) |
targets: (BasicBlock, BasicBlock) | Unstable ( rustc_private ) |
Switch
rustc_private
)lvalue evaluates to some enum; jump depending on the branch
Fields
discr: Lvalue<'tcx> | Unstable ( rustc_private ) |
adt_def: AdtDef<'tcx> | Unstable ( rustc_private ) |
targets: Vec<BasicBlock> | Unstable ( rustc_private ) |
SwitchInt
rustc_private
)operand evaluates to an integer; jump depending on its value
to one of the targets, and otherwise fallback to otherwise
Fields
discr: Lvalue<'tcx> | Unstable ( rustc_private )discriminant value being tested |
switch_ty: Ty<'tcx> | Unstable ( rustc_private )type of value being tested |
values: Vec<ConstVal> | Unstable ( rustc_private )Possible values. The locations to branch to in each case
are found in the corresponding indices from the |
targets: Vec<BasicBlock> | Unstable ( rustc_private )Possible branch sites. The length of this vector should be
equal to the length of the |
Resume
rustc_private
)Indicates that the landing pad is finished and unwinding should continue. Emitted by build::scope::diverge_cleanup.
Return
rustc_private
)Indicates a normal return. The ReturnPointer lvalue should have been filled in by now. This should occur at most once.
Drop
rustc_private
)Drop the Lvalue
Fields
value: Lvalue<'tcx> | Unstable ( rustc_private ) |
target: BasicBlock | Unstable ( rustc_private ) |
unwind: Option<BasicBlock> | Unstable ( rustc_private ) |
Call
rustc_private
)Block ends with a call of a converging function
Fields
func: Operand<'tcx> | Unstable ( rustc_private )The function that’s being called |
args: Vec<Operand<'tcx>> | Unstable ( rustc_private )Arguments the function is called with |
destination: Option<(Lvalue<'tcx>, BasicBlock)> | Unstable ( rustc_private )Destination for the return value. If some, the call is converging. |
cleanup: Option<BasicBlock> | Unstable ( rustc_private )Cleanups to be done if the call unwinds. |
Methods
impl<'tcx> TerminatorKind<'tcx>
[src]
fn successors(&self) -> Cow<[BasicBlock]>
fn successors_mut(&mut self) -> Vec<&mut BasicBlock>
impl<'tcx> TerminatorKind<'tcx>
[src]
fn fmt_head<W: Write>(&self, fmt: &mut W) -> Result
rustc_private
)Write the "head" part of the terminator; that is, its name and the data it uses to pick the successor basic block, if any. The only information not inlcuded is the list of possible successors, which may be rendered differently between the text and the graphviz format.
fn fmt_successor_labels(&self) -> Vec<Cow<'static, str>>
rustc_private
)Return the list of labels for the edges to the successor basic blocks.
Trait Implementations
impl<'tcx> Debug for TerminatorKind<'tcx>
[src]
Derived Implementations
impl<'tcx> Decodable for TerminatorKind<'tcx>
[src]
fn decode<__D: Decoder>(__arg_0: &mut __D) -> Result<TerminatorKind<'tcx>, __D::Error>
impl<'tcx> Encodable for TerminatorKind<'tcx>
[src]
impl<'tcx> Clone for TerminatorKind<'tcx>
[src]
fn clone(&self) -> TerminatorKind<'tcx>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more