comptime VM: dedicated Type builtin TypeId (8B), distinct from .any — foundation (dead)

Add TypeId.type_value (slot 19) + matching TypeInfo.type_value variant: an
8-byte type handle, distinct from the 16-byte boxed .any. All types.zig layout
handlers wired (size/align 8, display "Type", hash/eql); toLLVMTypeInfo -> i64.

Reserve builtin headroom: first_user 19 -> 100 (slots 20-99 padded with the
unresolved tripwire) so future builtins don't renumber user TypeIds / churn
sx ir snapshots. 22 IR snapshots regenerated (pure renumber to 100-base).

type_resolver still returns .any for "Type" — nothing produces .type_value
yet, so no behavior change. 697/0 both gates.
This commit is contained in:
agra
2026-06-18 13:03:21 +03:00
parent 7d59b5eeb6
commit 6844fb90e7
25 changed files with 39319 additions and 37485 deletions

View File

@@ -97,6 +97,10 @@ pub const TypeLowering = struct {
return c.LLVMVectorType(elem, vec.length);
},
.any => self.e.getAnyStructType(),
// A comptime `Type` value is an 8-byte type handle (a `TypeId` in a
// word), distinct from the 16-byte boxed Any. It is comptime-only, but
// the type still lowers (dead comptime-body code / a global slot) as i64.
.type_value => self.e.cached_i64,
.noreturn => self.e.cached_void,
.@"struct" => |s| {
// Build LLVM struct type from fields