Implements the MirBody type and basic routines for querying and modifying it.
Types
Local = object typ*: TypeId ## type of the local alignment*: uint32 ## alignment of the location, measured in bytes. 0 means "use default" flags*: TSymFlags isImmutable*: bool ## whether the local was originally defined with ``let``. Used for ## optimization purposes name*: PIdent ## either the user-defined name or 'nil'
- Static information about a local location ('let' or 'var'). Not modified after initialization. Source Edit
MirBody = object locals*: Locals ## all locals part of the body nextLabel*: LabelId ## the ID to use for a new label. Incremented when allocating a new ## label source*: SourceMap code*: MirTree
-
A MirBody represents a self-contained piece of MIR code. This can either be:
- the full body of a procedure
- the partial body a procedure
- a standalone statement/expression (currently supported for compile time code execution)
In each case, MirBody stores all the local data referenced and needed by the body's MIR code. It also store additional information associated with a body, such as how far the lowering is along.
Source Edit