Expand description
A simplified version of rust mir.
Re-exportsΒ§
use std::fmt;πuse std::rc::Rc;πuse flux_arc_interner::List;πuse flux_common::index::Idx;πuse flux_common::index::IndexVec;πuse itertools::Itertools;πuse rustc_borrowck::consumers::BodyWithBorrowckFacts;πuse rustc_borrowck::consumers::BorrowData;πuse rustc_borrowck::consumers::BorrowIndex;πuse rustc_data_structures::fx::FxIndexMap;πuse rustc_data_structures::graph;πuse rustc_data_structures::graph::DirectedGraph;πuse rustc_data_structures::graph::StartNode;πuse rustc_data_structures::graph::dominators::Dominators;πuse rustc_data_structures::unord::UnordMap;πuse rustc_hir as hir;πuse rustc_hir::def_id::DefId;πuse rustc_index::IndexSlice;πuse rustc_macros::TyDecodable;πuse rustc_macros::TyEncodable;πuse rustc_middle::mir::Promoted;πuse rustc_middle::mir::VarDebugInfoContents;πuse rustc_middle::mir::WithRetag;πuse rustc_span::Span;πuse rustc_span::Symbol;πuse super::ty::Const;πuse super::ty::GenericArg;πuse super::ty::GenericArgs;πuse super::ty::Region;πuse super::ty::Ty;πuse crate::def_id_to_string;πuse crate::ty::Binder;πuse crate::ty::FnSig;πuse crate::ty::region_to_string;π
StructsΒ§
- Basic
Block Data - Body
- Body
Root - Call
Args - Const
Operand - The representation of constants in the mir is complicated. This struct is a thin wrapper around that representation. We donβt support all constants, but we ensure that at least the type of the constant is supported. Thus, we can always fallback to give a constant an unrefined type.
- Instance
- An
Instanceis the resolved call-target at a particular trait-call-site - Local
Decl - Place
- Place
Ref - Statement
- Terminator
- Basic
Block - A node in the MIR control-flow graph.
- Field
Idx - The source-order index of a field in a variant.
- Local
- Location
Locationrepresents the position of the start of the statement; or, ifstatement_indexequals the number of statements, then the start of the terminator.- Source
Info - 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.
- Switch
Targets - User
Type Annotation Index - Variant
Idx - The source-order index of a variant in a type.
EnumsΒ§
- Aggregate
Kind - Assert
Kind - BinOp
- Body
Kind - Selects a particular [
rustc_middle::mir::Body] within a [BodyWithBorrowckFacts]. - Call
Kind - Cast
Kind - NonDiverging
Intrinsic - Operand
- Place
Elem - Pointer
Cast - Rvalue
- Corresponds to https://doc.rust-lang.org/beta/nightly-rustc/rustc_middle/mir/enum.Rvalue.html
- Statement
Kind - Terminator
Kind - Borrow
Kind - Fake
Borrow Kind - Fake
Read Cause - The
FakeReadCausedescribes the type of pattern why a FakeRead statement exists. - Local
Kind - Classifies locals into categories. See
Body::local_kind. - RawPtr
Kind - UnOp
- Unwind
Action - Action to be taken when a stack unwind happens.
- Variance
ConstantsΒ§
- FIRST_
VARIANT - Equivalent to
VariantIdx(0). - RETURN_
PLACE - START_
BLOCK
FunctionsΒ§
- fmt_
edges π - The outgoing edges of a terminator, as rustc prints them (see its
TerminatorKind::fmt): the successors, labeled, with a cleanup block as theunwindsuccessor and any other unwind action after them (unwind continue, β¦):-> [return: bb1, unwind: bb2],-> [return: bb1, unwind continue]. A single successor and nothing else is printed unlabeled:-> bb2. - mk_
fake_ πpredecessors - The
FalseEdge/imaginary_targetedges mess up theis_join_pointcomputation 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 byrustc. The option is to recompute βpredecessorsβ from scratch but we may miss some cases there. (see alsois_join_point)