mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 07:11:04 +01:00
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:
@@ -88,14 +88,14 @@ static auto BuildInterfaceDecl(Context& context,
|
||||
// interface name here. We should keep track of it even if the name is
|
||||
// invalid.
|
||||
SemIR::Interface interface_info = {
|
||||
.name_id = name_context.name_id_for_new_inst(),
|
||||
.parent_scope_id = name_context.parent_scope_id_for_new_inst(),
|
||||
.generic_id = generic_id,
|
||||
.first_param_node_id = name.first_param_node_id,
|
||||
.last_param_node_id = name.last_param_node_id,
|
||||
.implicit_param_refs_id = name.implicit_params_id,
|
||||
.param_refs_id = name.params_id,
|
||||
.decl_id = interface_decl_id};
|
||||
{.name_id = name_context.name_id_for_new_inst(),
|
||||
.parent_scope_id = name_context.parent_scope_id_for_new_inst(),
|
||||
.generic_id = generic_id,
|
||||
.first_param_node_id = name.first_param_node_id,
|
||||
.last_param_node_id = name.last_param_node_id,
|
||||
.implicit_param_refs_id = name.implicit_params_id,
|
||||
.param_refs_id = name.params_id,
|
||||
.decl_id = interface_decl_id}};
|
||||
interface_decl.interface_id = context.interfaces().Add(interface_info);
|
||||
if (interface_info.is_generic()) {
|
||||
interface_decl.type_id =
|
||||
|
||||
Reference in New Issue
Block a user