Move common entity fields to a 'base' struct. (#4161)

I'd considered moving DeclParams uses over, but when handling qualified
names, there's a parse node instead of an instruction. I did try to
unify a couple other uses though, including adding MergeDefinition. I
expect `interface` will use a little more once it's more completely
implemented, but maybe I'm wrong about that.
This commit is contained in:
Jon Ross-Perkins
2024-07-24 23:26:00 +00:00
committed by GitHub
parent a0973f4f47
commit bf89652a4d
21 changed files with 331 additions and 308 deletions
+4 -7
View File
@@ -32,8 +32,7 @@ static auto PerformCallToGenericClass(Context& context, Parse::NodeId node_id,
// Convert the arguments to match the parameters.
auto converted_args_id = ConvertCallArgs(
context, node_id, /*self_id=*/SemIR::InstId::Invalid, arg_ids,
/*return_storage_id=*/SemIR::InstId::Invalid, class_info.decl_id,
specific_id, class_info.implicit_param_refs_id, class_info.param_refs_id);
/*return_storage_id=*/SemIR::InstId::Invalid, class_info, specific_id);
return context.AddInst<SemIR::Call>(node_id,
{.type_id = SemIR::TypeId::TypeType,
.callee_id = callee_id,
@@ -59,9 +58,8 @@ static auto PerformCallToGenericInterface(Context& context,
// Convert the arguments to match the parameters.
auto converted_args_id = ConvertCallArgs(
context, node_id, /*self_id=*/SemIR::InstId::Invalid, arg_ids,
/*return_storage_id=*/SemIR::InstId::Invalid, interface_info.decl_id,
specific_id, interface_info.implicit_param_refs_id,
interface_info.param_refs_id);
/*return_storage_id=*/SemIR::InstId::Invalid, interface_info,
specific_id);
return context.AddInst<SemIR::Call>(node_id,
{.type_id = SemIR::TypeId::TypeType,
.callee_id = callee_id,
@@ -156,8 +154,7 @@ auto PerformCall(Context& context, Parse::NodeId node_id,
// Convert the arguments to match the parameters.
auto converted_args_id =
ConvertCallArgs(context, node_id, callee_function.self_id, arg_ids,
return_storage_id, callable.decl_id, specific_id,
callable.implicit_param_refs_id, callable.param_refs_id);
return_storage_id, callable, specific_id);
auto call_inst_id =
context.AddInst<SemIR::Call>(node_id, {.type_id = type_id,
.callee_id = callee_id,