flowistry_pdg::rustc

Module mir

Source
Expand description

MIR datatypes and passes. See the rustc dev guide for more info.

Modules§

Structs§

  • A node in the MIR control-flow graph.
  • Data for a basic block, including a list of its statements.
  • BlockTailInfo is attached to the LocalDecl for temporaries created during evaluation of expressions in a block tail expression; that is, a block like { STMT_1; STMT_2; EXPR }.
  • The lowered representation of a single function.
  • Indicates an outlives-constraint between a type or between two free regions declared on the closure.
  • Represents a ty::Ty for use in ClosureOutlivesSubject.
  • After we borrow check a closure, we are left with various requirements that we have inferred between the free regions that appear in the closure’s signature or on its field types. These requirements are then verified and proved by the closure’s creating function. This struct encodes those requirements.
  • Evaluated Constants Represents the result of const evaluation via the eval_to_allocation query. Not to be confused with ConstAllocation, which directly refers to the underlying data! Here we indirect via an AllocId.
  • The result of the mir_const_qualif query.
  • Additional information carried by a MIR body when it is lowered from a coroutine. This information is modified as it is lowered during the StateTransform MIR pass, so not all fields will be active at a given time. For example, the yield_ty is taken out of the field after yields are turned into returns, and the coroutine_drop body is only populated after the state transform pass.
  • The layout of coroutine state.
  • The constituent parts of a mir constant of kind ADT or array.
  • A MIR local.
  • 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.
  • Where a specific mir::Body comes from.
  • Places roughly correspond to a “location in memory.” Places in MIR are the same mathematical object as places in Rust. This of course means that what exactly they are is undecided and part of the Rust memory model. However, they will likely contain at least the following pieces of information in some form:
  • 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.
  • A statement in a basic block, including information about its source code.
  • An unevaluated (potentially generic) constant used in MIR.
  • Encodes the effect of a user-supplied type annotation on the subcomponents of a pattern. The effect is determined by applying the given list of projections to some underlying base type. Often, the projection element list projs is empty, in which case this directly encodes a type in base. But in the case of complex patterns with subpatterns and bindings, we want to apply only a part of the type to a variable, in which case the projs vector is used.
  • A collection of projections into user types.
  • Debug information pertaining to a user variable.

Enums§

Constants§

Traits§

Functions§

  • Attempts to open a file where we should dump a given MIR or other bit of MIR-related data. Used by mir-dump, but also by other bits of code (e.g., NLL inference) that dump graphviz data or other things, and hence takes the extension as an argument.
  • Dumps the size and metadata and content of an allocation to the given writer. The expectation is that the caller first prints other relevant metadata, so the exact format of this function is (without leading or trailing newline):
  • If the session is properly configured, dumps a human-readable representation of the MIR (with default pretty-printing options) into:
  • Write a graphviz DOT graph of a list of MIRs.
  • Write out a human-readable textual representation for the given MIR, with the default PrettyPrintMirOptions.

Type Aliases§

  • Type for MIR Assert terminator error messages.
  • Types for locals
  • Alias for projections as they appear in places, where the base is a place and the index is a local.
  • Alias for projections as they appear in UserTypeProjection, where we need neither the V parameter for Index nor the T for Field.