Expand description
IR value types and the central ValueId discriminant.
Every piece of IR state is a value — a constant, an instruction result,
a memory location, a basic block, or a function. Values are stored in a
Context arena and addressed through cheap, Copy ID types. To inspect
a value you convert its ID into a reference type (e.g. InstructionRef,
BlockRef) that borrows the context.
§Type Map
| ID type | Reference type | What it represents |
|---|---|---|
LiteralId | LiteralRef | Integer constant |
InstructionId | InstructionRef | SSA value |
VarnodeId | VarnodeRef | Named memory location |
BlockId | BlockRef | Basic block |
FunctionId | FunctionRef | Lifted or external function |
The ValueId enum unifies all five ID types so that code that works with
arbitrary values (e.g. use-def chains, operand lists) can do so without
generics.
Re-exports§
pub use block::cfg::LocalBlockId;pub use block::BasicBlock;pub use block::BlockId;pub use block::BlockMutRef;pub use block::BlockRef;pub use block_param::BlockParam;pub use block_param::BlockParamId;pub use block_param::BlockParamMutRef;pub use block_param::BlockParamRef;pub use block_param::LocalParamId;pub use bytes::Bytes;pub use bytes::BytesDisplay;pub use bytes::BytesId;pub use bytes::BytesRef;pub use bytes::StringEncoding;pub use bytes::decode_string;pub use bytes::escape_decoded;pub use bytes::render_bytes_literal;pub use function::ArgMemKind;pub use function::BodyArenaKindStats;pub use function::BodyArenaStats;pub use function::DerivedOutput;pub use function::ExternArg;pub use function::ExternArgmem;pub use function::ExternInterface;pub use function::ExternSlot;pub use function::Footprint;pub use function::FunctionBody;pub use function::FunctionEffects;pub use function::FunctionId;pub use function::FunctionKind;pub use function::FunctionMutRef;pub use function::FunctionRef;pub use function::InterfaceSlot;pub use function::MemoryChannelState;pub use function::MemoryInterfaceMap;pub use function::ParamAttrs;pub use function::RamBase;pub use function::RamField;pub use function::RamLocations;pub use function::RamObject;pub use function::RamRegion;pub use function::RegisterChannelState;pub use function::RegisterEffectSets;pub use function::RegisterInterfaceMap;pub use function::SlotBase;pub use function::WrittenSpaces;pub use function::WrittenSpacesState;pub use insn::LocalInsnId;pub use insn::Instruction;pub use insn::InstructionId;pub use insn::InstructionRef;pub use literal::LiteralId;pub use literal::LiteralRef;pub use poison::Poison;pub use poison::PoisonId;pub use poison::PoisonRef;pub use temp::LocalTempId;pub use temp::LocalTempSpaceId;pub use temp::Temp;pub use temp::TempId;pub use temp::TempRef;pub use temp::TempSpace;pub use temp::TempSpaceId;pub use temp::TempSpaceRef;pub use util::named::Named;pub use util::named::Renameable;pub use varnode::Varnode;pub use varnode::VarnodeId;pub use varnode::VarnodeRef;pub use view::BodyView;pub use view::ModuleView;pub use view::QCodeView;pub use view_mut::QCodeMut;
Modules§
- block
- block_
param - bytes
- Opaque compile-time byte blobs — constants wider than a
Literalcan hold. - function
- insn
- Core SSA value type: instructions. An instruction is a value that is defined by an operation and can be used by other instructions. Each instruction has a mnemonic, which is the operation that it performs, and a size in bytes of the value it defines. Instructions that do not define a value (e.g. terminators) have a size of 0.
- interner
- Append-only interners for constants (literals and byte blobs), wrapped in an
RwLockso they can be minted through a shared&reference — the prerequisite for a function pass creating a constant while it holds only aContextView. Interned ids are globally stable and never remapped. - literal
- Compile-time integer constants, optionally with symbolic labels.
- poison
- First-class poison values (argpromote v2,
ARGPROMOTE_REGISTERS_V2.md). - registry
- temp
- Function-local temporary spaces and values.
- util
- varnode
- Varnodes: named, typed memory locations used as IR operands.
- view
- Static immutable providers for qcode IR reads.
- view_
mut - The mutable-host counterpart of
QCodeView: one trait carrying the body-local mutation verbs, implemented by both mutation hosts.
Structs§
- Register
- A PCode register
- Register
Id - A stable identifier for a
Register.
Enums§
- Local
Value Id - The body-local twin of
ValueId: the form an in-body operand holds once storage is localized (stage 6a, ruling 2). - ValueId
- A type-erased handle to any IR value stored in a
Context. - Value
Ref - A borrowed, type-erased view of any value in a
Context.
Traits§
- Value
- Trait implemented by all typed value reference types.