Add facet type values and an instruction that produces them (#4460)

Still to do:
* Represent facet type values in a canonical form
* Produce & consume facet type values instead of interface values
* `type` should be associated with a canonical facet type value
* Support `&` on facet type values
* Type check and enforce requirements in facet types

---------

Co-authored-by: Josh L <josh11b@users.noreply.github.com>
This commit is contained in:
josh11b
2024-11-04 21:43:55 +00:00
committed by GitHub
co-authored by Josh L
parent 607522c7de
commit ea0b0b4b48
18 changed files with 495 additions and 253 deletions
+11
View File
@@ -956,6 +956,17 @@ class FormatterImpl {
}
}
auto FormatArg(FacetTypeId id) -> void {
const auto& info = sem_ir_.facet_types().Get(id);
out_ << "<facet-type ";
FormatType(info.base_facet_type_id);
if (info.requirement_block_id.is_valid()) {
// TODO: include specifics
out_ << "+requirements";
}
out_ << ">";
}
auto FormatArg(IntKind k) -> void { k.Print(out_); }
auto FormatArg(FloatKind k) -> void { k.Print(out_); }