Struct rustc::mir::repr::Mir [] [src]

pub struct Mir<'tcx> {
    pub basic_blocks: Vec<BasicBlockData<'tcx>>,
    pub scopes: Vec<ScopeData>,
    pub promoted: Vec<Mir<'tcx>>,
    pub return_ty: FnOutput<'tcx>,
    pub var_decls: Vec<VarDecl<'tcx>>,
    pub arg_decls: Vec<ArgDecl<'tcx>>,
    pub temp_decls: Vec<TempDecl<'tcx>>,
    pub upvar_decls: Vec<UpvarDecl>,
    pub span: Span,
}
Unstable (rustc_private)

Lowered representation of a single function.

Fields

basic_blocks: Vec<BasicBlockData<'tcx>>
Unstable (rustc_private)

List of basic blocks. References to basic block use a newtyped index type BasicBlock that indexes into this vector.

scopes: Vec<ScopeData>
Unstable (rustc_private)

List of lexical scopes; these are referenced by statements and used (eventually) for debuginfo. Indexed by a ScopeId.

promoted: Vec<Mir<'tcx>>
Unstable (rustc_private)

Rvalues promoted from this function, such as borrows of constants. Each of them is the Mir of a constant with the fn's type parameters in scope, but no vars or args and a separate set of temps.

return_ty: FnOutput<'tcx>
Unstable (rustc_private)

Return type of the function.

var_decls: Vec<VarDecl<'tcx>>
Unstable (rustc_private)

Variables: these are stack slots corresponding to user variables. They may be assigned many times.

arg_decls: Vec<ArgDecl<'tcx>>
Unstable (rustc_private)

Args: these are stack slots corresponding to the input arguments.

temp_decls: Vec<TempDecl<'tcx>>
Unstable (rustc_private)

Temp declarations: stack slots that for temporaries created by the compiler. These are assigned once, but they are not SSA values in that it is possible to borrow them and mutate them through the resulting reference.

upvar_decls: Vec<UpvarDecl>
Unstable (rustc_private)

Names and capture modes of all the closure upvars, assuming the first argument is either the closure or a reference to it.

span: Span
Unstable (rustc_private)

A span representing this MIR, for error reporting

Methods

impl<'tcx> Mir<'tcx>
[src]

fn all_basic_blocks(&self) -> Vec<BasicBlock>

fn basic_block_data(&self, bb: BasicBlock) -> &BasicBlockData<'tcx>

fn basic_block_data_mut(&mut self, bb: BasicBlock) -> &mut BasicBlockData<'tcx>

impl<'a, 'gcx, 'tcx> Mir<'tcx>
[src]

fn operand_ty(&self, tcx: TyCtxt<'a, 'gcx, 'tcx>, operand: &Operand<'tcx>) -> Ty<'tcx>

fn binop_ty(&self, tcx: TyCtxt<'a, 'gcx, 'tcx>, op: BinOp, lhs_ty: Ty<'tcx>, rhs_ty: Ty<'tcx>) -> Ty<'tcx>

fn lvalue_ty(&self, tcx: TyCtxt<'a, 'gcx, 'tcx>, lvalue: &Lvalue<'tcx>) -> LvalueTy<'tcx>

fn rvalue_ty(&self, tcx: TyCtxt<'a, 'gcx, 'tcx>, rvalue: &Rvalue<'tcx>) -> Option<Ty<'tcx>>

Trait Implementations

impl<'tcx> Index<BasicBlock> for Mir<'tcx>
[src]

type Output = BasicBlockData<'tcx>

The returned type after indexing

fn index(&self, index: BasicBlock) -> &BasicBlockData<'tcx>

The method for the indexing (Foo[Bar]) operation

impl<'tcx> IndexMut<BasicBlock> for Mir<'tcx>
[src]

fn index_mut(&mut self, index: BasicBlock) -> &mut BasicBlockData<'tcx>

The method for the indexing (Foo[Bar]) operation

Derived Implementations

impl<'tcx> Decodable for Mir<'tcx>
[src]

fn decode<__D: Decoder>(__arg_0: &mut __D) -> Result<Mir<'tcx>, __D::Error>

impl<'tcx> Encodable for Mir<'tcx>
[src]

fn encode<__S: Encoder>(&self, __arg_0: &mut __S) -> Result<(), __S::Error>

impl<'tcx> Clone for Mir<'tcx>
[src]

fn clone(&self) -> Mir<'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