Skip to main content

Module types

Module types 

Source
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 typeMeaning
IntTypePlain integer of n bytes
BoolTypeA byte-stored boolean, domain {0, 1}
StackAddressPointer-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§

AggregateField
One field of an aggregate or struct type.
SpaceAddress
A pointer-typed value carrying the memory space it points into.
TypeId
A lightweight handle to a type registered in TypeManager.
TypeManager
The type registry: a global, append-only table of TypeId identities behind a RwLock so that types can be minted through a shared & reference (a prerequisite for running function passes in parallel against a shared ContextView). Reads — including the get_or_make_* hit path — take a read lock; only a cache miss takes the write lock (and re-checks under it). Interned TypeIds are globally stable and never remapped.

Enums§

TypeRepr
Serializable description of a concrete Type.
TypeRequest
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.

Traits§

Type