Expand description

This defines the syntax of MIR, i.e., the set of available MIR operations, and other definitions closely related to MIR semantics. This is in a dedicated file so that changes to this file can be reviewed more carefully. The intention is that this file only contains datatype declarations, no code.

Structs

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:

Enums

Information about an assertion failure.

The FakeReadCause describes the type of pattern why a FakeRead statement exists.

The various “big phases” that MIR goes through.

An operand in MIR represents a “value” in Rust, the definition of which is undecided and part of the memory model. One proposal for a definition of values can be found on UCG.

Describes what kind of retag is to be performed.

Rvalues The various kinds of rvalues that can appear in MIR.

The various kinds of statements that can appear in MIR.

A note on unwinding: Panics may occur during the execution of some terminators. Depending on the -C panic flag, this may either cause the program to abort or the call stack to unwind. Such terminators have a cleanup: Option<BasicBlock> field on them. If stack unwinding occurs, then once the current function is reached, execution continues at the given basic block, if any. If cleanup is None then no cleanup is performed, and the stack continues unwinding. This is equivalent to the execution of a Resume terminator.

Type Definitions

Type for MIR Assert terminator error messages.

Alias for projections as they appear in places, where the base is a place and the index is a local.