Use TypeEnum for ScopeId to refactor call structure (#5491)

I'm trying to make the offsetting a little easier to understand, and
also get a better `requires` structure on calls. The second is for an
attempt to refactor the `Formatter` API, but also changing the `InstId`
`derived_from` requires seems helpful for clarity on what's really
happening.
This commit is contained in:
Jon Ross-Perkins
2025-05-20 22:16:28 +00:00
committed by GitHub
parent df36a555e8
commit 14f19b5a86
9 changed files with 195 additions and 150 deletions
+1 -2
View File
@@ -679,8 +679,7 @@ using ArgHandlerFnT = auto(EvalContext& context, int32_t arg, Phase* phase)
// Returns a lookup table to get constants by Id::Kind. Requires a null IdKind
// as a parameter in order to get the type pack.
template <typename... Types>
static constexpr auto MakeArgHandlerTable(
SemIR::TypeEnum<Types...>* /*id_kind*/)
static constexpr auto MakeArgHandlerTable(TypeEnum<Types...>* /*id_kind*/)
-> std::array<ArgHandlerFnT*, SemIR::IdKind::NumValues> {
std::array<ArgHandlerFnT*, SemIR::IdKind::NumValues> table = {};
((table[SemIR::IdKind::template For<Types>.ToIndex()] =