From 92fa0ac1accb53a7eaab28e3fc8f14bcc881ebd2 Mon Sep 17 00:00:00 2001 From: Jon Ross-Perkins Date: Fri, 3 May 2024 16:33:42 -0700 Subject: [PATCH] Remove ImportRefUsed (#3934) This was to track use of a declaration after import, prior to a redeclaration. Per [discussion on Discord](https://discord.com/channels/655572317891461132/1217182321933815820/1236016521059237962), we likely don't need this check due to the change in behavior of `extern`. Rather than potentially getting one of many `extern` decls and depending on it by accident, it is now planned to be _required_ to be imported, and the library doing a non-`extern` decl must _know_ it's importing the `extern` decl. The stricter requirement on the library means it now seems more reasonable to use the `extern` decl. So kind of rolling back #3831, though keeping `ImportIRInstId` (at least for now) and keeping `Loaded`/`Unloaded` terminology (seems a nicer fit). --- toolchain/check/context.cpp | 33 ++++---- toolchain/check/context.h | 6 +- toolchain/check/decl_name_stack.cpp | 3 +- toolchain/check/eval.cpp | 1 - toolchain/check/handle_class.cpp | 3 +- toolchain/check/handle_function.cpp | 2 +- toolchain/check/impl.cpp | 6 +- toolchain/check/import_ref.cpp | 77 ++++++------------- toolchain/check/import_ref.h | 7 +- toolchain/check/member_access.cpp | 8 +- toolchain/check/merge.cpp | 33 ++------ toolchain/check/merge.h | 4 +- .../testdata/alias/no_prelude/import.carbon | 10 +-- .../alias/no_prelude/import_order.carbon | 10 +-- .../testdata/builtins/bool/make_type.carbon | 2 +- .../testdata/builtins/float/make_type.carbon | 4 +- .../testdata/builtins/int/make_type_32.carbon | 2 +- .../builtins/int/make_type_signed.carbon | 8 +- .../builtins/int/make_type_unsigned.carbon | 8 +- .../class/cross_package_import.carbon | 8 +- .../testdata/class/fail_import_misuses.carbon | 2 +- toolchain/check/testdata/class/import.carbon | 14 ++-- .../check/testdata/class/import_base.carbon | 6 +- .../testdata/class/import_indirect.carbon | 20 ++--- .../testdata/class/import_member_cycle.carbon | 2 +- .../testdata/class/import_struct_cyle.carbon | 4 +- toolchain/check/testdata/const/import.carbon | 4 +- .../builtin/call_from_operator.carbon | 10 +-- .../testdata/function/builtin/import.carbon | 2 +- .../function/declaration/import.carbon | 75 +++++++----------- .../fail_import_incomplete_return.carbon | 8 +- .../function/definition/import.carbon | 6 +- .../check/testdata/impl/lookup/import.carbon | 8 +- .../impl/lookup/no_prelude/import.carbon | 8 +- .../impl/no_prelude/import_self.carbon | 6 +- .../interface/no_prelude/import.carbon | 16 ++-- .../testdata/let/fail_generic_import.carbon | 2 +- .../check/testdata/let/generic_import.carbon | 2 +- toolchain/check/testdata/let/import.carbon | 2 +- .../check/testdata/namespace/imported.carbon | 4 +- .../namespace/imported_indirect.carbon | 2 +- .../check/testdata/namespace/merging.carbon | 6 +- .../testdata/operators/overloaded/add.carbon | 16 ++-- .../operators/overloaded/bit_and.carbon | 16 ++-- .../overloaded/bit_complement.carbon | 8 +- .../operators/overloaded/bit_or.carbon | 16 ++-- .../operators/overloaded/bit_xor.carbon | 16 ++-- .../testdata/operators/overloaded/dec.carbon | 8 +- .../testdata/operators/overloaded/div.carbon | 16 ++-- .../testdata/operators/overloaded/eq.carbon | 36 ++++----- .../overloaded/fail_assign_non_ref.carbon | 16 ++-- .../operators/overloaded/fail_no_impl.carbon | 16 ++-- .../overloaded/fail_no_impl_for_arg.carbon | 16 ++-- .../testdata/operators/overloaded/inc.carbon | 8 +- .../operators/overloaded/left_shift.carbon | 16 ++-- .../testdata/operators/overloaded/mod.carbon | 16 ++-- .../testdata/operators/overloaded/mul.carbon | 16 ++-- .../operators/overloaded/negate.carbon | 8 +- .../operators/overloaded/ordered.carbon | 42 +++++----- .../operators/overloaded/right_shift.carbon | 16 ++-- .../testdata/operators/overloaded/sub.carbon | 16 ++-- .../packages/cross_package_import.carbon | 8 +- .../packages/fail_import_type_error.carbon | 8 +- .../testdata/packages/loaded_global.carbon | 4 +- .../check/testdata/pointer/import.carbon | 2 +- toolchain/check/testdata/struct/import.carbon | 4 +- toolchain/check/testdata/tuples/import.carbon | 4 +- .../testdata/var/no_prelude/import.carbon | 2 +- toolchain/diagnostics/diagnostic_kind.def | 2 - toolchain/lower/handle.cpp | 6 -- toolchain/sem_ir/file.cpp | 7 +- toolchain/sem_ir/formatter.cpp | 4 - toolchain/sem_ir/ids.h | 2 +- toolchain/sem_ir/inst_kind.def | 1 - toolchain/sem_ir/inst_namer.cpp | 3 +- toolchain/sem_ir/typed_insts.h | 17 +--- 76 files changed, 361 insertions(+), 475 deletions(-) diff --git a/toolchain/check/context.cpp b/toolchain/check/context.cpp index e5dd1c22111b..8ce09e7c8f98 100644 --- a/toolchain/check/context.cpp +++ b/toolchain/check/context.cpp @@ -211,8 +211,7 @@ auto Context::AddNameToLookup(SemIR::NameId name_id, SemIR::InstId target_id) } auto Context::LookupNameInDecl(SemIR::LocId loc_id, SemIR::NameId name_id, - SemIR::NameScopeId scope_id, - bool mark_imports_used) -> SemIR::InstId { + SemIR::NameScopeId scope_id) -> SemIR::InstId { if (!scope_id.is_valid()) { // Look for a name in the current scope only. There are two cases where the // name would be in an outer scope: @@ -248,8 +247,7 @@ auto Context::LookupNameInDecl(SemIR::LocId loc_id, SemIR::NameId name_id, // // // Error, no `F` in `B`. // fn B.F() {} - return LookupNameInExactScope(loc_id, name_id, name_scopes().Get(scope_id), - mark_imports_used); + return LookupNameInExactScope(loc_id, name_id, name_scopes().Get(scope_id)); } } @@ -284,8 +282,8 @@ auto Context::LookupUnqualifiedName(Parse::NodeId node_id, // Handles lookup through the import_ir_scopes for LookupNameInExactScope. static auto LookupInImportIRScopes(Context& context, SemIRLoc loc, SemIR::NameId name_id, - const SemIR::NameScope& scope, - bool mark_imports_used) -> SemIR::InstId { + const SemIR::NameScope& scope) + -> SemIR::InstId { auto identifier_id = name_id.AsIdentifierId(); llvm::StringRef identifier; if (identifier_id.is_valid()) { @@ -328,8 +326,7 @@ static auto LookupInImportIRScopes(Context& context, SemIRLoc loc, if (result_id.is_valid()) { context.DiagnoseDuplicateName(import_inst_id, result_id); } else { - LoadImportRef(context, import_inst_id, - mark_imports_used ? loc : SemIR::LocId::Invalid); + LoadImportRef(context, import_inst_id); result_id = import_inst_id; } } @@ -338,16 +335,14 @@ static auto LookupInImportIRScopes(Context& context, SemIRLoc loc, } auto Context::LookupNameInExactScope(SemIRLoc loc, SemIR::NameId name_id, - const SemIR::NameScope& scope, - bool mark_imports_used) -> SemIR::InstId { + const SemIR::NameScope& scope) + -> SemIR::InstId { if (auto it = scope.names.find(name_id); it != scope.names.end()) { - LoadImportRef(*this, it->second, - mark_imports_used ? loc : SemIR::LocId::Invalid); + LoadImportRef(*this, it->second); return it->second; } if (!scope.import_ir_scopes.empty()) { - return LookupInImportIRScopes(*this, loc, name_id, scope, - mark_imports_used); + return LookupInImportIRScopes(*this, loc, name_id, scope); } return SemIR::InstId::Invalid; } @@ -364,8 +359,7 @@ auto Context::LookupQualifiedName(Parse::NodeId node_id, SemIR::NameId name_id, const auto& scope = name_scopes().Get(scope_ids.pop_back_val()); has_error |= scope.has_error; - auto scope_result_id = LookupNameInExactScope(node_id, name_id, scope, - /*mark_imports_used=*/true); + auto scope_result_id = LookupNameInExactScope(node_id, name_id, scope); if (!scope_result_id.is_valid()) { // Nothing found in this scope: also look in its extended scopes. auto extended = llvm::reverse(scope.extended_scopes); @@ -415,8 +409,8 @@ static auto GetCorePackage(Context& context, SemIRLoc loc) // Look up `package.Core`. auto core_inst_id = context.LookupNameInExactScope( - loc, core_name_id, context.name_scopes().Get(SemIR::NameScopeId::Package), - /*mark_imports_used=*/true); + loc, core_name_id, + context.name_scopes().Get(SemIR::NameScopeId::Package)); if (!core_inst_id.is_valid()) { context.DiagnoseNameNotFound(loc, core_name_id); return SemIR::NameScopeId::Invalid; @@ -441,8 +435,7 @@ auto Context::LookupNameInCore(SemIRLoc loc, llvm::StringRef name) auto name_id = SemIR::NameId::ForIdentifier(identifiers().Add(name)); auto inst_id = - LookupNameInExactScope(loc, name_id, name_scopes().Get(core_package_id), - /*mark_imports_used=*/true); + LookupNameInExactScope(loc, name_id, name_scopes().Get(core_package_id)); if (!inst_id.is_valid()) { DiagnoseNameNotFound(loc, name_id); return SemIR::InstId::BuiltinError; diff --git a/toolchain/check/context.h b/toolchain/check/context.h index f566037500db..a48b3b0c9ecc 100644 --- a/toolchain/check/context.h +++ b/toolchain/check/context.h @@ -99,8 +99,7 @@ class Context { // declaration, returning the referenced instruction. If scope_id is invalid, // uses the current contextual scope. auto LookupNameInDecl(SemIR::LocId loc_id, SemIR::NameId name_id, - SemIR::NameScopeId scope_id, bool mark_imports_used) - -> SemIR::InstId; + SemIR::NameScopeId scope_id) -> SemIR::InstId; // Performs an unqualified name lookup, returning the referenced instruction. auto LookupUnqualifiedName(Parse::NodeId node_id, SemIR::NameId name_id) @@ -110,8 +109,7 @@ class Context { // instruction. Does not look into extended scopes. Returns an invalid // instruction if the name is not found. auto LookupNameInExactScope(SemIRLoc loc, SemIR::NameId name_id, - const SemIR::NameScope& scope, - bool mark_imports_used) -> SemIR::InstId; + const SemIR::NameScope& scope) -> SemIR::InstId; // Performs a qualified name lookup in a specified scope and in scopes that // it extends, returning the referenced instruction. diff --git a/toolchain/check/decl_name_stack.cpp b/toolchain/check/decl_name_stack.cpp index 483164a8d554..bce77f4a07fe 100644 --- a/toolchain/check/decl_name_stack.cpp +++ b/toolchain/check/decl_name_stack.cpp @@ -195,8 +195,7 @@ auto DeclNameStack::ApplyNameQualifierTo(NameContext& name_context, if (TryResolveQualifier(name_context, loc_id)) { // For identifier nodes, we need to perform a lookup on the identifier. auto resolved_inst_id = context_->LookupNameInDecl( - name_context.loc_id, name_id, name_context.target_scope_id, - /*mark_imports_used=*/false); + name_context.loc_id, name_id, name_context.target_scope_id); if (!resolved_inst_id.is_valid()) { // Invalid indicates an unresolved name. Store it and return. name_context.state = NameContext::State::Unresolved; diff --git a/toolchain/check/eval.cpp b/toolchain/check/eval.cpp index 2ce566b0cf9b..694c0b672686 100644 --- a/toolchain/check/eval.cpp +++ b/toolchain/check/eval.cpp @@ -1036,7 +1036,6 @@ auto TryEvalInst(Context& context, SemIR::InstId inst_id, SemIR::Inst inst) case SemIR::BindValue::Kind: case SemIR::Deref::Kind: case SemIR::ImportRefLoaded::Kind: - case SemIR::ImportRefUsed::Kind: case SemIR::Temporary::Kind: case SemIR::TemporaryStorage::Kind: case SemIR::ValueAsRef::Kind: diff --git a/toolchain/check/handle_class.cpp b/toolchain/check/handle_class.cpp index 2d655ffd382d..d03a2faf5d2e 100644 --- a/toolchain/check/handle_class.cpp +++ b/toolchain/check/handle_class.cpp @@ -49,8 +49,7 @@ static auto MergeOrAddName(Context& context, Parse::AnyClassDeclId node_id, auto prev_id = context.decl_name_stack().LookupOrAddName(name_context, class_decl_id); if (prev_id.is_valid()) { - auto prev_inst_for_merge = - ResolvePrevInstForMerge(context, node_id, prev_id); + auto prev_inst_for_merge = ResolvePrevInstForMerge(context, prev_id); auto prev_class_id = SemIR::ClassId::Invalid; CARBON_KIND_SWITCH(prev_inst_for_merge.inst) { diff --git a/toolchain/check/handle_function.cpp b/toolchain/check/handle_function.cpp index b0d694076861..0ada1dc88055 100644 --- a/toolchain/check/handle_function.cpp +++ b/toolchain/check/handle_function.cpp @@ -93,7 +93,7 @@ static auto TryMergeRedecl(Context& context, Parse::AnyFunctionDeclId node_id, return; } - auto prev_inst_for_merge = ResolvePrevInstForMerge(context, node_id, prev_id); + auto prev_inst_for_merge = ResolvePrevInstForMerge(context, prev_id); auto prev_function_id = GetRedeclFunctionId(context, prev_inst_for_merge.inst); if (!prev_function_id.is_valid()) { diff --git a/toolchain/check/impl.cpp b/toolchain/check/impl.cpp index 60da6cecb4a2..e35f12e9ad39 100644 --- a/toolchain/check/impl.cpp +++ b/toolchain/check/impl.cpp @@ -90,7 +90,7 @@ static auto BuildInterfaceWitness( .replacement_id = context.types().GetConstantId(impl.self_id)}}; for (auto decl_id : assoc_entities) { - LoadImportRef(context, decl_id, impl.definition_id); + LoadImportRef(context, decl_id); auto const_id = context.constant_values().Get(decl_id); CARBON_CHECK(const_id.is_constant()) << "Non-constant associated entity"; auto decl = context.insts().Get(const_id.inst_id()); @@ -105,8 +105,8 @@ static auto BuildInterfaceWitness( CARBON_FATAL() << "Unexpected type: " << type_inst; } auto& fn = context.functions().Get(fn_type->function_id); - auto impl_decl_id = context.LookupNameInExactScope( - decl_id, fn.name_id, impl_scope, /*mark_imports_used=*/true); + auto impl_decl_id = + context.LookupNameInExactScope(decl_id, fn.name_id, impl_scope); if (impl_decl_id.is_valid()) { used_decl_ids.push_back(impl_decl_id); table.push_back(CheckAssociatedFunctionImplementation( diff --git a/toolchain/check/import_ref.cpp b/toolchain/check/import_ref.cpp index 3768fb999a72..5605ac272763 100644 --- a/toolchain/check/import_ref.cpp +++ b/toolchain/check/import_ref.cpp @@ -552,7 +552,7 @@ class ImportRefResolver { case CARBON_KIND(SemIR::FunctionType inst): { return TryResolveTypedInst(inst); } - case CARBON_KIND(SemIR::ImportRefUsed inst): { + case CARBON_KIND(SemIR::ImportRefLoaded inst): { return TryResolveTypedInst(inst, inst_id); } case CARBON_KIND(SemIR::InterfaceDecl inst): { @@ -900,8 +900,8 @@ class ImportRefResolver { return {context_.types().GetConstantId(fn_val.type_id())}; } - auto TryResolveTypedInst(SemIR::ImportRefUsed /*inst*/, SemIR::InstId inst_id) - -> ResolveResult { + auto TryResolveTypedInst(SemIR::ImportRefLoaded /*inst*/, + SemIR::InstId inst_id) -> ResolveResult { auto initial_work = work_stack_.size(); // Return the constant for the instruction of the imported constant. auto constant_id = import_ir_.constant_values().Get(inst_id); @@ -909,7 +909,8 @@ class ImportRefResolver { return {SemIR::ConstantId::Error}; } if (!constant_id.is_constant()) { - context_.TODO(inst_id, "Non-constant ImportRefUsed (comes up with var)"); + context_.TODO(inst_id, + "Non-constant ImportRefLoaded (comes up with var)"); return {SemIR::ConstantId::Error}; } @@ -1139,61 +1140,29 @@ class ImportRefResolver { llvm::SmallVector work_stack_; }; -// Returns the LocId corresponding to the input location. -static auto SemIRLocToLocId(Context& context, SemIRLoc loc) -> SemIR::LocId { - if (loc.is_inst_id) { - return context.insts().GetLocId(loc.inst_id); - } else { - return loc.loc_id; +auto LoadImportRef(Context& context, SemIR::InstId inst_id) -> void { + auto inst = context.insts().TryGetAs(inst_id); + if (!inst) { + return; } -} + auto import_ir_inst = context.import_ir_insts().Get(inst->import_ir_inst_id); -// Replace the ImportRefUnloaded instruction with an appropriate ImportRef. This -// doesn't use ReplaceInstBeforeConstantUse because it would trigger -// TryEvalInst, which we want to avoid with ImportRefs. -static auto SetInst(Context& context, SemIR::InstId inst_id, - SemIR::TypeId type_id, - SemIR::ImportIRInstId import_ir_inst_id, SemIRLoc loc, - bool set_if_invalid_loc) -> void { - if (auto loc_id = SemIRLocToLocId(context, loc); loc_id.is_valid()) { - context.sem_ir().insts().Set( - inst_id, SemIR::ImportRefUsed{type_id, import_ir_inst_id, loc_id}); - } else if (set_if_invalid_loc) { - context.sem_ir().insts().Set( - inst_id, SemIR::ImportRefLoaded{type_id, import_ir_inst_id}); - } -} + const SemIR::File& import_ir = + *context.import_irs().Get(import_ir_inst.ir_id).sem_ir; + auto import_inst = import_ir.insts().Get(import_ir_inst.inst_id); -auto LoadImportRef(Context& context, SemIR::InstId inst_id, SemIRLoc loc) - -> void { - CARBON_KIND_SWITCH(context.insts().Get(inst_id)) { - case CARBON_KIND(SemIR::ImportRefLoaded inst): { - SetInst(context, inst_id, inst.type_id, inst.import_ir_inst_id, loc, - /*set_if_invalid_loc=*/false); - return; - } - case CARBON_KIND(SemIR::ImportRefUnloaded inst): { - auto import_ir_inst = - context.import_ir_insts().Get(inst.import_ir_inst_id); + ImportRefResolver resolver(context, import_ir_inst.ir_id); + auto type_id = resolver.ResolveType(import_inst.type_id()); + auto constant_id = resolver.Resolve(import_ir_inst.inst_id); - const SemIR::File& import_ir = - *context.import_irs().Get(import_ir_inst.ir_id).sem_ir; - auto import_inst = import_ir.insts().Get(import_ir_inst.inst_id); + // Replace the ImportRefUnloaded instruction with ImportRefLoaded. This + // doesn't use ReplaceInstBeforeConstantUse because it would trigger + // TryEvalInst, which we want to avoid with ImportRefs. + context.sem_ir().insts().Set( + inst_id, SemIR::ImportRefLoaded{type_id, inst->import_ir_inst_id}); - ImportRefResolver resolver(context, import_ir_inst.ir_id); - auto type_id = resolver.ResolveType(import_inst.type_id()); - auto constant_id = resolver.Resolve(import_ir_inst.inst_id); - - SetInst(context, inst_id, type_id, inst.import_ir_inst_id, loc, - /*set_if_invalid_loc=*/true); - - // Store the constant for both the ImportRefUsed and imported instruction. - context.constant_values().Set(inst_id, constant_id); - return; - } - default: - return; - } + // Store the constant for both the ImportRefLoaded and imported instruction. + context.constant_values().Set(inst_id, constant_id); } // Imports the impl `import_impl_id` from the imported IR `import_ir`. diff --git a/toolchain/check/import_ref.h b/toolchain/check/import_ref.h index 82cda7c0e83c..c138f34a4e0b 100644 --- a/toolchain/check/import_ref.h +++ b/toolchain/check/import_ref.h @@ -24,10 +24,9 @@ auto AddImportIR(Context& context, SemIR::ImportIR import_ir) auto AddImportRef(Context& context, SemIR::ImportIRInst import_ir_inst) -> SemIR::InstId; -// If the passed in instruction ID is an ImportRefUnloaded, loads it for use. -// The result will be an ImportRefUsed. -auto LoadImportRef(Context& context, SemIR::InstId inst_id, SemIRLoc loc) - -> void; +// If the passed in instruction ID is an ImportRefUnloaded, turns it into an +// ImportRefLoaded for use. +auto LoadImportRef(Context& context, SemIR::InstId inst_id) -> void; // Load all impls declared in IRs imported into this context. auto ImportImpls(Context& context) -> void; diff --git a/toolchain/check/member_access.cpp b/toolchain/check/member_access.cpp index 93871625f05b..d73369aac779 100644 --- a/toolchain/check/member_access.cpp +++ b/toolchain/check/member_access.cpp @@ -122,7 +122,7 @@ static auto ScopeNeedsImplLookup(Context& context, // Given a type and an interface, searches for an impl that describes how that // type implements that interface, and returns the corresponding witness. // Returns an invalid InstId if no matching impl is found. -static auto LookupInterfaceWitness(Context& context, SemIRLoc loc, +static auto LookupInterfaceWitness(Context& context, SemIR::ConstantId type_const_id, SemIR::InterfaceId interface_id) -> SemIR::InstId { @@ -147,7 +147,7 @@ static auto LookupInterfaceWitness(Context& context, SemIRLoc loc, // TODO: Diagnose if the impl isn't defined yet? return SemIR::InstId::Invalid; } - LoadImportRef(context, impl.witness_id, loc); + LoadImportRef(context, impl.witness_id); return impl.witness_id; } return SemIR::InstId::Invalid; @@ -160,8 +160,8 @@ static auto PerformImplLookup(Context& context, Parse::NodeId node_id, SemIR::AssociatedEntityType assoc_type, SemIR::InstId member_id) -> SemIR::InstId { auto& interface = context.interfaces().Get(assoc_type.interface_id); - auto witness_id = LookupInterfaceWitness(context, node_id, type_const_id, - assoc_type.interface_id); + auto witness_id = + LookupInterfaceWitness(context, type_const_id, assoc_type.interface_id); if (!witness_id.is_valid()) { CARBON_DIAGNOSTIC(MissingImplInMemberAccess, Error, "Cannot access member of interface {0} in type {1} " diff --git a/toolchain/check/merge.cpp b/toolchain/check/merge.cpp index 4da5e1884291..282148c2a698 100644 --- a/toolchain/check/merge.cpp +++ b/toolchain/check/merge.cpp @@ -125,35 +125,16 @@ auto CheckIsAllowedRedecl(Context& context, Lex::TokenKind decl_kind, } } -auto ResolvePrevInstForMerge(Context& context, Parse::NodeId node_id, - SemIR::InstId prev_inst_id) -> InstForMerge { +auto ResolvePrevInstForMerge(Context& context, SemIR::InstId prev_inst_id) + -> InstForMerge { InstForMerge result = {.inst = context.insts().Get(prev_inst_id), .import_ir_inst_id = SemIR::ImportIRInstId::Invalid}; - - CARBON_KIND_SWITCH(result.inst) { - case CARBON_KIND(SemIR::ImportRefUsed import_ref): { - CARBON_DIAGNOSTIC( - RedeclOfUsedImport, Error, - "Redeclaration of imported entity that was previously used."); - CARBON_DIAGNOSTIC(UsedImportLoc, Note, "Import used here."); - context.emitter() - .Build(node_id, RedeclOfUsedImport) - .Note(import_ref.used_id, UsedImportLoc) - .Emit(); - [[fallthrough]]; - } - case SemIR::ImportRefLoaded::Kind: { - // Follow the import ref. - auto import_ref = result.inst.As(); - result.import_ir_inst_id = import_ref.import_ir_inst_id; - result.inst = context.insts().Get( - context.constant_values().Get(prev_inst_id).inst_id()); - break; - } - default: - break; + if (auto import_ref = result.inst.TryAs()) { + // Follow the import ref. + result.import_ir_inst_id = import_ref->import_ir_inst_id; + result.inst = context.insts().Get( + context.constant_values().Get(prev_inst_id).inst_id()); } - return result; } diff --git a/toolchain/check/merge.h b/toolchain/check/merge.h index b11aeecd2704..a460d9468441 100644 --- a/toolchain/check/merge.h +++ b/toolchain/check/merge.h @@ -46,8 +46,8 @@ struct InstForMerge { // to return the instruction relevant for a merge. If an import is found and was // previously used, it notes it, although an invalid redeclaration may diagnose // for other reasons too. -auto ResolvePrevInstForMerge(Context& context, Parse::NodeId node_id, - SemIR::InstId prev_inst_id) -> InstForMerge; +auto ResolvePrevInstForMerge(Context& context, SemIR::InstId prev_inst_id) + -> InstForMerge; // When the prior name lookup result is an import and we are successfully // merging, replace the name lookup result with the reference in the current diff --git a/toolchain/check/testdata/alias/no_prelude/import.carbon b/toolchain/check/testdata/alias/no_prelude/import.carbon index 79ff54a80634..3d7b0340d5da 100644 --- a/toolchain/check/testdata/alias/no_prelude/import.carbon +++ b/toolchain/check/testdata/alias/no_prelude/import.carbon @@ -57,7 +57,7 @@ library "var3" api; // CHECK:STDERR: fail_var3.carbon:[[@LINE+6]]:1: In import. // CHECK:STDERR: import library "var2"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: var2.carbon:8:5: ERROR: Semantics TODO: `Non-constant ImportRefUsed (comes up with var)`. +// CHECK:STDERR: var2.carbon:8:5: ERROR: Semantics TODO: `Non-constant ImportRefLoaded (comes up with var)`. // CHECK:STDERR: var b: () = a_alias; // CHECK:STDERR: ^ import library "var2"; @@ -109,7 +109,7 @@ var c: () = a_alias_alias; // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+1, unloaded -// CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+5, loc_12 [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+5, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+10, unloaded // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+2, unloaded @@ -140,7 +140,7 @@ var c: () = a_alias_alias; // CHECK:STDOUT: .b = %import_ref.2 // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+9, loc_11 [template = constants.%C] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+9, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+14, unloaded // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+7, unloaded @@ -199,7 +199,7 @@ var c: () = a_alias_alias; // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+5, unloaded -// CHECK:STDOUT: %import_ref.2: ref () = import_ref ir1, inst+12, loc_12 +// CHECK:STDOUT: %import_ref.2: ref () = import_ref ir1, inst+12, loaded // CHECK:STDOUT: %a_alias.ref: ref () = name_ref a_alias, %import_ref.2 // CHECK:STDOUT: %a_alias_alias: ref () = bind_alias a_alias_alias, %import_ref.2 // CHECK:STDOUT: %.loc8_9.1: () = tuple_literal () @@ -230,7 +230,7 @@ var c: () = a_alias_alias; // CHECK:STDOUT: .b = %import_ref.2 // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: ref () = import_ref ir1, inst+5, loc_15 [template = ] +// CHECK:STDOUT: %import_ref.1: ref () = import_ref ir1, inst+5, loaded [template = ] // CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+9, unloaded // CHECK:STDOUT: %.loc12_9.1: () = tuple_literal () // CHECK:STDOUT: %.loc12_9.2: type = converted %.loc12_9.1, constants.%.1 [template = constants.%.1] diff --git a/toolchain/check/testdata/alias/no_prelude/import_order.carbon b/toolchain/check/testdata/alias/no_prelude/import_order.carbon index 19c892d83d40..4ee24c741c00 100644 --- a/toolchain/check/testdata/alias/no_prelude/import_order.carbon +++ b/toolchain/check/testdata/alias/no_prelude/import_order.carbon @@ -89,12 +89,12 @@ var a_val: a = {.v = b_val.v}; // CHECK:STDOUT: .a_val = %a_val // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+1, unloaded -// CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+12, loc_52 [template = constants.%C] -// CHECK:STDOUT: %import_ref.3: type = import_ref ir1, inst+14, loc_38 [template = constants.%C] -// CHECK:STDOUT: %import_ref.4: type = import_ref ir1, inst+16, loc_24 [template = constants.%C] -// CHECK:STDOUT: %import_ref.5: type = import_ref ir1, inst+18, loc_11 [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+12, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.3: type = import_ref ir1, inst+14, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.4: type = import_ref ir1, inst+16, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir1, inst+18, loaded [template = constants.%C] // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.6: = import_ref ir1, inst+7, loc_32 [template = imports.%.1] +// CHECK:STDOUT: %import_ref.6: = import_ref ir1, inst+7, loaded [template = imports.%.1] // CHECK:STDOUT: %import_ref.7 = import_ref ir1, inst+2, unloaded // CHECK:STDOUT: %d.ref: type = name_ref d, %import_ref.5 [template = constants.%C] // CHECK:STDOUT: %d_val.var: ref C = var d_val diff --git a/toolchain/check/testdata/builtins/bool/make_type.carbon b/toolchain/check/testdata/builtins/bool/make_type.carbon index bb81538ab524..0dc7fb8330dd 100644 --- a/toolchain/check/testdata/builtins/bool/make_type.carbon +++ b/toolchain/check/testdata/builtins/bool/make_type.carbon @@ -54,7 +54,7 @@ var b: Bool() = false; // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: Bool = import_ref ir1, inst+3, loc_11 [template = constants.%struct] +// CHECK:STDOUT: %import_ref: Bool = import_ref ir1, inst+3, loaded [template = constants.%struct] // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Bool.ref: Bool = name_ref Bool, %import_ref [template = constants.%struct] // CHECK:STDOUT: %bool.make_type: init type = call %Bool.ref() [template = bool] diff --git a/toolchain/check/testdata/builtins/float/make_type.carbon b/toolchain/check/testdata/builtins/float/make_type.carbon index 39137679c465..5222f580dbde 100644 --- a/toolchain/check/testdata/builtins/float/make_type.carbon +++ b/toolchain/check/testdata/builtins/float/make_type.carbon @@ -82,7 +82,7 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: .f = %f // CHECK:STDOUT: .GetFloat = %GetFloat.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: Float = import_ref ir1, inst+5, loc_11 [template = constants.%struct.1] +// CHECK:STDOUT: %import_ref: Float = import_ref ir1, inst+5, loaded [template = constants.%struct.1] // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Float.ref: Float = name_ref Float, %import_ref [template = constants.%struct.1] // CHECK:STDOUT: %.loc6_14: i32 = int_literal 64 [template = constants.%.2] @@ -135,7 +135,7 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: .dyn_size = %dyn_size // CHECK:STDOUT: .dyn = %dyn // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: Float = import_ref ir1, inst+5, loc_11 [template = constants.%struct] +// CHECK:STDOUT: %import_ref: Float = import_ref ir1, inst+5, loaded [template = constants.%struct] // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Float.ref.loc10: Float = name_ref Float, %import_ref [template = constants.%struct] // CHECK:STDOUT: %.loc10_26: i32 = int_literal 32 [template = constants.%.2] diff --git a/toolchain/check/testdata/builtins/int/make_type_32.carbon b/toolchain/check/testdata/builtins/int/make_type_32.carbon index 4d98a2376229..6b45bb5e427d 100644 --- a/toolchain/check/testdata/builtins/int/make_type_32.carbon +++ b/toolchain/check/testdata/builtins/int/make_type_32.carbon @@ -54,7 +54,7 @@ var i: Int() = 0; // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .i = %i // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: Int = import_ref ir1, inst+3, loc_11 [template = constants.%struct] +// CHECK:STDOUT: %import_ref: Int = import_ref ir1, inst+3, loaded [template = constants.%struct] // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Int.ref: Int = name_ref Int, %import_ref [template = constants.%struct] // CHECK:STDOUT: %int.make_type_32: init type = call %Int.ref() [template = i32] diff --git a/toolchain/check/testdata/builtins/int/make_type_signed.carbon b/toolchain/check/testdata/builtins/int/make_type_signed.carbon index db0e077c1264..8b162496f932 100644 --- a/toolchain/check/testdata/builtins/int/make_type_signed.carbon +++ b/toolchain/check/testdata/builtins/int/make_type_signed.carbon @@ -116,7 +116,7 @@ var m: Int(1000000000); // CHECK:STDOUT: .G = %G.decl // CHECK:STDOUT: .Symbolic = %Symbolic.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: Int = import_ref ir1, inst+5, loc_13 [template = constants.%struct.1] +// CHECK:STDOUT: %import_ref: Int = import_ref ir1, inst+5, loaded [template = constants.%struct.1] // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F.decl: F = fn_decl @F [template = constants.%struct.2] { // CHECK:STDOUT: %Int.ref.loc6_9: Int = name_ref Int, %import_ref [template = constants.%struct.1] @@ -202,7 +202,7 @@ var m: Int(1000000000); // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .n = %n // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: Int = import_ref ir1, inst+5, loc_11 [template = constants.%struct] +// CHECK:STDOUT: %import_ref: Int = import_ref ir1, inst+5, loaded [template = constants.%struct] // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Int.ref: Int = name_ref Int, %import_ref [template = constants.%struct] // CHECK:STDOUT: %.loc10_12: i32 = int_literal 0 [template = constants.%.2] @@ -234,7 +234,7 @@ var m: Int(1000000000); // CHECK:STDOUT: .Negate = %Negate.decl // CHECK:STDOUT: .n = %n.loc12 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: Int = import_ref ir1, inst+5, loc_23 [template = constants.%struct.2] +// CHECK:STDOUT: %import_ref: Int = import_ref ir1, inst+5, loaded [template = constants.%struct.2] // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Negate.decl: Negate = fn_decl @Negate [template = constants.%struct.1] { // CHECK:STDOUT: %n.loc6_11.1: i32 = param n @@ -273,7 +273,7 @@ var m: Int(1000000000); // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .m = %m // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: Int = import_ref ir1, inst+5, loc_11 [template = constants.%struct] +// CHECK:STDOUT: %import_ref: Int = import_ref ir1, inst+5, loaded [template = constants.%struct] // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Int.ref: Int = name_ref Int, %import_ref [template = constants.%struct] // CHECK:STDOUT: %.loc9_12: i32 = int_literal 1000000000 [template = constants.%.2] diff --git a/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon b/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon index fad3f7a8d2b1..3aaa48a35bbe 100644 --- a/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon +++ b/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon @@ -116,7 +116,7 @@ var m: UInt(1000000000); // CHECK:STDOUT: .G = %G.decl // CHECK:STDOUT: .Symbolic = %Symbolic.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: UInt = import_ref ir1, inst+5, loc_13 [template = constants.%struct.1] +// CHECK:STDOUT: %import_ref: UInt = import_ref ir1, inst+5, loaded [template = constants.%struct.1] // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F.decl: F = fn_decl @F [template = constants.%struct.2] { // CHECK:STDOUT: %UInt.ref.loc6_9: UInt = name_ref UInt, %import_ref [template = constants.%struct.1] @@ -202,7 +202,7 @@ var m: UInt(1000000000); // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .n = %n // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: UInt = import_ref ir1, inst+5, loc_11 [template = constants.%struct] +// CHECK:STDOUT: %import_ref: UInt = import_ref ir1, inst+5, loaded [template = constants.%struct] // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %UInt.ref: UInt = name_ref UInt, %import_ref [template = constants.%struct] // CHECK:STDOUT: %.loc10_13: i32 = int_literal 0 [template = constants.%.2] @@ -234,7 +234,7 @@ var m: UInt(1000000000); // CHECK:STDOUT: .Negate = %Negate.decl // CHECK:STDOUT: .n = %n.loc12 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: UInt = import_ref ir1, inst+5, loc_23 [template = constants.%struct.2] +// CHECK:STDOUT: %import_ref: UInt = import_ref ir1, inst+5, loaded [template = constants.%struct.2] // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Negate.decl: Negate = fn_decl @Negate [template = constants.%struct.1] { // CHECK:STDOUT: %n.loc6_11.1: i32 = param n @@ -273,7 +273,7 @@ var m: UInt(1000000000); // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .m = %m // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: UInt = import_ref ir1, inst+5, loc_11 [template = constants.%struct] +// CHECK:STDOUT: %import_ref: UInt = import_ref ir1, inst+5, loaded [template = constants.%struct] // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %UInt.ref: UInt = name_ref UInt, %import_ref [template = constants.%struct] // CHECK:STDOUT: %.loc9_13: i32 = int_literal 1000000000 [template = constants.%.2] diff --git a/toolchain/check/testdata/class/cross_package_import.carbon b/toolchain/check/testdata/class/cross_package_import.carbon index dcf27635e247..059286ffaa06 100644 --- a/toolchain/check/testdata/class/cross_package_import.carbon +++ b/toolchain/check/testdata/class/cross_package_import.carbon @@ -184,7 +184,7 @@ var c: Other.C = {}; // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Other: = namespace [template] {} // CHECK:STDOUT: %Other.ref: = name_ref Other, %Other [template = %Other] -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+2, loc_14 [template = constants.%C] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+2, loaded [template = constants.%C] // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+3, unloaded // CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.1 [template = constants.%C] @@ -222,7 +222,7 @@ var c: Other.C = {}; // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Other: = namespace [template] {} // CHECK:STDOUT: %Other.ref: = name_ref Other, %Other [template = %Other] -// CHECK:STDOUT: %import_ref: type = import_ref ir2, inst+2, loc_14 [template = constants.%C] +// CHECK:STDOUT: %import_ref: type = import_ref ir2, inst+2, loaded [template = constants.%C] // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref [template = constants.%C] // CHECK:STDOUT: %c.var: ref = var c @@ -257,7 +257,7 @@ var c: Other.C = {}; // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Other: = namespace [template] {} // CHECK:STDOUT: %Other.ref: = name_ref Other, %Other [template = %Other] -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+2, loc_19 [template = constants.%C] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+2, loaded [template = constants.%C] // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+3, unloaded // CHECK:STDOUT: %import_ref.3 = import_ref ir3, inst+2, unloaded @@ -299,7 +299,7 @@ var c: Other.C = {}; // CHECK:STDOUT: %Other: = namespace [template] {} // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Other.ref: = name_ref Other, %Other [template = %Other] -// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+2, loc_19 [template = constants.%C] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+2, loaded [template = constants.%C] // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+3, unloaded // CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+2, unloaded diff --git a/toolchain/check/testdata/class/fail_import_misuses.carbon b/toolchain/check/testdata/class/fail_import_misuses.carbon index 63605ceec7f8..b7812c6ebe98 100644 --- a/toolchain/check/testdata/class/fail_import_misuses.carbon +++ b/toolchain/check/testdata/class/fail_import_misuses.carbon @@ -85,7 +85,7 @@ var a: Incomplete; // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+2, loaded [template = constants.%Empty] -// CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+5, loc_15 [template = constants.%Incomplete] +// CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+5, loaded [template = constants.%Incomplete] // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+3, unloaded // CHECK:STDOUT: %Empty.decl.loc16: type = class_decl @Empty [template = constants.%Empty] { diff --git a/toolchain/check/testdata/class/import.carbon b/toolchain/check/testdata/class/import.carbon index b28a381b9c20..2491c6b859fb 100644 --- a/toolchain/check/testdata/class/import.carbon +++ b/toolchain/check/testdata/class/import.carbon @@ -156,18 +156,18 @@ fn Run() { // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Run = %Run.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+2, loc_16 [template = constants.%Empty] -// CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+5, loc_24 [template = constants.%Field] -// CHECK:STDOUT: %import_ref.3: type = import_ref ir1, inst+12, loc_42 [template = constants.%ForwardDeclared.1] -// CHECK:STDOUT: %import_ref.4: type = import_ref ir1, inst+31, loc_71 [template = constants.%Incomplete] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+2, loaded [template = constants.%Empty] +// CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+5, loaded [template = constants.%Field] +// CHECK:STDOUT: %import_ref.3: type = import_ref ir1, inst+12, loaded [template = constants.%ForwardDeclared.1] +// CHECK:STDOUT: %import_ref.4: type = import_ref ir1, inst+31, loaded [template = constants.%Incomplete] // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Run.decl: Run = fn_decl @Run [template = constants.%struct.1] {} // CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+3, unloaded // CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+6, unloaded -// CHECK:STDOUT: %import_ref.7: = import_ref ir1, inst+8, loc_36 [template = imports.%.1] +// CHECK:STDOUT: %import_ref.7: = import_ref ir1, inst+8, loaded [template = imports.%.1] // CHECK:STDOUT: %import_ref.8 = import_ref ir1, inst+13, unloaded -// CHECK:STDOUT: %import_ref.9: G = import_ref ir1, inst+28, loc_56 [template = constants.%struct.6] -// CHECK:STDOUT: %import_ref.10: F = import_ref ir1, inst+18, loc_50 [template = constants.%struct.5] +// CHECK:STDOUT: %import_ref.9: G = import_ref ir1, inst+28, loaded [template = constants.%struct.6] +// CHECK:STDOUT: %import_ref.10: F = import_ref ir1, inst+18, loaded [template = constants.%struct.5] // CHECK:STDOUT: %import_ref.11 = import_ref ir1, inst+13, unloaded // CHECK:STDOUT: %import_ref.12 = import_ref ir1, inst+28, unloaded // CHECK:STDOUT: %import_ref.13 = import_ref ir1, inst+18, unloaded diff --git a/toolchain/check/testdata/class/import_base.carbon b/toolchain/check/testdata/class/import_base.carbon index ea89a0ed8cee..3f7be4617cf6 100644 --- a/toolchain/check/testdata/class/import_base.carbon +++ b/toolchain/check/testdata/class/import_base.carbon @@ -129,12 +129,12 @@ fn Run() { // CHECK:STDOUT: .Run = %Run.decl // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+2, unloaded -// CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+25, loc_16 [template = constants.%Child] +// CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+25, loaded [template = constants.%Child] // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Run.decl: Run = fn_decl @Run [template = constants.%struct.1] {} -// CHECK:STDOUT: %import_ref.3: F = import_ref ir1, inst+7, loc_44 [template = constants.%struct.4] +// CHECK:STDOUT: %import_ref.3: F = import_ref ir1, inst+7, loaded [template = constants.%struct.4] // CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+3, unloaded -// CHECK:STDOUT: %import_ref.5: = import_ref ir1, inst+18, loc_38 [template = imports.%.1] +// CHECK:STDOUT: %import_ref.5: = import_ref ir1, inst+18, loaded [template = imports.%.1] // CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+14, unloaded // CHECK:STDOUT: %import_ref.7 = import_ref ir1, inst+21, unloaded // CHECK:STDOUT: %import_ref.8 = import_ref ir1, inst+26, unloaded diff --git a/toolchain/check/testdata/class/import_indirect.carbon b/toolchain/check/testdata/class/import_indirect.carbon index eab94f36748a..ad6dd28c0292 100644 --- a/toolchain/check/testdata/class/import_indirect.carbon +++ b/toolchain/check/testdata/class/import_indirect.carbon @@ -136,7 +136,7 @@ var ptr: E* = &val; // CHECK:STDOUT: .b_val = %b_val // CHECK:STDOUT: .b_ptr = %b_ptr // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+2, loc_12 [template = constants.%C] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+2, loaded [template = constants.%C] // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+3, unloaded @@ -187,7 +187,7 @@ var ptr: E* = &val; // CHECK:STDOUT: .c_val = %c_val // CHECK:STDOUT: .c_ptr = %c_ptr // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+2, loc_12 [template = constants.%C] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+2, loaded [template = constants.%C] // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+3, unloaded @@ -240,8 +240,8 @@ var ptr: E* = &val; // CHECK:STDOUT: .val = %val // CHECK:STDOUT: .ptr = %ptr // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+2, loc_15 [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: type = import_ref ir2, inst+8, loc_23 [template = constants.%C] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+2, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: type = import_ref ir2, inst+8, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+13, unloaded // CHECK:STDOUT: %import_ref.4 = import_ref ir2, inst+23, unloaded // CHECK:STDOUT: %Core: = namespace [template] {} @@ -294,10 +294,10 @@ var ptr: E* = &val; // CHECK:STDOUT: .val = %val // CHECK:STDOUT: .ptr = %ptr // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+8, loc_23 [template = constants.%C] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+8, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+13, unloaded // CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+23, unloaded -// CHECK:STDOUT: %import_ref.4: type = import_ref ir2, inst+2, loc_15 [template = constants.%C] +// CHECK:STDOUT: %import_ref.4: type = import_ref ir2, inst+2, loaded [template = constants.%C] // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %import_ref.5 = import_ref ir2, inst+3, unloaded @@ -350,10 +350,10 @@ var ptr: E* = &val; // CHECK:STDOUT: .val = %val // CHECK:STDOUT: .ptr = %ptr // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+8, loc_15 [template = constants.%C] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+8, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+13, unloaded // CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+23, unloaded -// CHECK:STDOUT: %import_ref.4: type = import_ref ir2, inst+8, loc_23 [template = constants.%C] +// CHECK:STDOUT: %import_ref.4: type = import_ref ir2, inst+8, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.5 = import_ref ir2, inst+13, unloaded // CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+23, unloaded // CHECK:STDOUT: %Core: = namespace [template] {} @@ -408,10 +408,10 @@ var ptr: E* = &val; // CHECK:STDOUT: .val = %val // CHECK:STDOUT: .ptr = %ptr // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+8, loc_23 [template = constants.%C] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+8, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+13, unloaded // CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+23, unloaded -// CHECK:STDOUT: %import_ref.4: type = import_ref ir2, inst+8, loc_15 [template = constants.%C] +// CHECK:STDOUT: %import_ref.4: type = import_ref ir2, inst+8, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.5 = import_ref ir2, inst+13, unloaded // CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+23, unloaded // CHECK:STDOUT: %Core: = namespace [template] {} diff --git a/toolchain/check/testdata/class/import_member_cycle.carbon b/toolchain/check/testdata/class/import_member_cycle.carbon index fc44b45107e4..c0cafedaa5a6 100644 --- a/toolchain/check/testdata/class/import_member_cycle.carbon +++ b/toolchain/check/testdata/class/import_member_cycle.carbon @@ -67,7 +67,7 @@ fn Run() { // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Run = %Run.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+2, loc_16 [template = constants.%Cycle] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+2, loaded [template = constants.%Cycle] // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Run.decl: Run = fn_decl @Run [template = constants.%struct] {} // CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+8, unloaded diff --git a/toolchain/check/testdata/class/import_struct_cyle.carbon b/toolchain/check/testdata/class/import_struct_cyle.carbon index a0b2e5d4c81b..3f8fa5651b35 100644 --- a/toolchain/check/testdata/class/import_struct_cyle.carbon +++ b/toolchain/check/testdata/class/import_struct_cyle.carbon @@ -86,11 +86,11 @@ fn Run() { // CHECK:STDOUT: .Run = %Run.decl // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+2, unloaded -// CHECK:STDOUT: %import_ref.2: ref {.b: Cycle*} = import_ref ir1, inst+12, loc_14 +// CHECK:STDOUT: %import_ref.2: ref {.b: Cycle*} = import_ref ir1, inst+12, loaded // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Run.decl: Run = fn_decl @Run [template = constants.%struct] {} // CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: = import_ref ir1, inst+19, loc_24 [template = imports.%.1] +// CHECK:STDOUT: %import_ref.4: = import_ref ir1, inst+19, loaded [template = imports.%.1] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Cycle { diff --git a/toolchain/check/testdata/const/import.carbon b/toolchain/check/testdata/const/import.carbon index 1bb2731d491a..a0a72542c511 100644 --- a/toolchain/check/testdata/const/import.carbon +++ b/toolchain/check/testdata/const/import.carbon @@ -83,8 +83,8 @@ var a_ptr: const i32* = a_ptr_ref; // CHECK:STDOUT: .a_ptr = %a_ptr // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1 = import_ref ir0, inst+5, unloaded -// CHECK:STDOUT: %import_ref.2: ref const i32 = import_ref ir0, inst+11, loc_12 -// CHECK:STDOUT: %import_ref.3: ref const i32* = import_ref ir0, inst+19, loc_22 +// CHECK:STDOUT: %import_ref.2: ref const i32 = import_ref ir0, inst+11, loaded +// CHECK:STDOUT: %import_ref.3: ref const i32* = import_ref ir0, inst+19, loaded // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc6_8: type = const_type i32 [template = constants.%.1] // CHECK:STDOUT: %.loc6_17: type = ptr_type const i32 [template = constants.%.2] diff --git a/toolchain/check/testdata/function/builtin/call_from_operator.carbon b/toolchain/check/testdata/function/builtin/call_from_operator.carbon index 1ef394d5e716..defd58c813d2 100644 --- a/toolchain/check/testdata/function/builtin/call_from_operator.carbon +++ b/toolchain/check/testdata/function/builtin/call_from_operator.carbon @@ -104,10 +104,10 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4); // CHECK:STDOUT: .arr = %arr // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace [template] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_9 [template = constants.%.1] -// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+24, loc_36 [template = constants.%.7] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%.1] +// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+24, loaded [template = constants.%.7] // CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loc_10 [template = constants.%struct.2] +// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loaded [template = constants.%struct.2] // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %Core.ref: = name_ref Core, %Core [template = %Core] // CHECK:STDOUT: %Add.decl: type = interface_decl @Add [template = constants.%.1] {} @@ -115,7 +115,7 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4); // CHECK:STDOUT: } // CHECK:STDOUT: %.loc10_16: i32 = int_literal 1 [template = constants.%.4] // CHECK:STDOUT: %.loc10_20: i32 = int_literal 2 [template = constants.%.5] -// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+1, loc_36 [template = constants.%.1] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+1, loaded [template = constants.%.1] // CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+19, unloaded // CHECK:STDOUT: %.1: Op = interface_witness_access @impl.%.1, element0 [template = constants.%struct.1] // CHECK:STDOUT: %.loc10_18: = bound_method %.loc10_16, %.1 [template = constants.%.8] @@ -123,7 +123,7 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4); // CHECK:STDOUT: %.loc10_21: type = array_type %int.sadd, i32 [template = constants.%.10] // CHECK:STDOUT: %arr.var: ref [i32; 3] = var arr // CHECK:STDOUT: %arr: ref [i32; 3] = bind_name arr, %arr.var -// CHECK:STDOUT: %import_ref.7: type = import_ref ir2, inst+1, loc_47 [template = constants.%.1] +// CHECK:STDOUT: %import_ref.7: type = import_ref ir2, inst+1, loaded [template = constants.%.1] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Add { diff --git a/toolchain/check/testdata/function/builtin/import.carbon b/toolchain/check/testdata/function/builtin/import.carbon index 4165d920b831..235e10ea8a09 100644 --- a/toolchain/check/testdata/function/builtin/import.carbon +++ b/toolchain/check/testdata/function/builtin/import.carbon @@ -64,7 +64,7 @@ var arr: [i32; Core.Add(1, 2)] = (1, 2, 3); // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Core.ref: = name_ref Core, %Core [template = %Core] -// CHECK:STDOUT: %import_ref: Add = import_ref ir2, inst+6, loc_11 [template = constants.%struct] +// CHECK:STDOUT: %import_ref: Add = import_ref ir2, inst+6, loaded [template = constants.%struct] // CHECK:STDOUT: %Add.ref: Add = name_ref Add, %import_ref [template = constants.%struct] // CHECK:STDOUT: %.loc4_25: i32 = int_literal 1 [template = constants.%.2] // CHECK:STDOUT: %.loc4_28: i32 = int_literal 2 [template = constants.%.3] diff --git a/toolchain/check/testdata/function/declaration/import.carbon b/toolchain/check/testdata/function/declaration/import.carbon index a93ad71ef521..78df985b7126 100644 --- a/toolchain/check/testdata/function/declaration/import.carbon +++ b/toolchain/check/testdata/function/declaration/import.carbon @@ -240,7 +240,7 @@ var c: {.c: i32} = C((1,)); var d: () = D(); var e: () = NS.E(); -// --- fail_decl_after_use.carbon +// --- decl_after_use.carbon library "decl_after_use" api; @@ -248,34 +248,20 @@ import library "extern_api"; var a: () = A(); -// CHECK:STDERR: fail_decl_after_use.carbon:[[@LINE+7]]:1: ERROR: Redeclaration of imported entity that was previously used. -// CHECK:STDERR: fn A(); -// CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_decl_after_use.carbon:[[@LINE-5]]:13: Import used here. -// CHECK:STDERR: var a: () = A(); -// CHECK:STDERR: ^ -// CHECK:STDERR: fn A(); -// --- fail_decl_after_use_two_errors.carbon +// --- fail_redecl_mismatch_after_use.carbon -library "decl_after_use_two_errors" api; +library "redecl_mismatch_after_use" api; import library "extern_api"; var a: () = A(); -// CHECK:STDERR: fail_decl_after_use_two_errors.carbon:[[@LINE+17]]:1: ERROR: Redeclaration of imported entity that was previously used. +// CHECK:STDERR: fail_redecl_mismatch_after_use.carbon:[[@LINE+10]]:1: ERROR: Function redeclaration differs because return type is `i32`. // CHECK:STDERR: fn A() -> i32; // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_decl_after_use_two_errors.carbon:[[@LINE-5]]:13: Import used here. -// CHECK:STDERR: var a: () = A(); -// CHECK:STDERR: ^ -// CHECK:STDERR: -// CHECK:STDERR: fail_decl_after_use_two_errors.carbon:[[@LINE+10]]:1: ERROR: Function redeclaration differs because return type is `i32`. -// CHECK:STDERR: fn A() -> i32; -// CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_decl_after_use_two_errors.carbon:[[@LINE-14]]:1: In import. +// CHECK:STDERR: fail_redecl_mismatch_after_use.carbon:[[@LINE-7]]:1: In import. // CHECK:STDERR: import library "extern_api"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: extern_api.carbon:4:1: Previously declared with no return type. @@ -284,7 +270,7 @@ var a: () = A(); // CHECK:STDERR: fn A() -> i32; -// --- fail_extern_after_use.carbon +// --- todo_fail_extern_after_use.carbon library "extern_after_use" api; @@ -292,13 +278,6 @@ import library "api"; var a: () = A(); -// CHECK:STDERR: fail_extern_after_use.carbon:[[@LINE+7]]:1: ERROR: Redeclaration of imported entity that was previously used. -// CHECK:STDERR: extern fn A(); -// CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_extern_after_use.carbon:[[@LINE-5]]:13: Import used here. -// CHECK:STDERR: var a: () = A(); -// CHECK:STDERR: ^ -// CHECK:STDERR: extern fn A(); // --- unloaded.carbon @@ -538,15 +517,15 @@ import library "extern_api"; // CHECK:STDOUT: .d = %d // CHECK:STDOUT: .e = %e // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loc_15 [template = constants.%struct.1] -// CHECK:STDOUT: %import_ref.2: B = import_ref ir1, inst+9, loc_24 [template = constants.%struct.2] -// CHECK:STDOUT: %import_ref.3: C = import_ref ir1, inst+23, loc_39 [template = constants.%struct.3] -// CHECK:STDOUT: %import_ref.4: D = import_ref ir1, inst+26, loc_53 [template = constants.%struct.4] +// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loaded [template = constants.%struct.1] +// CHECK:STDOUT: %import_ref.2: B = import_ref ir1, inst+9, loaded [template = constants.%struct.2] +// CHECK:STDOUT: %import_ref.3: C = import_ref ir1, inst+23, loaded [template = constants.%struct.3] +// CHECK:STDOUT: %import_ref.4: D = import_ref ir1, inst+26, loaded [template = constants.%struct.4] // CHECK:STDOUT: %import_ref.5: = import_ref ir1, inst+29, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { // CHECK:STDOUT: .E = %import_ref.6 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: E = import_ref ir1, inst+30, loc_65 [template = constants.%struct.5] +// CHECK:STDOUT: %import_ref.6: E = import_ref ir1, inst+30, loaded [template = constants.%struct.5] // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc6_9.1: () = tuple_literal () // CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%.1 [template = constants.%.1] @@ -869,15 +848,15 @@ import library "extern_api"; // CHECK:STDOUT: .d = %d // CHECK:STDOUT: .e = %e // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loc_19 [template = constants.%struct.1] -// CHECK:STDOUT: %import_ref.2: B = import_ref ir1, inst+9, loc_28 [template = constants.%struct.2] -// CHECK:STDOUT: %import_ref.3: C = import_ref ir1, inst+23, loc_43 [template = constants.%struct.3] -// CHECK:STDOUT: %import_ref.4: D = import_ref ir1, inst+26, loc_57 [template = constants.%struct.4] +// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loaded [template = constants.%struct.1] +// CHECK:STDOUT: %import_ref.2: B = import_ref ir1, inst+9, loaded [template = constants.%struct.2] +// CHECK:STDOUT: %import_ref.3: C = import_ref ir1, inst+23, loaded [template = constants.%struct.3] +// CHECK:STDOUT: %import_ref.4: D = import_ref ir1, inst+26, loaded [template = constants.%struct.4] // CHECK:STDOUT: %import_ref.5: = import_ref ir1, inst+29, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { // CHECK:STDOUT: .E = %import_ref.6 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: E = import_ref ir1, inst+30, loc_69 [template = constants.%struct.5] +// CHECK:STDOUT: %import_ref.6: E = import_ref ir1, inst+30, loaded [template = constants.%struct.5] // CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+2, unloaded // CHECK:STDOUT: %import_ref.8 = import_ref ir2, inst+9, unloaded // CHECK:STDOUT: %import_ref.9 = import_ref ir2, inst+23, unloaded @@ -973,15 +952,15 @@ import library "extern_api"; // CHECK:STDOUT: .d = %d // CHECK:STDOUT: .e = %e // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loc_19 [template = constants.%struct.1] -// CHECK:STDOUT: %import_ref.2: B = import_ref ir1, inst+9, loc_28 [template = constants.%struct.2] -// CHECK:STDOUT: %import_ref.3: C = import_ref ir1, inst+23, loc_43 [template = constants.%struct.3] -// CHECK:STDOUT: %import_ref.4: D = import_ref ir1, inst+26, loc_57 [template = constants.%struct.4] +// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loaded [template = constants.%struct.1] +// CHECK:STDOUT: %import_ref.2: B = import_ref ir1, inst+9, loaded [template = constants.%struct.2] +// CHECK:STDOUT: %import_ref.3: C = import_ref ir1, inst+23, loaded [template = constants.%struct.3] +// CHECK:STDOUT: %import_ref.4: D = import_ref ir1, inst+26, loaded [template = constants.%struct.4] // CHECK:STDOUT: %import_ref.5: = import_ref ir1, inst+29, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { // CHECK:STDOUT: .E = %import_ref.6 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: E = import_ref ir1, inst+30, loc_69 [template = constants.%struct.5] +// CHECK:STDOUT: %import_ref.6: E = import_ref ir1, inst+30, loaded [template = constants.%struct.5] // CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+2, unloaded // CHECK:STDOUT: %import_ref.8 = import_ref ir2, inst+9, unloaded // CHECK:STDOUT: %import_ref.9 = import_ref ir2, inst+23, unloaded @@ -1043,7 +1022,7 @@ import library "extern_api"; // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: --- fail_decl_after_use.carbon +// CHECK:STDOUT: --- decl_after_use.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %.1: type = tuple_type () [template] @@ -1061,7 +1040,7 @@ import library "extern_api"; // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loc_15 [template = constants.%struct] +// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loaded [template = constants.%struct] // CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+9, unloaded // CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+23, unloaded // CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+26, unloaded @@ -1088,7 +1067,7 @@ import library "extern_api"; // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: --- fail_decl_after_use_two_errors.carbon +// CHECK:STDOUT: --- fail_redecl_mismatch_after_use.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %.1: type = tuple_type () [template] @@ -1108,7 +1087,7 @@ import library "extern_api"; // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loc_15 [template = constants.%struct.1] +// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loaded [template = constants.%struct.1] // CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+9, unloaded // CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+23, unloaded // CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+26, unloaded @@ -1139,7 +1118,7 @@ import library "extern_api"; // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: --- fail_extern_after_use.carbon +// CHECK:STDOUT: --- todo_fail_extern_after_use.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %.1: type = tuple_type () [template] @@ -1157,7 +1136,7 @@ import library "extern_api"; // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loc_15 [template = constants.%struct] +// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loaded [template = constants.%struct] // CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+9, unloaded // CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+23, unloaded // CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+26, unloaded diff --git a/toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon b/toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon index f8df41c763f1..eddb0a745a68 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon @@ -179,10 +179,10 @@ fn CallFAndGIncomplete() { // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+1, unloaded // CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+3, unloaded -// CHECK:STDOUT: %import_ref.3: ReturnCUnused = import_ref ir1, inst+7, loc_14 [template = constants.%struct.2] -// CHECK:STDOUT: %import_ref.4: ReturnCUsed = import_ref ir1, inst+13, loc_18 [template = constants.%struct.3] -// CHECK:STDOUT: %import_ref.5: ReturnDUnused = import_ref ir1, inst+18, loc_22 [template = constants.%struct.4] -// CHECK:STDOUT: %import_ref.6: ReturnDUsed = import_ref ir1, inst+23, loc_26 [template = constants.%struct.5] +// CHECK:STDOUT: %import_ref.3: ReturnCUnused = import_ref ir1, inst+7, loaded [template = constants.%struct.2] +// CHECK:STDOUT: %import_ref.4: ReturnCUsed = import_ref ir1, inst+13, loaded [template = constants.%struct.3] +// CHECK:STDOUT: %import_ref.5: ReturnDUnused = import_ref ir1, inst+18, loaded [template = constants.%struct.4] +// CHECK:STDOUT: %import_ref.6: ReturnDUsed = import_ref ir1, inst+23, loaded [template = constants.%struct.5] // CHECK:STDOUT: %import_ref.7 = import_ref ir1, inst+26, unloaded // CHECK:STDOUT: %CallFAndGIncomplete.decl: CallFAndGIncomplete = fn_decl @CallFAndGIncomplete [template = constants.%struct.1] {} // CHECK:STDOUT: %import_ref.8 = import_ref ir1, inst+4, unloaded diff --git a/toolchain/check/testdata/function/definition/import.carbon b/toolchain/check/testdata/function/definition/import.carbon index 2a617240e80d..248524eb341f 100644 --- a/toolchain/check/testdata/function/definition/import.carbon +++ b/toolchain/check/testdata/function/definition/import.carbon @@ -204,9 +204,9 @@ fn D() {} // CHECK:STDOUT: .b = %b // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loc_15 [template = constants.%struct.1] -// CHECK:STDOUT: %import_ref.2: B = import_ref ir1, inst+10, loc_24 [template = constants.%struct.2] -// CHECK:STDOUT: %import_ref.3: C = import_ref ir1, inst+26, loc_39 [template = constants.%struct.3] +// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loaded [template = constants.%struct.1] +// CHECK:STDOUT: %import_ref.2: B = import_ref ir1, inst+10, loaded [template = constants.%struct.2] +// CHECK:STDOUT: %import_ref.3: C = import_ref ir1, inst+26, loaded [template = constants.%struct.3] // CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+38, unloaded // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc6_9.1: () = tuple_literal () diff --git a/toolchain/check/testdata/impl/lookup/import.carbon b/toolchain/check/testdata/impl/lookup/import.carbon index 9de097a0feca..54fdee3904fe 100644 --- a/toolchain/check/testdata/impl/lookup/import.carbon +++ b/toolchain/check/testdata/impl/lookup/import.carbon @@ -121,18 +121,18 @@ fn G(c: Impl.C) { // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+14, unloaded // CHECK:STDOUT: %HasF.decl: type = interface_decl @HasF [template = constants.%.2] {} -// CHECK:STDOUT: %import_ref.2: = import_ref ir1, inst+11, loc_20 [template = constants.%.6] +// CHECK:STDOUT: %import_ref.2: = import_ref ir1, inst+11, loaded [template = constants.%.6] // CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+4, unloaded // CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+6, unloaded -// CHECK:STDOUT: %import_ref.5: = import_ref ir1, inst+22, loc_22 [template = constants.%.7] -// CHECK:STDOUT: %import_ref.6: type = import_ref ir1, inst+13, loc_10 [template = constants.%C] +// CHECK:STDOUT: %import_ref.5: = import_ref ir1, inst+22, loaded [template = constants.%.7] +// CHECK:STDOUT: %import_ref.6: type = import_ref ir1, inst+13, loaded [template = constants.%C] // CHECK:STDOUT: %G.decl: G = fn_decl @G [template = constants.%struct.1] { // CHECK:STDOUT: %Impl.ref: = name_ref Impl, %Impl [template = %Impl] // CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.6 [template = constants.%C] // CHECK:STDOUT: %c.loc4_6.1: C = param c // CHECK:STDOUT: @G.%c: C = bind_name c, %c.loc4_6.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.7: type = import_ref ir1, inst+2, loc_18 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.7: type = import_ref ir1, inst+2, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.8 = import_ref ir1, inst+6, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon b/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon index af40d02ad1d3..8bf85b0425b8 100644 --- a/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon +++ b/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon @@ -117,18 +117,18 @@ fn G(c: Impl.C) { // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+13, unloaded // CHECK:STDOUT: %HasF.decl: type = interface_decl @HasF [template = constants.%.2] {} -// CHECK:STDOUT: %import_ref.2: = import_ref ir1, inst+10, loc_20 [template = constants.%.6] +// CHECK:STDOUT: %import_ref.2: = import_ref ir1, inst+10, loaded [template = constants.%.6] // CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+3, unloaded // CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+5, unloaded -// CHECK:STDOUT: %import_ref.5: = import_ref ir1, inst+21, loc_22 [template = constants.%.7] -// CHECK:STDOUT: %import_ref.6: type = import_ref ir1, inst+12, loc_10 [template = constants.%C] +// CHECK:STDOUT: %import_ref.5: = import_ref ir1, inst+21, loaded [template = constants.%.7] +// CHECK:STDOUT: %import_ref.6: type = import_ref ir1, inst+12, loaded [template = constants.%C] // CHECK:STDOUT: %G.decl: G = fn_decl @G [template = constants.%struct.1] { // CHECK:STDOUT: %Impl.ref: = name_ref Impl, %Impl [template = %Impl] // CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.6 [template = constants.%C] // CHECK:STDOUT: %c.loc4_6.1: C = param c // CHECK:STDOUT: @G.%c: C = bind_name c, %c.loc4_6.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.7: type = import_ref ir1, inst+1, loc_18 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.7: type = import_ref ir1, inst+1, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.8 = import_ref ir1, inst+5, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/no_prelude/import_self.carbon b/toolchain/check/testdata/impl/no_prelude/import_self.carbon index e2ff066bf017..ad63cc3f606f 100644 --- a/toolchain/check/testdata/impl/no_prelude/import_self.carbon +++ b/toolchain/check/testdata/impl/no_prelude/import_self.carbon @@ -96,10 +96,10 @@ fn F(x: (), y: ()) -> () { // CHECK:STDOUT: .Add = %import_ref.1 // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+1, loc_13 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2: = import_ref ir1, inst+24, loc_58 [template = constants.%.5] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+1, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2: = import_ref ir1, inst+24, loaded [template = constants.%.5] // CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: Op = import_ref ir1, inst+19, loc_14 [template = constants.%struct.2] +// CHECK:STDOUT: %import_ref.4: Op = import_ref ir1, inst+19, loaded [template = constants.%struct.2] // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %.loc6_7.1: () = tuple_literal () // CHECK:STDOUT: %.loc6_7.2: type = converted %.loc6_7.1, constants.%.1 [template = constants.%.1] diff --git a/toolchain/check/testdata/interface/no_prelude/import.carbon b/toolchain/check/testdata/interface/no_prelude/import.carbon index 7472c99f74f1..d658cf32dda2 100644 --- a/toolchain/check/testdata/interface/no_prelude/import.carbon +++ b/toolchain/check/testdata/interface/no_prelude/import.carbon @@ -174,10 +174,10 @@ var f: ForwardDeclared* = &f_ref.f; // CHECK:STDOUT: .UseForwardDeclaredF = %UseForwardDeclaredF // CHECK:STDOUT: .f = %f.loc16 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+1, loc_13 [template = constants.%.1] -// CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+5, loc_22 [template = constants.%.3] -// CHECK:STDOUT: %import_ref.3: type = import_ref ir1, inst+20, loc_31 [template = constants.%.4] -// CHECK:STDOUT: %import_ref.4: ref {.f: ForwardDeclared} = import_ref ir1, inst+42, loc_70 +// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+1, loaded [template = constants.%.1] +// CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+5, loaded [template = constants.%.3] +// CHECK:STDOUT: %import_ref.3: type = import_ref ir1, inst+20, loaded [template = constants.%.4] +// CHECK:STDOUT: %import_ref.4: ref {.f: ForwardDeclared} = import_ref ir1, inst+42, loaded // CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+3, unloaded // CHECK:STDOUT: %UseEmpty.decl: UseEmpty = fn_decl @UseEmpty [template = constants.%struct.1] { // CHECK:STDOUT: %Empty.decl: type = interface_decl @Empty [template = constants.%.1] {} @@ -186,8 +186,8 @@ var f: ForwardDeclared* = &f_ref.f; // CHECK:STDOUT: @UseEmpty.%e: Empty = bind_name e, %e.loc6_13.1 // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+7, unloaded -// CHECK:STDOUT: %import_ref.7: = import_ref ir1, inst+18, loc_48 [template = constants.%.8] -// CHECK:STDOUT: %import_ref.8: = import_ref ir1, inst+11, loc_41 [template = constants.%.6] +// CHECK:STDOUT: %import_ref.7: = import_ref ir1, inst+18, loaded [template = constants.%.8] +// CHECK:STDOUT: %import_ref.8: = import_ref ir1, inst+11, loaded [template = constants.%.6] // CHECK:STDOUT: %import_ref.9 = import_ref ir1, inst+9, unloaded // CHECK:STDOUT: %import_ref.10 = import_ref ir1, inst+13, unloaded // CHECK:STDOUT: %UseBasic.decl: UseBasic = fn_decl @UseBasic [template = constants.%struct.2] { @@ -197,8 +197,8 @@ var f: ForwardDeclared* = &f_ref.f; // CHECK:STDOUT: @UseBasic.%e: Basic = bind_name e, %e.loc7_13.1 // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.11 = import_ref ir1, inst+22, unloaded -// CHECK:STDOUT: %import_ref.12: = import_ref ir1, inst+32, loc_62 [template = constants.%.12] -// CHECK:STDOUT: %import_ref.13: = import_ref ir1, inst+26, loc_55 [template = constants.%.10] +// CHECK:STDOUT: %import_ref.12: = import_ref ir1, inst+32, loaded [template = constants.%.12] +// CHECK:STDOUT: %import_ref.13: = import_ref ir1, inst+26, loaded [template = constants.%.10] // CHECK:STDOUT: %import_ref.14 = import_ref ir1, inst+24, unloaded // CHECK:STDOUT: %import_ref.15 = import_ref ir1, inst+28, unloaded // CHECK:STDOUT: %UseForwardDeclared.decl: UseForwardDeclared = fn_decl @UseForwardDeclared [template = constants.%struct.3] { diff --git a/toolchain/check/testdata/let/fail_generic_import.carbon b/toolchain/check/testdata/let/fail_generic_import.carbon index e90721aa4d97..896836b31679 100644 --- a/toolchain/check/testdata/let/fail_generic_import.carbon +++ b/toolchain/check/testdata/let/fail_generic_import.carbon @@ -46,7 +46,7 @@ let a: T = 0; // CHECK:STDOUT: .T = %import_ref // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: type = import_ref ir0, inst+2, loc_7 [symbolic = constants.%T] +// CHECK:STDOUT: %import_ref: type = import_ref ir0, inst+2, loaded [symbolic = constants.%T] // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %T.ref: type = name_ref T, %import_ref [symbolic = constants.%T] // CHECK:STDOUT: %.loc8: i32 = int_literal 0 [template = constants.%.1] diff --git a/toolchain/check/testdata/let/generic_import.carbon b/toolchain/check/testdata/let/generic_import.carbon index 71674f9a6a29..5991226f8c61 100644 --- a/toolchain/check/testdata/let/generic_import.carbon +++ b/toolchain/check/testdata/let/generic_import.carbon @@ -45,7 +45,7 @@ var b: T = *a; // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: type = import_ref ir0, inst+2, loc_7 [symbolic = constants.%T] +// CHECK:STDOUT: %import_ref: type = import_ref ir0, inst+2, loaded [symbolic = constants.%T] // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %T.ref.loc4: type = name_ref T, %import_ref [symbolic = constants.%T] // CHECK:STDOUT: %.loc4: type = ptr_type T [symbolic = constants.%.1] diff --git a/toolchain/check/testdata/let/import.carbon b/toolchain/check/testdata/let/import.carbon index e1f4328412f0..0a019bf5a213 100644 --- a/toolchain/check/testdata/let/import.carbon +++ b/toolchain/check/testdata/let/import.carbon @@ -44,7 +44,7 @@ let b:! bool = a; // CHECK:STDOUT: .a = %import_ref // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: bool = import_ref ir0, inst+2, loc_10 [symbolic = constants.%a] +// CHECK:STDOUT: %import_ref: bool = import_ref ir0, inst+2, loaded [symbolic = constants.%a] // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %a.ref: bool = name_ref a, %import_ref [symbolic = constants.%a] // CHECK:STDOUT: %b: bool = bind_symbolic_name b 0, %a.ref [symbolic = constants.%b] diff --git a/toolchain/check/testdata/namespace/imported.carbon b/toolchain/check/testdata/namespace/imported.carbon index 3ad753420664..210481b75b14 100644 --- a/toolchain/check/testdata/namespace/imported.carbon +++ b/toolchain/check/testdata/namespace/imported.carbon @@ -83,8 +83,8 @@ var package_b: () = package.NS.ChildNS.B(); // CHECK:STDOUT: %ChildNS: = namespace %import_ref.2, [template] { // CHECK:STDOUT: .B = %import_ref.4 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: A = import_ref ir0, inst+4, loc_13 [template = constants.%struct.1] -// CHECK:STDOUT: %import_ref.4: B = import_ref ir0, inst+8, loc_27 [template = constants.%struct.2] +// CHECK:STDOUT: %import_ref.3: A = import_ref ir0, inst+4, loaded [template = constants.%struct.1] +// CHECK:STDOUT: %import_ref.4: B = import_ref ir0, inst+8, loaded [template = constants.%struct.2] // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc4_9.1: () = tuple_literal () // CHECK:STDOUT: %.loc4_9.2: type = converted %.loc4_9.1, constants.%.1 [template = constants.%.1] diff --git a/toolchain/check/testdata/namespace/imported_indirect.carbon b/toolchain/check/testdata/namespace/imported_indirect.carbon index 432e03fbd93c..cb8bae288257 100644 --- a/toolchain/check/testdata/namespace/imported_indirect.carbon +++ b/toolchain/check/testdata/namespace/imported_indirect.carbon @@ -143,7 +143,7 @@ var e: () = A.B.C.D(); // CHECK:STDOUT: %C: = namespace %import_ref.3, [template] { // CHECK:STDOUT: .D = %import_ref.4 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: D = import_ref ir1, inst+8, loc_23 [template = constants.%struct] +// CHECK:STDOUT: %import_ref.4: D = import_ref ir1, inst+8, loaded [template = constants.%struct] // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc5_9.1: () = tuple_literal () // CHECK:STDOUT: %.loc5_9.2: type = converted %.loc5_9.1, constants.%.1 [template = constants.%.1] diff --git a/toolchain/check/testdata/namespace/merging.carbon b/toolchain/check/testdata/namespace/merging.carbon index 4ba0b2051a7e..3decbedae932 100644 --- a/toolchain/check/testdata/namespace/merging.carbon +++ b/toolchain/check/testdata/namespace/merging.carbon @@ -131,9 +131,9 @@ fn Run() { // CHECK:STDOUT: .B2 = %import_ref.4 // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: A = import_ref ir1, inst+3, loc_33 [template = constants.%struct.3] -// CHECK:STDOUT: %import_ref.3: B1 = import_ref ir2, inst+3, loc_39 [template = constants.%struct.4] -// CHECK:STDOUT: %import_ref.4: B2 = import_ref ir2, inst+9, loc_45 [template = constants.%struct.5] +// CHECK:STDOUT: %import_ref.2: A = import_ref ir1, inst+3, loaded [template = constants.%struct.3] +// CHECK:STDOUT: %import_ref.3: B1 = import_ref ir2, inst+3, loaded [template = constants.%struct.4] +// CHECK:STDOUT: %import_ref.4: B2 = import_ref ir2, inst+9, loaded [template = constants.%struct.5] // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc7: = namespace [template] {} // CHECK:STDOUT: %C.decl: C = fn_decl @C [template = constants.%struct.1] {} diff --git a/toolchain/check/testdata/operators/overloaded/add.carbon b/toolchain/check/testdata/operators/overloaded/add.carbon index 9aeafb2e9fda..1b92f3f7295e 100644 --- a/toolchain/check/testdata/operators/overloaded/add.carbon +++ b/toolchain/check/testdata/operators/overloaded/add.carbon @@ -167,20 +167,20 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+24, loc_82 [template = constants.%.11] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+24, loaded [template = constants.%.11] // CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loc_19 [template = constants.%struct.2] +// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loaded [template = constants.%struct.2] // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc8: = name_ref Core, %Core [template = %Core] // CHECK:STDOUT: %Add.decl: type = interface_decl @Add [template = constants.%.2] {} // CHECK:STDOUT: %Add.ref: type = name_ref Add, %import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+26, loc_46 [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6: = import_ref ir2, inst+47, loc_101 [template = constants.%.13] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+26, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.6: = import_ref ir2, inst+47, loaded [template = constants.%.13] // CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+28, unloaded -// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+43, loc_47 [template = constants.%struct.5] +// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+43, loaded [template = constants.%struct.5] // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc13: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc13: = name_ref Core, %Core [template = %Core] @@ -197,7 +197,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %C.ref.loc17_26: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: @TestOp.%return: ref C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loc_82 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+19, unloaded // CHECK:STDOUT: %TestAssign.decl: TestAssign = fn_decl @TestAssign [template = constants.%struct.7] { // CHECK:STDOUT: %C.ref.loc21_18: type = name_ref C, %C.decl [template = constants.%C] @@ -208,7 +208,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %b.loc21_22.1: C = param b // CHECK:STDOUT: @TestAssign.%b: C = bind_name b, %b.loc21_22.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+26, loc_101 [template = constants.%.6] +// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+26, loaded [template = constants.%.6] // CHECK:STDOUT: %import_ref.12 = import_ref ir2, inst+43, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/bit_and.carbon b/toolchain/check/testdata/operators/overloaded/bit_and.carbon index 8d7ac83e8057..ad59367892a6 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_and.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_and.carbon @@ -167,20 +167,20 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+24, loc_82 [template = constants.%.11] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+24, loaded [template = constants.%.11] // CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loc_19 [template = constants.%struct.2] +// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loaded [template = constants.%struct.2] // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc8: = name_ref Core, %Core [template = %Core] // CHECK:STDOUT: %BitAnd.decl: type = interface_decl @BitAnd [template = constants.%.2] {} // CHECK:STDOUT: %BitAnd.ref: type = name_ref BitAnd, %import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+26, loc_46 [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6: = import_ref ir2, inst+47, loc_101 [template = constants.%.13] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+26, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.6: = import_ref ir2, inst+47, loaded [template = constants.%.13] // CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+28, unloaded -// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+43, loc_47 [template = constants.%struct.5] +// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+43, loaded [template = constants.%struct.5] // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc13: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc13: = name_ref Core, %Core [template = %Core] @@ -197,7 +197,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %C.ref.loc17_26: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: @TestOp.%return: ref C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loc_82 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+19, unloaded // CHECK:STDOUT: %TestAssign.decl: TestAssign = fn_decl @TestAssign [template = constants.%struct.7] { // CHECK:STDOUT: %C.ref.loc21_18: type = name_ref C, %C.decl [template = constants.%C] @@ -208,7 +208,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %b.loc21_22.1: C = param b // CHECK:STDOUT: @TestAssign.%b: C = bind_name b, %b.loc21_22.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+26, loc_101 [template = constants.%.6] +// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+26, loaded [template = constants.%.6] // CHECK:STDOUT: %import_ref.12 = import_ref ir2, inst+43, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/bit_complement.carbon b/toolchain/check/testdata/operators/overloaded/bit_complement.carbon index 139650479f9d..ceb0f62f7fd6 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_complement.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_complement.carbon @@ -103,10 +103,10 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+19, loc_50 [template = constants.%.7] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+19, loaded [template = constants.%.7] // CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+14, loc_19 [template = constants.%struct.2] +// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+14, loaded [template = constants.%struct.2] // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, %Core [template = %Core] @@ -120,7 +120,7 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: %C.ref.loc14_20: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: @TestOp.%return: ref C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+1, loc_50 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+1, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+14, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/bit_or.carbon b/toolchain/check/testdata/operators/overloaded/bit_or.carbon index b9df8b8acb12..dbad2a14937a 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_or.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_or.carbon @@ -167,20 +167,20 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+24, loc_82 [template = constants.%.11] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+24, loaded [template = constants.%.11] // CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loc_19 [template = constants.%struct.2] +// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loaded [template = constants.%struct.2] // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc8: = name_ref Core, %Core [template = %Core] // CHECK:STDOUT: %BitOr.decl: type = interface_decl @BitOr [template = constants.%.2] {} // CHECK:STDOUT: %BitOr.ref: type = name_ref BitOr, %import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+26, loc_46 [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6: = import_ref ir2, inst+47, loc_101 [template = constants.%.13] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+26, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.6: = import_ref ir2, inst+47, loaded [template = constants.%.13] // CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+28, unloaded -// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+43, loc_47 [template = constants.%struct.5] +// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+43, loaded [template = constants.%struct.5] // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc13: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc13: = name_ref Core, %Core [template = %Core] @@ -197,7 +197,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %C.ref.loc17_26: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: @TestOp.%return: ref C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loc_82 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+19, unloaded // CHECK:STDOUT: %TestAssign.decl: TestAssign = fn_decl @TestAssign [template = constants.%struct.7] { // CHECK:STDOUT: %C.ref.loc21_18: type = name_ref C, %C.decl [template = constants.%C] @@ -208,7 +208,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %b.loc21_22.1: C = param b // CHECK:STDOUT: @TestAssign.%b: C = bind_name b, %b.loc21_22.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+26, loc_101 [template = constants.%.6] +// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+26, loaded [template = constants.%.6] // CHECK:STDOUT: %import_ref.12 = import_ref ir2, inst+43, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/bit_xor.carbon b/toolchain/check/testdata/operators/overloaded/bit_xor.carbon index 520110234b38..9328ca002f61 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_xor.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_xor.carbon @@ -167,20 +167,20 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+24, loc_82 [template = constants.%.11] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+24, loaded [template = constants.%.11] // CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loc_19 [template = constants.%struct.2] +// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loaded [template = constants.%struct.2] // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc8: = name_ref Core, %Core [template = %Core] // CHECK:STDOUT: %BitXor.decl: type = interface_decl @BitXor [template = constants.%.2] {} // CHECK:STDOUT: %BitXor.ref: type = name_ref BitXor, %import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+26, loc_46 [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6: = import_ref ir2, inst+47, loc_101 [template = constants.%.13] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+26, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.6: = import_ref ir2, inst+47, loaded [template = constants.%.13] // CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+28, unloaded -// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+43, loc_47 [template = constants.%struct.5] +// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+43, loaded [template = constants.%struct.5] // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc13: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc13: = name_ref Core, %Core [template = %Core] @@ -197,7 +197,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %C.ref.loc17_26: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: @TestOp.%return: ref C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loc_82 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+19, unloaded // CHECK:STDOUT: %TestAssign.decl: TestAssign = fn_decl @TestAssign [template = constants.%struct.7] { // CHECK:STDOUT: %C.ref.loc21_18: type = name_ref C, %C.decl [template = constants.%C] @@ -208,7 +208,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %b.loc21_22.1: C = param b // CHECK:STDOUT: @TestAssign.%b: C = bind_name b, %b.loc21_22.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+26, loc_101 [template = constants.%.6] +// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+26, loaded [template = constants.%.6] // CHECK:STDOUT: %import_ref.12 = import_ref ir2, inst+43, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/dec.carbon b/toolchain/check/testdata/operators/overloaded/dec.carbon index 22e708beaf0e..c64e78851dae 100644 --- a/toolchain/check/testdata/operators/overloaded/dec.carbon +++ b/toolchain/check/testdata/operators/overloaded/dec.carbon @@ -103,10 +103,10 @@ fn TestOp() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+18, loc_47 [template = constants.%.9] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+18, loaded [template = constants.%.9] // CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+13, loc_19 [template = constants.%struct.2] +// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+13, loaded [template = constants.%struct.2] // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, %Core [template = %Core] @@ -114,7 +114,7 @@ fn TestOp() { // CHECK:STDOUT: %Dec.ref: type = name_ref Dec, %import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: TestOp = fn_decl @TestOp [template = constants.%struct.3] {} -// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+1, loc_47 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+1, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+13, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/div.carbon b/toolchain/check/testdata/operators/overloaded/div.carbon index b96e8034458f..0f1ed1052776 100644 --- a/toolchain/check/testdata/operators/overloaded/div.carbon +++ b/toolchain/check/testdata/operators/overloaded/div.carbon @@ -167,20 +167,20 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+24, loc_82 [template = constants.%.11] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+24, loaded [template = constants.%.11] // CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loc_19 [template = constants.%struct.2] +// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loaded [template = constants.%struct.2] // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc8: = name_ref Core, %Core [template = %Core] // CHECK:STDOUT: %Div.decl: type = interface_decl @Div [template = constants.%.2] {} // CHECK:STDOUT: %Div.ref: type = name_ref Div, %import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+26, loc_46 [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6: = import_ref ir2, inst+47, loc_101 [template = constants.%.13] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+26, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.6: = import_ref ir2, inst+47, loaded [template = constants.%.13] // CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+28, unloaded -// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+43, loc_47 [template = constants.%struct.5] +// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+43, loaded [template = constants.%struct.5] // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc13: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc13: = name_ref Core, %Core [template = %Core] @@ -197,7 +197,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %C.ref.loc17_26: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: @TestOp.%return: ref C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loc_82 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+19, unloaded // CHECK:STDOUT: %TestAssign.decl: TestAssign = fn_decl @TestAssign [template = constants.%struct.7] { // CHECK:STDOUT: %C.ref.loc21_18: type = name_ref C, %C.decl [template = constants.%C] @@ -208,7 +208,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %b.loc21_22.1: C = param b // CHECK:STDOUT: @TestAssign.%b: C = bind_name b, %b.loc21_22.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+26, loc_101 [template = constants.%.6] +// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+26, loaded [template = constants.%.6] // CHECK:STDOUT: %import_ref.12 = import_ref ir2, inst+43, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/eq.carbon b/toolchain/check/testdata/operators/overloaded/eq.carbon index f73355638137..79d511cd42d0 100644 --- a/toolchain/check/testdata/operators/overloaded/eq.carbon +++ b/toolchain/check/testdata/operators/overloaded/eq.carbon @@ -194,12 +194,12 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.3: = import_ref ir2, inst+21, loc_68 [template = constants.%.7] -// CHECK:STDOUT: %import_ref.4: = import_ref ir2, inst+38, loc_88 [template = constants.%.9] -// CHECK:STDOUT: %import_ref.5: Equal = import_ref ir2, inst+16, loc_19 [template = constants.%struct.3] -// CHECK:STDOUT: %import_ref.6: NotEqual = import_ref ir2, inst+34, loc_19 [template = constants.%struct.4] +// CHECK:STDOUT: %import_ref.3: = import_ref ir2, inst+21, loaded [template = constants.%.7] +// CHECK:STDOUT: %import_ref.4: = import_ref ir2, inst+38, loaded [template = constants.%.9] +// CHECK:STDOUT: %import_ref.5: Equal = import_ref ir2, inst+16, loaded [template = constants.%struct.3] +// CHECK:STDOUT: %import_ref.6: NotEqual = import_ref ir2, inst+34, loaded [template = constants.%struct.4] // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, %Core [template = %Core] @@ -215,7 +215,7 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: @TestEqual.%b: C = bind_name b, %b.loc13_20.1 // CHECK:STDOUT: @TestEqual.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.7: type = import_ref ir2, inst+1, loc_68 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.7: type = import_ref ir2, inst+1, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.8 = import_ref ir2, inst+16, unloaded // CHECK:STDOUT: %TestNotEqual.decl: TestNotEqual = fn_decl @TestNotEqual [template = constants.%struct.6] { // CHECK:STDOUT: %C.ref.loc17_20: type = name_ref C, %C.decl [template = constants.%C] @@ -226,7 +226,7 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: @TestNotEqual.%b: C = bind_name b, %b.loc17_23.1 // CHECK:STDOUT: @TestNotEqual.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loc_88 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+34, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: @@ -343,10 +343,10 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: @TestEqual.%b: D = bind_name b, %b.loc8_20.1 // CHECK:STDOUT: @TestEqual.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_30 [template = constants.%.4] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%.4] // CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.3: = import_ref ir2, inst+21, loc_30 [template = constants.%.6] -// CHECK:STDOUT: %import_ref.4: = import_ref ir2, inst+38, loc_50 [template = constants.%.8] +// CHECK:STDOUT: %import_ref.3: = import_ref ir2, inst+21, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.4: = import_ref ir2, inst+38, loaded [template = constants.%.8] // CHECK:STDOUT: %import_ref.5 = import_ref ir2, inst+16, unloaded // CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+34, unloaded // CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+16, unloaded @@ -359,7 +359,7 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: @TestNotEqual.%b: D = bind_name b, %b.loc16_23.1 // CHECK:STDOUT: @TestNotEqual.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.8: type = import_ref ir2, inst+1, loc_50 [template = constants.%.4] +// CHECK:STDOUT: %import_ref.8: type = import_ref ir2, inst+1, loaded [template = constants.%.4] // CHECK:STDOUT: %import_ref.9 = import_ref ir2, inst+34, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: @@ -435,12 +435,12 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_23 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.3: = import_ref ir2, inst+21, loc_73 [template = constants.%.7] -// CHECK:STDOUT: %import_ref.4: = import_ref ir2, inst+38, loc_93 [template = constants.%.9] -// CHECK:STDOUT: %import_ref.5: Equal = import_ref ir2, inst+16, loc_24 [template = constants.%struct.3] -// CHECK:STDOUT: %import_ref.6: NotEqual = import_ref ir2, inst+34, loc_24 [template = constants.%struct.4] +// CHECK:STDOUT: %import_ref.3: = import_ref ir2, inst+21, loaded [template = constants.%.7] +// CHECK:STDOUT: %import_ref.4: = import_ref ir2, inst+38, loaded [template = constants.%.9] +// CHECK:STDOUT: %import_ref.5: Equal = import_ref ir2, inst+16, loaded [template = constants.%struct.3] +// CHECK:STDOUT: %import_ref.6: NotEqual = import_ref ir2, inst+34, loaded [template = constants.%struct.4] // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %C.ref.loc9: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, %Core [template = %Core] @@ -456,7 +456,7 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: @TestRhsBad.%b: D = bind_name b, %b.loc14_21.1 // CHECK:STDOUT: @TestRhsBad.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.7: type = import_ref ir2, inst+1, loc_73 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.7: type = import_ref ir2, inst+1, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.8 = import_ref ir2, inst+16, unloaded // CHECK:STDOUT: %TestLhsBad.decl: TestLhsBad = fn_decl @TestLhsBad [template = constants.%struct.6] { // CHECK:STDOUT: %D.ref.loc25: type = name_ref D, %D.decl [template = constants.%D] @@ -467,7 +467,7 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: @TestLhsBad.%b: C = bind_name b, %b.loc25_21.1 // CHECK:STDOUT: @TestLhsBad.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loc_93 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+34, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon b/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon index 116df9ae2fc8..8ff7e73a4e01 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon @@ -170,20 +170,20 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+18, loc_65 [template = constants.%.12] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+18, loaded [template = constants.%.12] // CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+13, loc_19 [template = constants.%struct.2] +// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+13, loaded [template = constants.%struct.2] // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc8: = name_ref Core, %Core [template = %Core] // CHECK:STDOUT: %Inc.decl: type = interface_decl @Inc [template = constants.%.2] {} // CHECK:STDOUT: %Inc.ref: type = name_ref Inc, %import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+20, loc_38 [template = constants.%.7] -// CHECK:STDOUT: %import_ref.6: = import_ref ir2, inst+41, loc_82 [template = constants.%.14] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+20, loaded [template = constants.%.7] +// CHECK:STDOUT: %import_ref.6: = import_ref ir2, inst+41, loaded [template = constants.%.14] // CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+22, unloaded -// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+37, loc_39 [template = constants.%struct.4] +// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+37, loaded [template = constants.%struct.4] // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc11: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc11: = name_ref Core, %Core [template = %Core] @@ -195,7 +195,7 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: %a.loc15_18.1: C = param a // CHECK:STDOUT: @TestIncNonRef.%a: C = bind_name a, %a.loc15_18.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loc_65 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+13, unloaded // CHECK:STDOUT: %TestAddAssignNonRef.decl: TestAddAssignNonRef = fn_decl @TestAddAssignNonRef [template = constants.%struct.6] { // CHECK:STDOUT: %C.ref.loc26_27: type = name_ref C, %C.decl [template = constants.%C] @@ -205,7 +205,7 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: %b.loc26_30.1: C = param b // CHECK:STDOUT: @TestAddAssignNonRef.%b: C = bind_name b, %b.loc26_30.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+20, loc_82 [template = constants.%.7] +// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+20, loaded [template = constants.%.7] // CHECK:STDOUT: %import_ref.12 = import_ref ir2, inst+37, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon b/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon index 93d27e2fa8d1..000f7cdc1042 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon @@ -256,8 +256,8 @@ fn TestRef(b: C) { // CHECK:STDOUT: %C.ref.loc8_23: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: @TestUnary.%return: ref C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_25 [template = constants.%.4] -// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+15, loc_25 [template = constants.%.6] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%.4] +// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+15, loaded [template = constants.%.6] // CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded // CHECK:STDOUT: %import_ref.4 = import_ref ir2, inst+10, unloaded // CHECK:STDOUT: %import_ref.5 = import_ref ir2, inst+10, unloaded @@ -271,8 +271,8 @@ fn TestRef(b: C) { // CHECK:STDOUT: %C.ref.loc16_30: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: @TestBinary.%return: ref C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: type = import_ref ir2, inst+17, loc_45 [template = constants.%.7] -// CHECK:STDOUT: %import_ref.7: = import_ref ir2, inst+39, loc_45 [template = constants.%.9] +// CHECK:STDOUT: %import_ref.6: type = import_ref ir2, inst+17, loaded [template = constants.%.7] +// CHECK:STDOUT: %import_ref.7: = import_ref ir2, inst+39, loaded [template = constants.%.9] // CHECK:STDOUT: %import_ref.8 = import_ref ir2, inst+19, unloaded // CHECK:STDOUT: %import_ref.9 = import_ref ir2, inst+35, unloaded // CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+35, unloaded @@ -281,13 +281,13 @@ fn TestRef(b: C) { // CHECK:STDOUT: %b.loc24_12.1: C = param b // CHECK:STDOUT: @TestRef.%b: C = bind_name b, %b.loc24_12.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+41, loc_66 [template = constants.%.10] -// CHECK:STDOUT: %import_ref.12: = import_ref ir2, inst+62, loc_66 [template = constants.%.13] +// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+41, loaded [template = constants.%.10] +// CHECK:STDOUT: %import_ref.12: = import_ref ir2, inst+62, loaded [template = constants.%.13] // CHECK:STDOUT: %import_ref.13 = import_ref ir2, inst+43, unloaded // CHECK:STDOUT: %import_ref.14 = import_ref ir2, inst+58, unloaded // CHECK:STDOUT: %import_ref.15 = import_ref ir2, inst+58, unloaded -// CHECK:STDOUT: %import_ref.16: type = import_ref ir2, inst+64, loc_69 [template = constants.%.14] -// CHECK:STDOUT: %import_ref.17: = import_ref ir2, inst+80, loc_69 [template = constants.%.17] +// CHECK:STDOUT: %import_ref.16: type = import_ref ir2, inst+64, loaded [template = constants.%.14] +// CHECK:STDOUT: %import_ref.17: = import_ref ir2, inst+80, loaded [template = constants.%.17] // CHECK:STDOUT: %import_ref.18 = import_ref ir2, inst+66, unloaded // CHECK:STDOUT: %import_ref.19 = import_ref ir2, inst+76, unloaded // CHECK:STDOUT: %import_ref.20 = import_ref ir2, inst+76, unloaded diff --git a/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon b/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon index 5c684eaec2c7..9cd51b0546d2 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon @@ -181,20 +181,20 @@ fn TestAssign(b: D) { // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_23 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+24, loc_81 [template = constants.%.11] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+24, loaded [template = constants.%.11] // CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loc_24 [template = constants.%struct.2] +// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loaded [template = constants.%struct.2] // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc9: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc9: = name_ref Core, %Core [template = %Core] // CHECK:STDOUT: %Add.decl: type = interface_decl @Add [template = constants.%.2] {} // CHECK:STDOUT: %Add.ref: type = name_ref Add, %import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+26, loc_46 [template = constants.%.5] -// CHECK:STDOUT: %import_ref.6: = import_ref ir2, inst+47, loc_102 [template = constants.%.13] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+26, loaded [template = constants.%.5] +// CHECK:STDOUT: %import_ref.6: = import_ref ir2, inst+47, loaded [template = constants.%.13] // CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+28, unloaded -// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+43, loc_47 [template = constants.%struct.4] +// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+43, loaded [template = constants.%struct.4] // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc12: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc12: = name_ref Core, %Core [template = %Core] @@ -211,14 +211,14 @@ fn TestAssign(b: D) { // CHECK:STDOUT: %C.ref.loc16_24: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: @Test.%return: ref C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loc_81 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+19, unloaded // CHECK:STDOUT: %TestAssign.decl: TestAssign = fn_decl @TestAssign [template = constants.%struct.6] { // CHECK:STDOUT: %D.ref.loc27: type = name_ref D, %D.decl [template = constants.%D] // CHECK:STDOUT: %b.loc27_15.1: D = param b // CHECK:STDOUT: @TestAssign.%b: D = bind_name b, %b.loc27_15.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+26, loc_102 [template = constants.%.5] +// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+26, loaded [template = constants.%.5] // CHECK:STDOUT: %import_ref.12 = import_ref ir2, inst+43, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/inc.carbon b/toolchain/check/testdata/operators/overloaded/inc.carbon index 9ba47ed45bfe..052ed0f28e81 100644 --- a/toolchain/check/testdata/operators/overloaded/inc.carbon +++ b/toolchain/check/testdata/operators/overloaded/inc.carbon @@ -103,10 +103,10 @@ fn TestOp() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+18, loc_47 [template = constants.%.9] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+18, loaded [template = constants.%.9] // CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+13, loc_19 [template = constants.%struct.2] +// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+13, loaded [template = constants.%struct.2] // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, %Core [template = %Core] @@ -114,7 +114,7 @@ fn TestOp() { // CHECK:STDOUT: %Inc.ref: type = name_ref Inc, %import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: TestOp = fn_decl @TestOp [template = constants.%struct.3] {} -// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+1, loc_47 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+1, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+13, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/left_shift.carbon b/toolchain/check/testdata/operators/overloaded/left_shift.carbon index a43a34a28fef..fd9c426244f3 100644 --- a/toolchain/check/testdata/operators/overloaded/left_shift.carbon +++ b/toolchain/check/testdata/operators/overloaded/left_shift.carbon @@ -167,20 +167,20 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+24, loc_82 [template = constants.%.11] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+24, loaded [template = constants.%.11] // CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loc_19 [template = constants.%struct.2] +// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loaded [template = constants.%struct.2] // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc8: = name_ref Core, %Core [template = %Core] // CHECK:STDOUT: %LeftShift.decl: type = interface_decl @LeftShift [template = constants.%.2] {} // CHECK:STDOUT: %LeftShift.ref: type = name_ref LeftShift, %import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+26, loc_46 [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6: = import_ref ir2, inst+47, loc_101 [template = constants.%.13] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+26, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.6: = import_ref ir2, inst+47, loaded [template = constants.%.13] // CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+28, unloaded -// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+43, loc_47 [template = constants.%struct.5] +// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+43, loaded [template = constants.%struct.5] // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc13: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc13: = name_ref Core, %Core [template = %Core] @@ -197,7 +197,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %C.ref.loc17_26: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: @TestOp.%return: ref C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loc_82 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+19, unloaded // CHECK:STDOUT: %TestAssign.decl: TestAssign = fn_decl @TestAssign [template = constants.%struct.7] { // CHECK:STDOUT: %C.ref.loc21_18: type = name_ref C, %C.decl [template = constants.%C] @@ -208,7 +208,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %b.loc21_22.1: C = param b // CHECK:STDOUT: @TestAssign.%b: C = bind_name b, %b.loc21_22.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+26, loc_101 [template = constants.%.6] +// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+26, loaded [template = constants.%.6] // CHECK:STDOUT: %import_ref.12 = import_ref ir2, inst+43, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/mod.carbon b/toolchain/check/testdata/operators/overloaded/mod.carbon index e02b3c1f643c..b8f77f96991d 100644 --- a/toolchain/check/testdata/operators/overloaded/mod.carbon +++ b/toolchain/check/testdata/operators/overloaded/mod.carbon @@ -167,20 +167,20 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+24, loc_82 [template = constants.%.11] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+24, loaded [template = constants.%.11] // CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loc_19 [template = constants.%struct.2] +// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loaded [template = constants.%struct.2] // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc8: = name_ref Core, %Core [template = %Core] // CHECK:STDOUT: %Mod.decl: type = interface_decl @Mod [template = constants.%.2] {} // CHECK:STDOUT: %Mod.ref: type = name_ref Mod, %import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+26, loc_46 [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6: = import_ref ir2, inst+47, loc_101 [template = constants.%.13] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+26, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.6: = import_ref ir2, inst+47, loaded [template = constants.%.13] // CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+28, unloaded -// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+43, loc_47 [template = constants.%struct.5] +// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+43, loaded [template = constants.%struct.5] // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc13: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc13: = name_ref Core, %Core [template = %Core] @@ -197,7 +197,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %C.ref.loc17_26: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: @TestOp.%return: ref C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loc_82 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+19, unloaded // CHECK:STDOUT: %TestAssign.decl: TestAssign = fn_decl @TestAssign [template = constants.%struct.7] { // CHECK:STDOUT: %C.ref.loc21_18: type = name_ref C, %C.decl [template = constants.%C] @@ -208,7 +208,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %b.loc21_22.1: C = param b // CHECK:STDOUT: @TestAssign.%b: C = bind_name b, %b.loc21_22.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+26, loc_101 [template = constants.%.6] +// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+26, loaded [template = constants.%.6] // CHECK:STDOUT: %import_ref.12 = import_ref ir2, inst+43, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/mul.carbon b/toolchain/check/testdata/operators/overloaded/mul.carbon index 3e7adcb94009..fea3da7cadb1 100644 --- a/toolchain/check/testdata/operators/overloaded/mul.carbon +++ b/toolchain/check/testdata/operators/overloaded/mul.carbon @@ -167,20 +167,20 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+24, loc_82 [template = constants.%.11] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+24, loaded [template = constants.%.11] // CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loc_19 [template = constants.%struct.2] +// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loaded [template = constants.%struct.2] // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc8: = name_ref Core, %Core [template = %Core] // CHECK:STDOUT: %Mul.decl: type = interface_decl @Mul [template = constants.%.2] {} // CHECK:STDOUT: %Mul.ref: type = name_ref Mul, %import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+26, loc_46 [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6: = import_ref ir2, inst+47, loc_101 [template = constants.%.13] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+26, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.6: = import_ref ir2, inst+47, loaded [template = constants.%.13] // CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+28, unloaded -// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+43, loc_47 [template = constants.%struct.5] +// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+43, loaded [template = constants.%struct.5] // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc13: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc13: = name_ref Core, %Core [template = %Core] @@ -197,7 +197,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %C.ref.loc17_26: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: @TestOp.%return: ref C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loc_82 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+19, unloaded // CHECK:STDOUT: %TestAssign.decl: TestAssign = fn_decl @TestAssign [template = constants.%struct.7] { // CHECK:STDOUT: %C.ref.loc21_18: type = name_ref C, %C.decl [template = constants.%C] @@ -208,7 +208,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %b.loc21_22.1: C = param b // CHECK:STDOUT: @TestAssign.%b: C = bind_name b, %b.loc21_22.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+26, loc_101 [template = constants.%.6] +// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+26, loaded [template = constants.%.6] // CHECK:STDOUT: %import_ref.12 = import_ref ir2, inst+43, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/negate.carbon b/toolchain/check/testdata/operators/overloaded/negate.carbon index 531c058ac1eb..52f24220f62c 100644 --- a/toolchain/check/testdata/operators/overloaded/negate.carbon +++ b/toolchain/check/testdata/operators/overloaded/negate.carbon @@ -103,10 +103,10 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+19, loc_50 [template = constants.%.7] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+19, loaded [template = constants.%.7] // CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+14, loc_19 [template = constants.%struct.2] +// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+14, loaded [template = constants.%struct.2] // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, %Core [template = %Core] @@ -120,7 +120,7 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: %C.ref.loc14_20: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: @TestOp.%return: ref C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+1, loc_50 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+1, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+14, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/ordered.carbon b/toolchain/check/testdata/operators/overloaded/ordered.carbon index 471dae4017b0..e6b6808063ec 100644 --- a/toolchain/check/testdata/operators/overloaded/ordered.carbon +++ b/toolchain/check/testdata/operators/overloaded/ordered.carbon @@ -250,16 +250,16 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+72, loc_158 [template = constants.%.13] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+72, loaded [template = constants.%.13] // CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: = import_ref ir2, inst+55, loc_138 [template = constants.%.11] -// CHECK:STDOUT: %import_ref.5: = import_ref ir2, inst+21, loc_98 [template = constants.%.7] -// CHECK:STDOUT: %import_ref.6: = import_ref ir2, inst+38, loc_118 [template = constants.%.9] -// CHECK:STDOUT: %import_ref.7: Less = import_ref ir2, inst+16, loc_19 [template = constants.%struct.5] -// CHECK:STDOUT: %import_ref.8: LessOrEquivalent = import_ref ir2, inst+34, loc_19 [template = constants.%struct.6] -// CHECK:STDOUT: %import_ref.9: Greater = import_ref ir2, inst+51, loc_19 [template = constants.%struct.7] -// CHECK:STDOUT: %import_ref.10: GreaterOrEquivalent = import_ref ir2, inst+68, loc_19 [template = constants.%struct.8] +// CHECK:STDOUT: %import_ref.4: = import_ref ir2, inst+55, loaded [template = constants.%.11] +// CHECK:STDOUT: %import_ref.5: = import_ref ir2, inst+21, loaded [template = constants.%.7] +// CHECK:STDOUT: %import_ref.6: = import_ref ir2, inst+38, loaded [template = constants.%.9] +// CHECK:STDOUT: %import_ref.7: Less = import_ref ir2, inst+16, loaded [template = constants.%struct.5] +// CHECK:STDOUT: %import_ref.8: LessOrEquivalent = import_ref ir2, inst+34, loaded [template = constants.%struct.6] +// CHECK:STDOUT: %import_ref.9: Greater = import_ref ir2, inst+51, loaded [template = constants.%struct.7] +// CHECK:STDOUT: %import_ref.10: GreaterOrEquivalent = import_ref ir2, inst+68, loaded [template = constants.%struct.8] // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, %Core [template = %Core] @@ -275,7 +275,7 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: @TestLess.%b: C = bind_name b, %b.loc15_19.1 // CHECK:STDOUT: @TestLess.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+1, loc_98 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+1, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.12 = import_ref ir2, inst+16, unloaded // CHECK:STDOUT: %TestLessEqual.decl: TestLessEqual = fn_decl @TestLessEqual [template = constants.%struct.10] { // CHECK:STDOUT: %C.ref.loc19_21: type = name_ref C, %C.decl [template = constants.%C] @@ -286,7 +286,7 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: @TestLessEqual.%b: C = bind_name b, %b.loc19_24.1 // CHECK:STDOUT: @TestLessEqual.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.13: type = import_ref ir2, inst+1, loc_118 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.13: type = import_ref ir2, inst+1, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.14 = import_ref ir2, inst+34, unloaded // CHECK:STDOUT: %TestGreater.decl: TestGreater = fn_decl @TestGreater [template = constants.%struct.11] { // CHECK:STDOUT: %C.ref.loc23_19: type = name_ref C, %C.decl [template = constants.%C] @@ -297,7 +297,7 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: @TestGreater.%b: C = bind_name b, %b.loc23_22.1 // CHECK:STDOUT: @TestGreater.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.15: type = import_ref ir2, inst+1, loc_138 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.15: type = import_ref ir2, inst+1, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.16 = import_ref ir2, inst+51, unloaded // CHECK:STDOUT: %TestGreaterEqual.decl: TestGreaterEqual = fn_decl @TestGreaterEqual [template = constants.%struct.12] { // CHECK:STDOUT: %C.ref.loc27_24: type = name_ref C, %C.decl [template = constants.%C] @@ -308,7 +308,7 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: @TestGreaterEqual.%b: C = bind_name b, %b.loc27_27.1 // CHECK:STDOUT: @TestGreaterEqual.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.17: type = import_ref ir2, inst+1, loc_158 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.17: type = import_ref ir2, inst+1, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.18 = import_ref ir2, inst+68, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: @@ -493,12 +493,12 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: @TestLess.%b: D = bind_name b, %b.loc8_19.1 // CHECK:STDOUT: @TestLess.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_30 [template = constants.%.4] -// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+72, loc_90 [template = constants.%.12] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%.4] +// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+72, loaded [template = constants.%.12] // CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: = import_ref ir2, inst+55, loc_70 [template = constants.%.10] -// CHECK:STDOUT: %import_ref.5: = import_ref ir2, inst+21, loc_30 [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6: = import_ref ir2, inst+38, loc_50 [template = constants.%.8] +// CHECK:STDOUT: %import_ref.4: = import_ref ir2, inst+55, loaded [template = constants.%.10] +// CHECK:STDOUT: %import_ref.5: = import_ref ir2, inst+21, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.6: = import_ref ir2, inst+38, loaded [template = constants.%.8] // CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+16, unloaded // CHECK:STDOUT: %import_ref.8 = import_ref ir2, inst+34, unloaded // CHECK:STDOUT: %import_ref.9 = import_ref ir2, inst+51, unloaded @@ -513,7 +513,7 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: @TestLessEqual.%b: D = bind_name b, %b.loc16_24.1 // CHECK:STDOUT: @TestLessEqual.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.12: type = import_ref ir2, inst+1, loc_50 [template = constants.%.4] +// CHECK:STDOUT: %import_ref.12: type = import_ref ir2, inst+1, loaded [template = constants.%.4] // CHECK:STDOUT: %import_ref.13 = import_ref ir2, inst+34, unloaded // CHECK:STDOUT: %TestGreater.decl: TestGreater = fn_decl @TestGreater [template = constants.%struct.5] { // CHECK:STDOUT: %D.ref.loc24_19: type = name_ref D, %D.decl [template = constants.%D] @@ -524,7 +524,7 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: @TestGreater.%b: D = bind_name b, %b.loc24_22.1 // CHECK:STDOUT: @TestGreater.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.14: type = import_ref ir2, inst+1, loc_70 [template = constants.%.4] +// CHECK:STDOUT: %import_ref.14: type = import_ref ir2, inst+1, loaded [template = constants.%.4] // CHECK:STDOUT: %import_ref.15 = import_ref ir2, inst+51, unloaded // CHECK:STDOUT: %TestGreaterEqual.decl: TestGreaterEqual = fn_decl @TestGreaterEqual [template = constants.%struct.7] { // CHECK:STDOUT: %D.ref.loc32_24: type = name_ref D, %D.decl [template = constants.%D] @@ -535,7 +535,7 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: @TestGreaterEqual.%b: D = bind_name b, %b.loc32_27.1 // CHECK:STDOUT: @TestGreaterEqual.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.16: type = import_ref ir2, inst+1, loc_90 [template = constants.%.4] +// CHECK:STDOUT: %import_ref.16: type = import_ref ir2, inst+1, loaded [template = constants.%.4] // CHECK:STDOUT: %import_ref.17 = import_ref ir2, inst+68, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/right_shift.carbon b/toolchain/check/testdata/operators/overloaded/right_shift.carbon index 2f0a5c6f43ac..305fffde0a34 100644 --- a/toolchain/check/testdata/operators/overloaded/right_shift.carbon +++ b/toolchain/check/testdata/operators/overloaded/right_shift.carbon @@ -167,20 +167,20 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+24, loc_82 [template = constants.%.11] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+24, loaded [template = constants.%.11] // CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loc_19 [template = constants.%struct.2] +// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loaded [template = constants.%struct.2] // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc8: = name_ref Core, %Core [template = %Core] // CHECK:STDOUT: %RightShift.decl: type = interface_decl @RightShift [template = constants.%.2] {} // CHECK:STDOUT: %RightShift.ref: type = name_ref RightShift, %import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+26, loc_46 [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6: = import_ref ir2, inst+47, loc_101 [template = constants.%.13] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+26, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.6: = import_ref ir2, inst+47, loaded [template = constants.%.13] // CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+28, unloaded -// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+43, loc_47 [template = constants.%struct.5] +// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+43, loaded [template = constants.%struct.5] // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc13: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc13: = name_ref Core, %Core [template = %Core] @@ -197,7 +197,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %C.ref.loc17_26: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: @TestOp.%return: ref C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loc_82 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+19, unloaded // CHECK:STDOUT: %TestAssign.decl: TestAssign = fn_decl @TestAssign [template = constants.%struct.7] { // CHECK:STDOUT: %C.ref.loc21_18: type = name_ref C, %C.decl [template = constants.%C] @@ -208,7 +208,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %b.loc21_22.1: C = param b // CHECK:STDOUT: @TestAssign.%b: C = bind_name b, %b.loc21_22.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+26, loc_101 [template = constants.%.6] +// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+26, loaded [template = constants.%.6] // CHECK:STDOUT: %import_ref.12 = import_ref ir2, inst+43, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/sub.carbon b/toolchain/check/testdata/operators/overloaded/sub.carbon index 8e790f45e89f..1ab0f622d61e 100644 --- a/toolchain/check/testdata/operators/overloaded/sub.carbon +++ b/toolchain/check/testdata/operators/overloaded/sub.carbon @@ -167,20 +167,20 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+24, loc_82 [template = constants.%.11] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+24, loaded [template = constants.%.11] // CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loc_19 [template = constants.%struct.2] +// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loaded [template = constants.%struct.2] // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc8: = name_ref Core, %Core [template = %Core] // CHECK:STDOUT: %Sub.decl: type = interface_decl @Sub [template = constants.%.2] {} // CHECK:STDOUT: %Sub.ref: type = name_ref Sub, %import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+26, loc_46 [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6: = import_ref ir2, inst+47, loc_101 [template = constants.%.13] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+26, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.6: = import_ref ir2, inst+47, loaded [template = constants.%.13] // CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+28, unloaded -// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+43, loc_47 [template = constants.%struct.5] +// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+43, loaded [template = constants.%struct.5] // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc13: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc13: = name_ref Core, %Core [template = %Core] @@ -197,7 +197,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %C.ref.loc17_26: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: @TestOp.%return: ref C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loc_82 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+19, unloaded // CHECK:STDOUT: %TestAssign.decl: TestAssign = fn_decl @TestAssign [template = constants.%struct.7] { // CHECK:STDOUT: %C.ref.loc21_18: type = name_ref C, %C.decl [template = constants.%C] @@ -208,7 +208,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %b.loc21_22.1: C = param b // CHECK:STDOUT: @TestAssign.%b: C = bind_name b, %b.loc21_22.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+26, loc_101 [template = constants.%.6] +// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+26, loaded [template = constants.%.6] // CHECK:STDOUT: %import_ref.12 = import_ref ir2, inst+43, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/packages/cross_package_import.carbon b/toolchain/check/testdata/packages/cross_package_import.carbon index 9f85370edd6d..f4b83bfaa801 100644 --- a/toolchain/check/testdata/packages/cross_package_import.carbon +++ b/toolchain/check/testdata/packages/cross_package_import.carbon @@ -296,8 +296,8 @@ fn Other.G() {} // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Other: = namespace [template] {} // CHECK:STDOUT: %Run.decl: Run = fn_decl @Run [template = constants.%struct.1] {} -// CHECK:STDOUT: %import_ref.1: F = import_ref ir2, inst+2, loc_22 [template = constants.%struct.2] -// CHECK:STDOUT: %import_ref.2: F2 = import_ref ir3, inst+2, loc_28 [template = constants.%struct.3] +// CHECK:STDOUT: %import_ref.1: F = import_ref ir2, inst+2, loaded [template = constants.%struct.2] +// CHECK:STDOUT: %import_ref.2: F2 = import_ref ir3, inst+2, loaded [template = constants.%struct.3] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { @@ -334,7 +334,7 @@ fn Other.G() {} // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Other: = namespace [template] {} // CHECK:STDOUT: %Run.decl: Run = fn_decl @Run [template = constants.%struct.1] {} -// CHECK:STDOUT: %import_ref.1: F = import_ref ir2, inst+2, loc_22 [template = constants.%struct.2] +// CHECK:STDOUT: %import_ref.1: F = import_ref ir2, inst+2, loaded [template = constants.%struct.2] // CHECK:STDOUT: %import_ref.2 = import_ref ir3, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: @@ -378,7 +378,7 @@ fn Other.G() {} // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Other: = namespace [template] {} // CHECK:STDOUT: %Run.decl: Run = fn_decl @Run [template = constants.%struct.1] {} -// CHECK:STDOUT: %import_ref.1: F = import_ref ir2, inst+2, loc_22 [template = constants.%struct.2] +// CHECK:STDOUT: %import_ref.1: F = import_ref ir2, inst+2, loaded [template = constants.%struct.2] // CHECK:STDOUT: %import_ref.2 = import_ref ir3, inst+4, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/packages/fail_import_type_error.carbon b/toolchain/check/testdata/packages/fail_import_type_error.carbon index 3d79c7e52240..5436578e64ce 100644 --- a/toolchain/check/testdata/packages/fail_import_type_error.carbon +++ b/toolchain/check/testdata/packages/fail_import_type_error.carbon @@ -81,10 +81,10 @@ var d: i32 = d_ref; // CHECK:STDOUT: .c = %c // CHECK:STDOUT: .d = %d // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: ref = import_ref ir0, inst+4, loc_10 -// CHECK:STDOUT: %import_ref.2: ref = import_ref ir0, inst+9, loc_17 -// CHECK:STDOUT: %import_ref.3: ref = import_ref ir0, inst+13, loc_24 -// CHECK:STDOUT: %import_ref.4: ref = import_ref ir0, inst+17, loc_31 +// CHECK:STDOUT: %import_ref.1: ref = import_ref ir0, inst+4, loaded +// CHECK:STDOUT: %import_ref.2: ref = import_ref ir0, inst+9, loaded +// CHECK:STDOUT: %import_ref.3: ref = import_ref ir0, inst+13, loaded +// CHECK:STDOUT: %import_ref.4: ref = import_ref ir0, inst+17, loaded // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %a.var: ref i32 = var a // CHECK:STDOUT: %a: ref i32 = bind_name a, %a.var diff --git a/toolchain/check/testdata/packages/loaded_global.carbon b/toolchain/check/testdata/packages/loaded_global.carbon index e1b50cc9517a..14595574d7a6 100644 --- a/toolchain/check/testdata/packages/loaded_global.carbon +++ b/toolchain/check/testdata/packages/loaded_global.carbon @@ -68,7 +68,7 @@ var package_b: () = package.B(); // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .package_a = %package_a // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: A = import_ref ir0, inst+2, loc_11 [template = constants.%struct] +// CHECK:STDOUT: %import_ref: A = import_ref ir0, inst+2, loaded [template = constants.%struct] // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc4_9.1: () = tuple_literal () // CHECK:STDOUT: %.loc4_9.2: type = converted %.loc4_9.1, constants.%.1 [template = constants.%.1] @@ -128,7 +128,7 @@ var package_b: () = package.B(); // CHECK:STDOUT: .b = %b // CHECK:STDOUT: .package_b = %package_b // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: B = import_ref ir1, inst+2, loc_17 [template = constants.%struct] +// CHECK:STDOUT: %import_ref: B = import_ref ir1, inst+2, loaded [template = constants.%struct] // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc6_9.1: () = tuple_literal () // CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%.1 [template = constants.%.1] diff --git a/toolchain/check/testdata/pointer/import.carbon b/toolchain/check/testdata/pointer/import.carbon index f08257f3d319..8a569be649da 100644 --- a/toolchain/check/testdata/pointer/import.carbon +++ b/toolchain/check/testdata/pointer/import.carbon @@ -62,7 +62,7 @@ var a: i32* = a_ref; // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1 = import_ref ir0, inst+3, unloaded -// CHECK:STDOUT: %import_ref.2: ref i32* = import_ref ir0, inst+10, loc_11 +// CHECK:STDOUT: %import_ref.2: ref i32* = import_ref ir0, inst+10, loaded // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc4: type = ptr_type i32 [template = constants.%.1] // CHECK:STDOUT: %a.var: ref i32* = var a diff --git a/toolchain/check/testdata/struct/import.carbon b/toolchain/check/testdata/struct/import.carbon index a5f4fe25ea69..014244f0c3b3 100644 --- a/toolchain/check/testdata/struct/import.carbon +++ b/toolchain/check/testdata/struct/import.carbon @@ -106,8 +106,8 @@ var b: {.a: {.b: i32, .c: (i32,)}, .d: i32} = b_ref; // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: ref {.a: i32} = import_ref ir0, inst+7, loc_15 -// CHECK:STDOUT: %import_ref.2: ref {.a: {.b: i32, .c: (i32,)}, .d: i32} = import_ref ir0, inst+38, loc_45 +// CHECK:STDOUT: %import_ref.1: ref {.a: i32} = import_ref ir0, inst+7, loaded +// CHECK:STDOUT: %import_ref.2: ref {.a: {.b: i32, .c: (i32,)}, .d: i32} = import_ref ir0, inst+38, loaded // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc4: type = struct_type {.a: i32} [template = constants.%.1] // CHECK:STDOUT: %a.var: ref {.a: i32} = var a diff --git a/toolchain/check/testdata/tuples/import.carbon b/toolchain/check/testdata/tuples/import.carbon index 007bbe4bbce5..145ce1cb76f9 100644 --- a/toolchain/check/testdata/tuples/import.carbon +++ b/toolchain/check/testdata/tuples/import.carbon @@ -128,8 +128,8 @@ var b: (((i32,), i32), (i32, i32)) = b_ref; // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: ref (i32,) = import_ref ir0, inst+7, loc_13 -// CHECK:STDOUT: %import_ref.2: ref (((i32,), i32), (i32, i32)) = import_ref ir0, inst+35, loc_35 +// CHECK:STDOUT: %import_ref.1: ref (i32,) = import_ref ir0, inst+7, loaded +// CHECK:STDOUT: %import_ref.2: ref (((i32,), i32), (i32, i32)) = import_ref ir0, inst+35, loaded // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc4_13.1: (type,) = tuple_literal (i32) // CHECK:STDOUT: %.loc4_13.2: type = converted %.loc4_13.1, constants.%.2 [template = constants.%.2] diff --git a/toolchain/check/testdata/var/no_prelude/import.carbon b/toolchain/check/testdata/var/no_prelude/import.carbon index e9933dc54174..d24b987d099c 100644 --- a/toolchain/check/testdata/var/no_prelude/import.carbon +++ b/toolchain/check/testdata/var/no_prelude/import.carbon @@ -54,7 +54,7 @@ var a: () = a_ref; // CHECK:STDOUT: .a_ref = %import_ref // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: ref () = import_ref ir0, inst+5, loc_11 +// CHECK:STDOUT: %import_ref: ref () = import_ref ir0, inst+5, loaded // CHECK:STDOUT: %.loc4_9.1: () = tuple_literal () // CHECK:STDOUT: %.loc4_9.2: type = converted %.loc4_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %a.var: ref () = var a diff --git a/toolchain/diagnostics/diagnostic_kind.def b/toolchain/diagnostics/diagnostic_kind.def index bad0c5cdd0a7..8e8260828763 100644 --- a/toolchain/diagnostics/diagnostic_kind.def +++ b/toolchain/diagnostics/diagnostic_kind.def @@ -148,10 +148,8 @@ CARBON_DIAGNOSTIC_KIND(ImportSelf) CARBON_DIAGNOSTIC_KIND(ExplicitImportApi) CARBON_DIAGNOSTIC_KIND(RepeatedImport) CARBON_DIAGNOSTIC_KIND(FirstImported) -CARBON_DIAGNOSTIC_KIND(UsedImportLoc) // Merge-related redeclaration checking. -CARBON_DIAGNOSTIC_KIND(RedeclOfUsedImport) CARBON_DIAGNOSTIC_KIND(RedeclPrevDecl) CARBON_DIAGNOSTIC_KIND(RedeclRedundant) CARBON_DIAGNOSTIC_KIND(RedeclNonExtern) diff --git a/toolchain/lower/handle.cpp b/toolchain/lower/handle.cpp index 5e78d9aaacdd..fe1af484a31f 100644 --- a/toolchain/lower/handle.cpp +++ b/toolchain/lower/handle.cpp @@ -492,12 +492,6 @@ auto HandleImportRefLoaded(FunctionContext& /*context*/, FatalErrorIfEncountered(inst); } -auto HandleImportRefUsed(FunctionContext& /*context*/, - SemIR::InstId /*inst_id*/, SemIR::ImportRefUsed inst) - -> void { - FatalErrorIfEncountered(inst); -} - auto HandleInitializeFrom(FunctionContext& context, SemIR::InstId /*inst_id*/, SemIR::InitializeFrom inst) -> void { auto storage_type_id = context.sem_ir().insts().Get(inst.dest_id).type_id(); diff --git a/toolchain/sem_ir/file.cpp b/toolchain/sem_ir/file.cpp index b35408eca31b..f94bf8ff1e88 100644 --- a/toolchain/sem_ir/file.cpp +++ b/toolchain/sem_ir/file.cpp @@ -438,7 +438,6 @@ static auto StringifyTypeExprImpl(const SemIR::File& outer_sem_ir, case ImplDecl::Kind: case ImportRefLoaded::Kind: case ImportRefUnloaded::Kind: - case ImportRefUsed::Kind: case InitializeFrom::Kind: case InterfaceDecl::Kind: case InterfaceWitness::Kind: @@ -511,10 +510,8 @@ auto GetExprCategory(const File& file, InstId inst_id) -> ExprCategory { case StructTypeField::Kind: return ExprCategory::NotExpr; - case ImportRefLoaded::Kind: - case ImportRefUsed::Kind: { - auto import_ir_inst = ir->import_ir_insts().Get( - untyped_inst.As().import_ir_inst_id); + case CARBON_KIND(ImportRefLoaded inst): { + auto import_ir_inst = ir->import_ir_insts().Get(inst.import_ir_inst_id); ir = ir->import_irs().Get(import_ir_inst.ir_id).sem_ir; inst_id = import_ir_inst.inst_id; continue; diff --git a/toolchain/sem_ir/formatter.cpp b/toolchain/sem_ir/formatter.cpp index 8dc28ed34a32..16029d593431 100644 --- a/toolchain/sem_ir/formatter.cpp +++ b/toolchain/sem_ir/formatter.cpp @@ -637,10 +637,6 @@ class Formatter { out_ << ", loaded"; } - auto FormatInstructionRHS(ImportRefUsed inst) -> void { - FormatArgs(inst.import_ir_inst_id, inst.used_id); - } - auto FormatInstructionRHS(SpliceBlock inst) -> void { FormatArgs(inst.result_id); FormatTrailingBlock(inst.block_id); diff --git a/toolchain/sem_ir/ids.h b/toolchain/sem_ir/ids.h index a43b367c42e5..8a087b9cb4dd 100644 --- a/toolchain/sem_ir/ids.h +++ b/toolchain/sem_ir/ids.h @@ -43,7 +43,7 @@ struct InstId : public IdBase, public Printable { static const InstId PackageNamespace; // Returns the instruction ID for a builtin. This relies on File guarantees - // for builtin ImportRefUsed placement. + // for builtin placement. static constexpr auto ForBuiltin(BuiltinKind kind) -> InstId { return InstId(kind.AsInt()); } diff --git a/toolchain/sem_ir/inst_kind.def b/toolchain/sem_ir/inst_kind.def index e13b55bf2ac0..0e6da295efeb 100644 --- a/toolchain/sem_ir/inst_kind.def +++ b/toolchain/sem_ir/inst_kind.def @@ -113,7 +113,6 @@ CARBON_SEM_IR_INST_KIND_IMPL(FunctionType, TYPE_ALWAYS, CONSTANT_CONDITIONAL) CARBON_SEM_IR_INST_KIND_IMPL(ImplDecl, TYPE_NEVER, CONSTANT_NEVER) CARBON_SEM_IR_INST_KIND_IMPL(ImportRefUnloaded, TYPE_NEVER, CONSTANT_NEVER) CARBON_SEM_IR_INST_KIND_IMPL(ImportRefLoaded, TYPE_NEVER, CONSTANT_NEVER) -CARBON_SEM_IR_INST_KIND_IMPL(ImportRefUsed, TYPE_NEVER, CONSTANT_NEVER) CARBON_SEM_IR_INST_KIND_IMPL(InitializeFrom, TYPE_NEVER, CONSTANT_NEVER) CARBON_SEM_IR_INST_KIND_IMPL(InterfaceDecl, TYPE_NEVER, CONSTANT_NEVER) CARBON_SEM_IR_INST_KIND_IMPL(InterfaceType, TYPE_ALWAYS, CONSTANT_CONDITIONAL) diff --git a/toolchain/sem_ir/inst_namer.cpp b/toolchain/sem_ir/inst_namer.cpp index ea3e18183a39..fa310aead61d 100644 --- a/toolchain/sem_ir/inst_namer.cpp +++ b/toolchain/sem_ir/inst_namer.cpp @@ -440,8 +440,7 @@ auto InstNamer::CollectNamesInBlock(ScopeId scope_id, break; } case ImportRefUnloaded::Kind: - case ImportRefLoaded::Kind: - case ImportRefUsed::Kind: { + case ImportRefLoaded::Kind: { add_inst_name("import_ref"); // When building import refs, we frequently add instructions without // a block. Constants that refer to them need to be separately diff --git a/toolchain/sem_ir/typed_insts.h b/toolchain/sem_ir/typed_insts.h index 4cae44b2c5b2..1aa8062a3c3f 100644 --- a/toolchain/sem_ir/typed_insts.h +++ b/toolchain/sem_ir/typed_insts.h @@ -506,8 +506,7 @@ struct ImplDecl { // Common representation for all kinds of `ImportRef*` node. struct AnyImportRef { static constexpr InstKind Kinds[] = {InstKind::ImportRefUnloaded, - InstKind::ImportRefLoaded, - InstKind::ImportRefUsed}; + InstKind::ImportRefLoaded}; InstKind kind; ImportIRInstId import_ir_inst_id; @@ -522,7 +521,7 @@ struct ImportRefUnloaded { ImportIRInstId import_ir_inst_id; }; -// A imported entity that is loaded, but has not yet had a use associated. +// A imported entity that is loaded, and may be used. struct ImportRefLoaded { // No parse node: any parse node logic must use the referenced IR. static constexpr auto Kind = @@ -532,18 +531,6 @@ struct ImportRefLoaded { ImportIRInstId import_ir_inst_id; }; -// An imported entity that has a reference, and thus should be emitted. -struct ImportRefUsed { - // No parse node: any parse node logic must use the referenced IR. - static constexpr auto Kind = - InstKind::ImportRefUsed.Define("import_ref"); - - TypeId type_id; - ImportIRInstId import_ir_inst_id; - // A location to reference for queries about the use. - LocId used_id; -}; - // Finalizes the initialization of `dest_id` from the initializer expression // `src_id`, by performing a final copy from source to destination, for types // whose initialization is not in-place.