Enum rustc::mir::TerminatorKind
[−]
[src]
pub enum TerminatorKind<'tcx> {
Goto {
target: BasicBlock,
},
SwitchInt {
discr: Operand<'tcx>,
switch_ty: Ty<'tcx>,
values: Cow<'tcx, [ConstInt]>,
targets: Vec<BasicBlock>,
},
Resume,
Return,
Unreachable,
Drop {
location: Lvalue<'tcx>,
target: BasicBlock,
unwind: Option<BasicBlock>,
},
DropAndReplace {
location: Lvalue<'tcx>,
value: Operand<'tcx>,
target: BasicBlock,
unwind: Option<BasicBlock>,
},
Call {
func: Operand<'tcx>,
args: Vec<Operand<'tcx>>,
destination: Option<(Lvalue<'tcx>, BasicBlock)>,
cleanup: Option<BasicBlock>,
},
Assert {
cond: Operand<'tcx>,
expected: bool,
msg: AssertMessage<'tcx>,
target: BasicBlock,
cleanup: Option<BasicBlock>,
},
}rustc_private)Variants
Gotorustc_private)block should have one successor in the graph; we jump there
Fields of Goto
target: BasicBlock | 🔬 This is a nightly-only experimental API. ( rustc_private) |
SwitchIntrustc_private)operand evaluates to an integer; jump depending on its value
to one of the targets, and otherwise fallback to otherwise
Fields of SwitchInt
discr: Operand<'tcx> | 🔬 This is a nightly-only experimental API. ( rustc_private)discriminant value being tested |
switch_ty: Ty<'tcx> | 🔬 This is a nightly-only experimental API. ( rustc_private)type of value being tested |
values: Cow<'tcx, [ConstInt]> | 🔬 This is a nightly-only experimental API. ( rustc_private)Possible values. The locations to branch to in each case
are found in the corresponding indices from the |
targets: Vec<BasicBlock> | 🔬 This is a nightly-only experimental API. ( rustc_private)Possible branch sites. The last element of this vector is used for the otherwise branch, so values.len() == targets.len() + 1 should hold. |
Resumerustc_private)Indicates that the landing pad is finished and unwinding should continue. Emitted by build::scope::diverge_cleanup.
Returnrustc_private)Indicates a normal return. The return pointer lvalue should have been filled in by now. This should occur at most once.
Unreachablerustc_private)Indicates a terminator that can never be reached.
Droprustc_private)Drop the Lvalue
Fields of Drop
location: Lvalue<'tcx> | 🔬 This is a nightly-only experimental API. ( rustc_private) |
target: BasicBlock | 🔬 This is a nightly-only experimental API. ( rustc_private) |
unwind: Option<BasicBlock> | 🔬 This is a nightly-only experimental API. ( rustc_private) |
DropAndReplacerustc_private)Drop the Lvalue and assign the new value over it
Fields of DropAndReplace
location: Lvalue<'tcx> | 🔬 This is a nightly-only experimental API. ( rustc_private) |
value: Operand<'tcx> | 🔬 This is a nightly-only experimental API. ( rustc_private) |
target: BasicBlock | 🔬 This is a nightly-only experimental API. ( rustc_private) |
unwind: Option<BasicBlock> | 🔬 This is a nightly-only experimental API. ( rustc_private) |
Callrustc_private)Block ends with a call of a converging function
Fields of Call
func: Operand<'tcx> | 🔬 This is a nightly-only experimental API. ( rustc_private)The function that’s being called |
args: Vec<Operand<'tcx>> | 🔬 This is a nightly-only experimental API. ( rustc_private)Arguments the function is called with |
destination: Option<(Lvalue<'tcx>, BasicBlock)> | 🔬 This is a nightly-only experimental API. ( rustc_private)Destination for the return value. If some, the call is converging. |
cleanup: Option<BasicBlock> | 🔬 This is a nightly-only experimental API. ( rustc_private)Cleanups to be done if the call unwinds. |
Assertrustc_private)Jump to the target if the condition has the expected value, otherwise panic with a message and a cleanup target.
Fields of Assert
cond: Operand<'tcx> | 🔬 This is a nightly-only experimental API. ( rustc_private) |
expected: bool | 🔬 This is a nightly-only experimental API. ( rustc_private) |
msg: AssertMessage<'tcx> | 🔬 This is a nightly-only experimental API. ( rustc_private) |
target: BasicBlock | 🔬 This is a nightly-only experimental API. ( rustc_private) |
cleanup: Option<BasicBlock> | 🔬 This is a nightly-only experimental API. ( rustc_private) |
Methods
impl<'tcx> TerminatorKind<'tcx>[src]
fn if_<'a, 'gcx>(tcx: TyCtxt<'a, 'gcx, 'tcx>,
cond: Operand<'tcx>,
t: BasicBlock,
f: BasicBlock)
-> TerminatorKind<'tcx>
cond: Operand<'tcx>,
t: BasicBlock,
f: BasicBlock)
-> TerminatorKind<'tcx>
rustc_private)fn successors(&self) -> Cow<[BasicBlock]>
rustc_private)fn successors_mut(&mut self) -> Vec<&mut BasicBlock>
rustc_private)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> 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
impl<'tcx> Encodable for TerminatorKind<'tcx>[src]
fn encode<__S: Encoder>(&self, __arg_0: &mut __S) -> Result<(), __S::Error>
🔬 This is a nightly-only experimental API. (rustc_private)
deprecated in favor of rustc-serialize on crates.io
impl<'tcx> Decodable for TerminatorKind<'tcx>[src]
fn decode<__D: Decoder>(__arg_0: &mut __D)
-> Result<TerminatorKind<'tcx>, __D::Error>
-> Result<TerminatorKind<'tcx>, __D::Error>
🔬 This is a nightly-only experimental API. (rustc_private)
deprecated in favor of rustc-serialize on crates.io