mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Extend CARBON_KIND_SWITCH to support ArgAndKind (#5216)
This builds on #5212 which is adding ArgAndKind. This further modifies CARBON_KIND_SWITCH support so that we can use it with ArgAndKind in addition to Inst. That creates a quirk where it's easier if ArgAndKind provides `kind` as an accessor instead of a data member, so I'm just switching it to a class.
This commit is contained in:
@@ -684,8 +684,8 @@ static auto GetConstantValueForArg(EvalContext& eval_context,
|
||||
Phase* phase) -> int32_t {
|
||||
static constexpr auto Table =
|
||||
MakeArgHandlerTable(static_cast<SemIR::IdKind*>(nullptr));
|
||||
return Table[arg_and_kind.kind.ToIndex()](eval_context, arg_and_kind.value,
|
||||
phase);
|
||||
return Table[arg_and_kind.kind().ToIndex()](eval_context,
|
||||
arg_and_kind.value(), phase);
|
||||
}
|
||||
|
||||
// Given an instruction, replaces its type and operands with their constant
|
||||
|
||||
Reference in New Issue
Block a user