Refactor LazyImportRef into ImportRefUnused. (#3656)

This makes some changes to the formatter so that ImportRefUnused and
ImportRefUsed will both be labeled as "import_ref" with an "unused ->
used" argument change in textual IR, but is otherwise not changing
logic.
This commit is contained in:
Jon Ross-Perkins
2024-01-26 03:10:00 +00:00
committed by GitHub
parent 7b933a1126
commit adad286b74
24 changed files with 96 additions and 97 deletions
+2 -2
View File
@@ -104,7 +104,7 @@ static auto CopySingleNameScopeFromImportIR(
// Produce the namespace for the entry.
auto ref_id = context.AddInst(
SemIR::LazyImportRef{.ir_id = ir_id, .inst_id = import_inst_id});
SemIR::ImportRefUnused{.ir_id = ir_id, .inst_id = import_inst_id});
auto namespace_inst =
SemIR::Namespace{namespace_type_id, SemIR::NameScopeId::Invalid, ref_id};
// Use the invalid node because there's no node to associate with.
@@ -211,7 +211,7 @@ auto Import(Context& context, SemIR::TypeId namespace_type_id,
} else {
// Leave a placeholder that the inst comes from the other IR.
auto target_id = context.AddPlaceholderInst(
{SemIR::LazyImportRef{.ir_id = ir_id, .inst_id = import_inst_id}});
{SemIR::ImportRefUnused{.ir_id = ir_id, .inst_id = import_inst_id}});
// TODO: When importing from other packages, the scope's names should
// be changed to allow for ambiguous names. When importing from the
// current package, as is currently being done, we should issue a