mirror of
https://github.com/odin-lang/Odin.git
synced 2026-07-22 15:32:35 +00:00
Extend tablegen to emit builders_gen.odin -- 723 opcodes get a low-level inst_<OpName>(buf, ...) constructor and a high-level Builder method, mapping each grammar operand to a typed param (IdResultType->Type_Ref, IdResult->auto-allocated Id, IdRef->Id, LiteralInteger->i64, ValueEnum/BitEnum->the typed enum, trailing IdRef* -> []Id). builder.odin keeps just the hand-written Builder infrastructure. Skipped (stay hand-writable, like an ISA's can_generate_builder): operands that aren't simple typed params yet (optional, Pair* composites, LiteralString), type-declaration opcodes (those are ir.Type), and verbs colliding with Odin keywords/builtins (return_, switch_, size_of, ...). Validated: a function body built via i_add / return_ encodes + round-trips byte-exact (builder_made test) -> 10 passed.