Module mir

Source
Expand description

A simplified version of rust mir.

Structs§

BasicBlockData
Body
CallArgs
Instance
An Instance is the resolved call-target at a particular trait-call-site
LocalDecl
Place
PlaceRef
Statement
Terminator
BasicBlock
A node in the MIR control-flow graph.
FieldIdx
The source-order index of a field in a variant.
Local
Location
Location represents the position of the start of the statement; or, if statement_index equals the number of statements, then the start of the terminator.
SourceInfo
Grouped information about the source code origin of a MIR entity. Intended to be inspected by diagnostics and debuginfo. Most passes can work with it as a whole, within a single function.
SwitchTargets
UserTypeAnnotationIndex
VariantIdx
The source-order index of a variant in a type.

Enums§

AggregateKind
AssertKind
BinOp
CallKind
CastKind
Constant
NonDivergingIntrinsic
NullOp
Operand
PlaceElem
PointerCast
Rvalue
Corresponds to https://doc.rust-lang.org/beta/nightly-rustc/rustc_middle/mir/enum.Rvalue.html
StatementKind
TerminatorKind
BorrowKind
FakeBorrowKind
FakeReadCause
The FakeReadCause describes the type of pattern why a FakeRead statement exists.
LocalKind
Classifies locals into categories. See Body::local_kind.
UnOp
UnwindAction
Action to be taken when a stack unwind happens.
Variance

Constants§

FIRST_VARIANT
Equivalent to VariantIdx(0).
RETURN_PLACE
START_BLOCK

Functions§

mk_fake_predecessors 🔒
The FalseEdge/imaginary_target edges mess up the is_join_point computation which creates spurious join points that lose information e.g. in match arms, the k+1-th arm has the k-th arm as a “fake” predecessor so we lose the assumptions specific to the k+1-th arm due to a spurious join. This code corrects for this problem by computing the number of “fake” predecessors and decreasing them from the total number of “predecessors” returned by rustc. The option is to recompute “predecessors” from scratch but we may miss some cases there. (see also is_join_point)
opt_bb_to_str 🔒
replicate_infer_ctxt 🔒
Replicate the InferCtxt used for mir typeck by generating region variables for every region in the RegionInferenceContext

Type Aliases§

LocalDecls