Expand description
Xur’s bytecode, and lowering resolved syntax to it.
Each function becomes a control-flow graph of basic blocks over virtual
registers (see ir). The shape is close to Cranelift’s IR, so a JIT can
later compile the same code the interpreter runs.
Re-exports§
pub use ir::Block;pub use ir::BlockId;pub use ir::Constant;pub use ir::Decorator;pub use ir::DefRef;pub use ir::Function;pub use ir::Inst;pub use ir::InstKind;pub use ir::RecordFields;pub use ir::Reg;pub use ir::Terminator;pub use ir::TypeArg;
Modules§
- ir
- The instruction set.
Structs§
- Field
Sig - FnSig
- A function’s parameters and return type.
- Item
Index - Every function, constant and constructor of the loaded modules, by definition. Updated as modules are imported.
- Param
Sig - Variant
Sig
Enums§
- BinOp
Kind - ItemRef
- What lowering needs to know about a definition.
- RtType
- A type written in the source, as checked at runtime. Xur is checked dynamically: where a type is written it is enforced when the value arrives, and where it isn’t (or is generic) anything goes.
- TypeSig
- A written type, in full.
- UnOp
Functions§
- display_
function - Lists
functionand the closures it creates. - fn_
signature - The signature of the top-level function
namein the program’s root module, orNoneif there is no such function. - lower
- Lowers the function or constant
def, or returnsNoneifdefis neither. A constant lowers to a function without parameters that computes its value. - rt_type
- The runtime check for a written type, or
Nonewhen nothing about it can be checked (an inferred or generic type). - type_
def - The struct, enum or native type a written type names, if any.
- type_
name - How a written type is named at runtime, e.g. by
type_name:u32,Point,[u8], or_for a type left to be inferred.