mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Add fields for extern to EntityWithParamsBase (#4206)
This adds fields to `EntityWithParamsBase` to reflect the intention with `extern library` design. I'm renaming `decl_id` because it shouldn't be expected to be assigned anymore. import_ref.cpp I'm deliberately keeping on `first_owning_decl_id` (which will break when importing `extern library` declarations). Most other cases are for diagnostics, and I'm using `latest_decl_id` to try and get the closest declaration to the error. Note I'm partly splitting out this PR to show the test effect, which apparently we don't test related cases.
This commit is contained in:
@@ -75,7 +75,7 @@ static auto BuildInterfaceDecl(Context& context,
|
||||
{.loc = node_id,
|
||||
.is_definition = is_definition,
|
||||
.is_extern = false},
|
||||
{.loc = existing_interface.decl_id,
|
||||
{.loc = existing_interface.latest_decl_id(),
|
||||
.is_definition = existing_interface.is_defined(),
|
||||
.is_extern = false},
|
||||
/*prev_import_ir_id=*/SemIR::ImportIRId::Invalid);
|
||||
@@ -103,8 +103,8 @@ static auto BuildInterfaceDecl(Context& context,
|
||||
// there was an error in the qualifier, we will have lost track of the
|
||||
// interface name here. We should keep track of it even if the name is
|
||||
// invalid.
|
||||
SemIR::Interface interface_info = {
|
||||
name_context.MakeEntityWithParamsBase(interface_decl_id, name)};
|
||||
SemIR::Interface interface_info = {name_context.MakeEntityWithParamsBase(
|
||||
name, interface_decl_id, /*is_extern=*/false)};
|
||||
interface_info.generic_id = FinishGenericDecl(context, interface_decl_id);
|
||||
interface_decl.interface_id = context.interfaces().Add(interface_info);
|
||||
if (interface_info.has_parameters()) {
|
||||
|
||||
Reference in New Issue
Block a user