Expand description
First-class type system for qcode IR values.
Every value (literal, instruction result, block param) carries a TypeId
that encodes both its size and its semantic kind. Types are interned once in
a TypeManager attached to the Context; all passes use TypeId as
a lightweight Copy handle.
§Type taxonomy
| Concrete type | Meaning |
|---|---|
IntType | Plain integer of n bytes |
BoolType | A byte-stored boolean, domain {0, 1} |
StackAddress | Pointer-width address in the stack memory space |
§Bool
bool is its own type (byte-stored, size() == 1) minted only by
comparisons and the true/false literals. The verifier pins its domain to
{0, 1} and rejects mixing bool with iN in a binop, so bitwise
And/Or/Xor over bool operands is logical and/or/xor.
§TODO
- Pointer types for RAM/register spaces.
Structs§
- Aggregate
Field - One field of an aggregate or struct type.
- Space
Address - A pointer-typed value carrying the memory space it points into.
- TypeId
- A lightweight handle to a type registered in
TypeManager. - Type
Manager - The type registry: a global, append-only table of
TypeIdidentities behind aRwLockso that types can be minted through a shared&reference (a prerequisite for running function passes in parallel against a sharedContextView). Reads — including theget_or_make_*hit path — take a read lock; only a cache miss takes the write lock (and re-checks under it). InternedTypeIds are globally stable and never remapped.
Enums§
- Type
Repr - Serializable description of a concrete
Type. - Type
Request - A structural type a function pass needs published before it can rewrite its body. Requests are returned to the pipeline driver and created at the module barrier; the requesting pass is then rerun against the new publication.