|
|
@@ -54,10 +54,10 @@ auto AddImportIR(Context& context, SemIR::ImportIR import_ir)
|
|
|
}
|
|
|
|
|
|
auto AddImportRef(Context& context, SemIR::ImportIRInst import_ir_inst,
|
|
|
- SemIR::BindNameId bind_name_id) -> SemIR::InstId {
|
|
|
+ SemIR::EntityNameId entity_name_id) -> SemIR::InstId {
|
|
|
auto import_ir_inst_id = context.import_ir_insts().Add(import_ir_inst);
|
|
|
SemIR::ImportRefUnloaded inst = {.import_ir_inst_id = import_ir_inst_id,
|
|
|
- .bind_name_id = bind_name_id};
|
|
|
+ .entity_name_id = entity_name_id};
|
|
|
auto import_ref_id = context.AddPlaceholderInstInNoBlock(
|
|
|
SemIR::LocIdAndInst(import_ir_inst_id, inst));
|
|
|
|
|
|
@@ -114,7 +114,7 @@ auto VerifySameCanonicalImportIRInst(Context& context, SemIR::InstId prev_id,
|
|
|
}
|
|
|
auto conflict_id =
|
|
|
AddImportRef(context, {.ir_id = new_ir_id, .inst_id = new_inst_id},
|
|
|
- SemIR::BindNameId::Invalid);
|
|
|
+ SemIR::EntityNameId::Invalid);
|
|
|
context.DiagnoseDuplicateName(conflict_id, prev_id);
|
|
|
}
|
|
|
|
|
|
@@ -519,13 +519,13 @@ class ImportRefResolver {
|
|
|
if (bind_inst) {
|
|
|
switch (bind_inst->kind) {
|
|
|
case SemIR::BindName::Kind: {
|
|
|
- auto bind_name_id = context_.bind_names().Add(
|
|
|
+ auto entity_name_id = context_.entity_names().Add(
|
|
|
{.name_id = name_id,
|
|
|
.parent_scope_id = SemIR::NameScopeId::Invalid,
|
|
|
.bind_index = SemIR::CompileTimeBindIndex::Invalid});
|
|
|
new_param_id = context_.AddInstInNoBlock<SemIR::BindName>(
|
|
|
AddImportIRInst(bind_id), {.type_id = type_id,
|
|
|
- .bind_name_id = bind_name_id,
|
|
|
+ .entity_name_id = entity_name_id,
|
|
|
.value_id = new_param_id});
|
|
|
break;
|
|
|
}
|
|
|
@@ -648,7 +648,7 @@ class ImportRefResolver {
|
|
|
for (auto entry : import_scope.names) {
|
|
|
auto ref_id = AddImportRef(
|
|
|
context_, {.ir_id = import_ir_id_, .inst_id = entry.inst_id},
|
|
|
- SemIR::BindNameId::Invalid);
|
|
|
+ SemIR::EntityNameId::Invalid);
|
|
|
new_scope.AddRequired({.name_id = GetLocalNameId(entry.name_id),
|
|
|
.inst_id = ref_id,
|
|
|
.access_kind = entry.access_kind});
|
|
|
@@ -669,7 +669,7 @@ class ImportRefResolver {
|
|
|
for (auto inst_id : associated_entities) {
|
|
|
new_associated_entities.push_back(
|
|
|
AddImportRef(context_, {.ir_id = import_ir_id_, .inst_id = inst_id},
|
|
|
- SemIR::BindNameId::Invalid));
|
|
|
+ SemIR::EntityNameId::Invalid));
|
|
|
}
|
|
|
return context_.inst_blocks().Add(new_associated_entities);
|
|
|
}
|
|
|
@@ -810,7 +810,7 @@ class ImportRefResolver {
|
|
|
// Add a lazy reference to the target declaration.
|
|
|
auto decl_id = AddImportRef(
|
|
|
context_, {.ir_id = import_ir_id_, .inst_id = inst.decl_id},
|
|
|
- SemIR::BindNameId::Invalid);
|
|
|
+ SemIR::EntityNameId::Invalid);
|
|
|
|
|
|
return ResolveAs<SemIR::AssociatedEntity>(
|
|
|
{.type_id = context_.GetTypeIdForTypeConstant(type_const_id),
|
|
|
@@ -873,16 +873,16 @@ class ImportRefResolver {
|
|
|
return ResolveResult::Retry();
|
|
|
}
|
|
|
|
|
|
- const auto& import_bind_info =
|
|
|
- import_ir_.bind_names().Get(inst.bind_name_id);
|
|
|
- auto name_id = GetLocalNameId(import_bind_info.name_id);
|
|
|
- auto bind_name_id = context_.bind_names().Add(
|
|
|
+ const auto& import_entity_name =
|
|
|
+ import_ir_.entity_names().Get(inst.entity_name_id);
|
|
|
+ auto name_id = GetLocalNameId(import_entity_name.name_id);
|
|
|
+ auto entity_name_id = context_.entity_names().Add(
|
|
|
{.name_id = name_id,
|
|
|
.parent_scope_id = SemIR::NameScopeId::Invalid,
|
|
|
- .bind_index = import_bind_info.bind_index});
|
|
|
+ .bind_index = import_entity_name.bind_index});
|
|
|
return ResolveAs<SemIR::BindSymbolicName>(
|
|
|
{.type_id = context_.GetTypeIdForTypeConstant(type_id),
|
|
|
- .bind_name_id = bind_name_id,
|
|
|
+ .entity_name_id = entity_name_id,
|
|
|
.value_id = SemIR::InstId::Invalid});
|
|
|
}
|
|
|
|
|
|
@@ -1603,7 +1603,7 @@ auto LoadImportRef(Context& context, SemIR::InstId inst_id) -> void {
|
|
|
inst_id,
|
|
|
SemIR::ImportRefLoaded{.type_id = type_id,
|
|
|
.import_ir_inst_id = inst->import_ir_inst_id,
|
|
|
- .bind_name_id = inst->bind_name_id});
|
|
|
+ .entity_name_id = inst->entity_name_id});
|
|
|
|
|
|
// Store the constant for both the ImportRefLoaded and indirect instructions.
|
|
|
context.constant_values().Set(inst_id, constant_id);
|
|
|
@@ -1633,7 +1633,7 @@ static auto ImportImpl(Context& context, SemIR::ImportIRId import_ir_id,
|
|
|
auto& impl = context.impls().Get(impl_id);
|
|
|
impl.witness_id = AddImportRef(
|
|
|
context, {.ir_id = import_ir_id, .inst_id = import_impl.witness_id},
|
|
|
- SemIR::BindNameId::Invalid);
|
|
|
+ SemIR::EntityNameId::Invalid);
|
|
|
}
|
|
|
}
|
|
|
|