mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-23 01:32:39 +00:00
Add a mechanism to define instruction categories, to support inspecting the common representation of similar kinds of instruction. Use that mechanism to make formatting of branch instructions slightly more type-safe. The idea here is to use the existing `Inst` mechanism for converting to and from structs, extended to operate on a struct representing multiple different kinds of instruction. In this case, the concrete kind of instruction is stored in the struct in a `kind` field, rather than being implied by the type. Factored out of #3555 where this mechanism is used to provide a common interface for runtime and symbolic name bindings.
Toolchain
A design is currently maintained in Google Drive. It'll be migrated to markdown once we are confident in its stability.