Skip to main content

Module numbered_values

Module numbered_values 

Source
Expand description

Slot-numbered value tables used by the textual IR parser.

Direct port of llvm/include/llvm/AsmParser/NumberedValues.h. The container is a u32 -> T map plus the smallest unused id; add is contractually monotonic — the upstream form asserts ID >= NextUnusedID, we surface that contract as a typed AddError.

The sealed forward_ref submodule ships the parser-side typestate (forward_ref::Unresolved / forward_ref::Resolved) that Sessions 1+3 of the parser-first roadmap consume to make “left a forward reference unresolved” a compile error rather than a late runtime failure.

Modules§

forward_ref
Forward-reference resolution typestate (Roadmap section 10.5).

Structs§

NumberedValues
Mapping from slot-id to value, remembering the next unused id.

Enums§

AddError
Failure modes for NumberedValues::add. Upstream uses assert(ID >= NextUnusedID); we prefer a typed error so the parser’s diagnostic path can attribute the failure to a span.