mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
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:
@@ -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()] =
|
||||
|
||||
Reference in New Issue
Block a user