diff --git a/toolchain/base/value_store.h b/toolchain/base/value_store.h index 7ce017c054eb..687af9388494 100644 --- a/toolchain/base/value_store.h +++ b/toolchain/base/value_store.h @@ -85,6 +85,9 @@ struct StringId : public IndexBase, public Printable { constexpr StringId StringId::Invalid(StringId::InvalidIndex); // Adapts StringId for identifiers. +// +// `NameId` relies on the values of this type other than `Invalid` all being +// non-negative. struct IdentifierId : public IndexBase, public Printable { static const IdentifierId Invalid; using IndexBase::IndexBase; diff --git a/toolchain/check/context.cpp b/toolchain/check/context.cpp index a77027383f07..e52b7c59c59f 100644 --- a/toolchain/check/context.cpp +++ b/toolchain/check/context.cpp @@ -88,11 +88,11 @@ auto Context::DiagnoseDuplicateName(Parse::Node parse_node, .Emit(); } -auto Context::DiagnoseNameNotFound(Parse::Node parse_node, IdentifierId name_id) - -> void { +auto Context::DiagnoseNameNotFound(Parse::Node parse_node, + SemIR::NameId name_id) -> void { CARBON_DIAGNOSTIC(NameNotFound, Error, "Name `{0}` not found.", llvm::StringRef); - emitter_->Emit(parse_node, NameNotFound, identifiers().Get(name_id)); + emitter_->Emit(parse_node, NameNotFound, names().GetFormatted(name_id)); } auto Context::NoteIncompleteClass(SemIR::ClassId class_id, @@ -112,7 +112,7 @@ auto Context::NoteIncompleteClass(SemIR::ClassId class_id, } } -auto Context::AddNameToLookup(Parse::Node name_node, IdentifierId name_id, +auto Context::AddNameToLookup(Parse::Node name_node, SemIR::NameId name_id, SemIR::InstId target_id) -> void { if (current_scope().names.insert(name_id).second) { // TODO: Reject if we previously performed a failed lookup for this name in @@ -129,7 +129,7 @@ auto Context::AddNameToLookup(Parse::Node name_node, IdentifierId name_id, } auto Context::LookupNameInDeclaration(Parse::Node parse_node, - IdentifierId name_id, + SemIR::NameId name_id, SemIR::NameScopeId scope_id) -> SemIR::InstId { if (scope_id == SemIR::NameScopeId::Invalid) { @@ -159,7 +159,7 @@ auto Context::LookupNameInDeclaration(Parse::Node parse_node, if (auto name_it = name_lookup_.find(name_id); name_it != name_lookup_.end()) { CARBON_CHECK(!name_it->second.empty()) - << "Should have been erased: " << identifiers().Get(name_id); + << "Should have been erased: " << names().GetFormatted(name_id); auto result = name_it->second.back(); if (result.scope_index == current_scope_index()) { return result.node_id; @@ -175,7 +175,7 @@ auto Context::LookupNameInDeclaration(Parse::Node parse_node, } auto Context::LookupUnqualifiedName(Parse::Node parse_node, - IdentifierId name_id) -> SemIR::InstId { + SemIR::NameId name_id) -> SemIR::InstId { // TODO: Check for shadowed lookup results. // Find the results from enclosing lexical scopes. These will be combined with @@ -185,7 +185,7 @@ auto Context::LookupUnqualifiedName(Parse::Node parse_node, name_it != name_lookup_.end()) { lexical_results = name_it->second; CARBON_CHECK(!lexical_results.empty()) - << "Should have been erased: " << identifiers().Get(name_id); + << "Should have been erased: " << names().GetFormatted(name_id); } // Walk the non-lexical scopes and perform lookups into each of them. @@ -214,7 +214,7 @@ auto Context::LookupUnqualifiedName(Parse::Node parse_node, return SemIR::InstId::BuiltinError; } -auto Context::LookupQualifiedName(Parse::Node parse_node, IdentifierId name_id, +auto Context::LookupQualifiedName(Parse::Node parse_node, SemIR::NameId name_id, SemIR::NameScopeId scope_id, bool required) -> SemIR::InstId { CARBON_CHECK(scope_id.is_valid()) << "No scope to perform lookup into"; @@ -252,7 +252,7 @@ auto Context::PopScope() -> void { for (const auto& str_id : scope.names) { auto it = name_lookup_.find(str_id); CARBON_CHECK(it->second.back().scope_index == scope.index) - << "Inconsistent scope index for name " << identifiers().Get(str_id); + << "Inconsistent scope index for name " << names().GetFormatted(str_id); if (it->second.size() == 1) { // Erase names that no longer resolve. name_lookup_.erase(it); diff --git a/toolchain/check/context.h b/toolchain/check/context.h index 35c644e203e8..65579073e22f 100644 --- a/toolchain/check/context.h +++ b/toolchain/check/context.h @@ -52,22 +52,22 @@ class Context { auto AddInstAndPush(Parse::Node parse_node, SemIR::Inst inst) -> void; // Adds a name to name lookup. Prints a diagnostic for name conflicts. - auto AddNameToLookup(Parse::Node name_node, IdentifierId name_id, + auto AddNameToLookup(Parse::Node name_node, SemIR::NameId name_id, SemIR::InstId target_id) -> void; // Performs name lookup in a specified scope for a name appearing in a // declaration, returning the referenced instruction. If scope_id is invalid, // uses the current contextual scope. - auto LookupNameInDeclaration(Parse::Node parse_node, IdentifierId name_id, + auto LookupNameInDeclaration(Parse::Node parse_node, SemIR::NameId name_id, SemIR::NameScopeId scope_id) -> SemIR::InstId; // Performs an unqualified name lookup, returning the referenced instruction. - auto LookupUnqualifiedName(Parse::Node parse_node, IdentifierId name_id) + auto LookupUnqualifiedName(Parse::Node parse_node, SemIR::NameId name_id) -> SemIR::InstId; // Performs a qualified name lookup in a specified scope and in scopes that // it extends, returning the referenced instruction. - auto LookupQualifiedName(Parse::Node parse_node, IdentifierId name_id, + auto LookupQualifiedName(Parse::Node parse_node, SemIR::NameId name_id, SemIR::NameScopeId scope_id, bool required = true) -> SemIR::InstId; @@ -76,7 +76,7 @@ class Context { -> void; // Prints a diagnostic for a missing name. - auto DiagnoseNameNotFound(Parse::Node parse_node, IdentifierId name_id) + auto DiagnoseNameNotFound(Parse::Node parse_node, SemIR::NameId name_id) -> void; // Adds a note to a diagnostic explaining that a class is incomplete. @@ -286,6 +286,7 @@ class Context { auto classes() -> ValueStore& { return sem_ir().classes(); } + auto names() -> SemIR::NameStoreWrapper { return sem_ir().names(); } auto name_scopes() -> SemIR::NameScopeStore& { return sem_ir().name_scopes(); } @@ -334,7 +335,7 @@ class Context { // Names which are registered with name_lookup_, and will need to be // deregistered when the scope ends. - llvm::DenseSet names; + llvm::DenseSet names; // TODO: This likely needs to track things which need to be destructed. }; @@ -435,7 +436,7 @@ class Context { // non-lexical scopes such as classes. // // Names which no longer have lookup results are erased. - llvm::DenseMap> + llvm::DenseMap> name_lookup_; // Cache of the mapping from instructions to types, to avoid recomputing the diff --git a/toolchain/check/convert.cpp b/toolchain/check/convert.cpp index ecf1f99c904f..2033e592fe29 100644 --- a/toolchain/check/convert.cpp +++ b/toolchain/check/convert.cpp @@ -428,7 +428,7 @@ static auto ConvertStructToStructOrClass(Context& context, } // Prepare to look up fields in the source by index. - llvm::SmallDenseMap src_field_indexes; + llvm::SmallDenseMap src_field_indexes; if (src_type.fields_id != dest_type.fields_id) { for (auto [i, field_id] : llvm::enumerate(src_elem_fields)) { auto [it, added] = src_field_indexes.insert( @@ -467,19 +467,19 @@ static auto ConvertStructToStructOrClass(Context& context, StructInitMissingFieldInLiteral, Error, "Missing value for field `{0}` in struct initialization.", llvm::StringRef); - context.emitter().Emit(value.parse_node(), - StructInitMissingFieldInLiteral, - sem_ir.identifiers().Get(dest_field.name_id)); + context.emitter().Emit( + value.parse_node(), StructInitMissingFieldInLiteral, + sem_ir.names().GetFormatted(dest_field.name_id)); } else { CARBON_DIAGNOSTIC(StructInitMissingFieldInConversion, Error, "Cannot convert from struct type `{0}` to `{1}`: " "missing field `{2}` in source type.", std::string, std::string, llvm::StringRef); - context.emitter().Emit(value.parse_node(), - StructInitMissingFieldInConversion, - sem_ir.StringifyType(value.type_id()), - sem_ir.StringifyType(target.type_id), - sem_ir.identifiers().Get(dest_field.name_id)); + context.emitter().Emit( + value.parse_node(), StructInitMissingFieldInConversion, + sem_ir.StringifyType(value.type_id()), + sem_ir.StringifyType(target.type_id), + sem_ir.names().GetFormatted(dest_field.name_id)); } return SemIR::InstId::BuiltinError; } diff --git a/toolchain/check/declaration_name_stack.cpp b/toolchain/check/declaration_name_stack.cpp index d1bcedc43c59..bc8e57d626b5 100644 --- a/toolchain/check/declaration_name_stack.cpp +++ b/toolchain/check/declaration_name_stack.cpp @@ -14,7 +14,7 @@ auto DeclarationNameStack::MakeEmptyNameContext() -> NameContext { } auto DeclarationNameStack::MakeUnqualifiedName(Parse::Node parse_node, - IdentifierId name_id) + SemIR::NameId name_id) -> NameContext { NameContext context = MakeEmptyNameContext(); ApplyNameQualifierTo(context, parse_node, name_id); @@ -103,13 +103,13 @@ auto DeclarationNameStack::AddNameToLookup(NameContext name_context, } auto DeclarationNameStack::ApplyNameQualifier(Parse::Node parse_node, - IdentifierId name_id) -> void { + SemIR::NameId name_id) -> void { ApplyNameQualifierTo(declaration_name_stack_.back(), parse_node, name_id); } auto DeclarationNameStack::ApplyNameQualifierTo(NameContext& name_context, Parse::Node parse_node, - IdentifierId name_id) -> void { + SemIR::NameId name_id) -> void { if (CanResolveQualifier(name_context, parse_node)) { // For identifier nodes, we need to perform a lookup on the identifier. auto resolved_inst_id = context_->LookupNameInDeclaration( diff --git a/toolchain/check/declaration_name_stack.h b/toolchain/check/declaration_name_stack.h index b11e89573e11..ea803bb668be 100644 --- a/toolchain/check/declaration_name_stack.h +++ b/toolchain/check/declaration_name_stack.h @@ -124,7 +124,7 @@ class DeclarationNameStack { SemIR::InstId resolved_inst_id = SemIR::InstId::Invalid; // The ID of an unresolved identifier. - IdentifierId unresolved_name_id; + SemIR::NameId unresolved_name_id; }; }; @@ -154,13 +154,14 @@ class DeclarationNameStack { // unqualified name in the current context. This is suitable for adding to // name lookup in situations where a qualified name is not permitted, such as // a pattern binding. - auto MakeUnqualifiedName(Parse::Node parse_node, IdentifierId name_id) + auto MakeUnqualifiedName(Parse::Node parse_node, SemIR::NameId name_id) -> NameContext; // Applies a Name from the name stack to the top of the declaration name // stack. This will enter the scope corresponding to the name if the name // describes an existing scope, such as a namespace or a defined class. - auto ApplyNameQualifier(Parse::Node parse_node, IdentifierId name_id) -> void; + auto ApplyNameQualifier(Parse::Node parse_node, SemIR::NameId name_id) + -> void; // Adds a name to name lookup. Prints a diagnostic for name conflicts. auto AddNameToLookup(NameContext name_context, SemIR::InstId target_id) @@ -177,7 +178,7 @@ class DeclarationNameStack { // Applies a Name from the name stack to given name context. auto ApplyNameQualifierTo(NameContext& name_context, Parse::Node parse_node, - IdentifierId name_id) -> void; + SemIR::NameId name_id) -> void; // Returns true if the context is in a state where it can resolve qualifiers. // Updates name_context as needed. diff --git a/toolchain/check/handle_class.cpp b/toolchain/check/handle_class.cpp index 1474d8a7d195..c17fdbbf289f 100644 --- a/toolchain/check/handle_class.cpp +++ b/toolchain/check/handle_class.cpp @@ -54,7 +54,7 @@ static auto BuildClassDeclaration(Context& context) {.name_id = name_context.state == DeclarationNameStack::NameContext::State::Unresolved ? name_context.unresolved_name_id - : IdentifierId::Invalid, + : SemIR::NameId::Invalid, // `.self_type_id` depends on `class_id`, so is set below. .self_type_id = SemIR::TypeId::Invalid, .declaration_id = class_decl_id}); @@ -93,7 +93,7 @@ auto HandleClassDefinitionStart(Context& context, Parse::Node parse_node) "Previous definition was here."); context.emitter() .Build(parse_node, ClassRedefinition, - context.identifiers().Get(class_info.name_id)) + context.names().GetFormatted(class_info.name_id)) .Note(context.insts().Get(class_info.definition_id).parse_node(), ClassPreviousDefinition) .Emit(); @@ -106,13 +106,8 @@ auto HandleClassDefinitionStart(Context& context, Parse::Node parse_node) context.PushScope(class_decl_id, class_info.scope_id); // Introduce `Self`. - // TODO: This will shadow a local variable declared with name `r#Self`, but - // should not. See #2984 and the corresponding code in - // HandleSelfTypeNameExpression. context.AddNameToLookup( - parse_node, - context.identifiers().Add( - Lex::TokenKind::SelfTypeIdentifier.fixed_spelling()), + parse_node, SemIR::NameId::SelfType, context.sem_ir().GetTypeAllowBuiltinTypes(class_info.self_type_id)); context.inst_block_stack().Push(); diff --git a/toolchain/check/handle_function.cpp b/toolchain/check/handle_function.cpp index 52683a273b99..dbb189a1acfe 100644 --- a/toolchain/check/handle_function.cpp +++ b/toolchain/check/handle_function.cpp @@ -101,7 +101,7 @@ static auto BuildFunctionDeclaration(Context& context, bool is_definition) {.name_id = name_context.state == DeclarationNameStack::NameContext::State::Unresolved ? name_context.unresolved_name_id - : IdentifierId::Invalid, + : SemIR::NameId::Invalid, .implicit_param_refs_id = implicit_param_refs_id, .param_refs_id = param_refs_id, .return_type_id = return_type_id, @@ -176,7 +176,7 @@ auto HandleFunctionDefinitionStart(Context& context, Parse::Node parse_node) "Previous definition was here."); context.emitter() .Build(parse_node, FunctionRedefinition, - context.identifiers().Get(function.name_id)) + context.names().GetFormatted(function.name_id)) .Note(context.insts().Get(function.definition_id).parse_node(), FunctionPreviousDefinition) .Emit(); @@ -211,12 +211,8 @@ auto HandleFunctionDefinitionStart(Context& context, Parse::Node parse_node) context.AddNameToLookup(fn_param->parse_node, fn_param->name_id, param_id); } else if (auto self_param = param.TryAs()) { - // TODO: This will shadow a local variable named `r#self`, but should - // not. See #2984 and the corresponding code in - // HandleSelfTypeNameExpression. - context.AddNameToLookup( - self_param->parse_node, - context.identifiers().Add(SemIR::SelfParameter::Name), param_id); + context.AddNameToLookup(self_param->parse_node, SemIR::NameId::SelfValue, + param_id); } else { CARBON_FATAL() << "Unexpected kind of parameter in function definition " << param; @@ -246,8 +242,8 @@ auto HandleReturnType(Context& context, Parse::Node parse_node) -> bool { auto type_id = ExpressionAsType(context, type_parse_node, type_inst_id); // TODO: Use a dedicated instruction rather than VarStorage here. context.AddInstAndPush( - parse_node, SemIR::VarStorage{parse_node, type_id, - context.identifiers().Add("return")}); + parse_node, + SemIR::VarStorage{parse_node, type_id, SemIR::NameId::ReturnSlot}); return true; } diff --git a/toolchain/check/handle_name.cpp b/toolchain/check/handle_name.cpp index c1abb2c20fb2..9675ea1391dd 100644 --- a/toolchain/check/handle_name.cpp +++ b/toolchain/check/handle_name.cpp @@ -56,7 +56,7 @@ static auto GetExpressionValueForLookupResult(Context& context, auto HandleMemberAccessExpression(Context& context, Parse::Node parse_node) -> bool { - IdentifierId name_id = context.node_stack().Pop(); + SemIR::NameId name_id = context.node_stack().Pop(); auto base_id = context.node_stack().PopExpression(); // If the base is a name scope, such as a class or namespace, perform lookup @@ -195,7 +195,7 @@ auto HandleMemberAccessExpression(Context& context, Parse::Node parse_node) llvm::StringRef); context.emitter().Emit(parse_node, QualifiedExpressionNameNotFound, context.sem_ir().StringifyType(base_type_id), - context.identifiers().Get(name_id)); + context.names().GetFormatted(name_id)); break; } // TODO: `ConstType` should support member access just like the @@ -224,16 +224,16 @@ auto HandlePointerMemberAccessExpression(Context& context, } auto HandleName(Context& context, Parse::Node parse_node) -> bool { - auto name_id = context.tokens().GetIdentifier( - context.parse_tree().node_token(parse_node)); + auto name_id = SemIR::NameId::ForIdentifier(context.tokens().GetIdentifier( + context.parse_tree().node_token(parse_node))); // The parent is responsible for binding the name. context.node_stack().Push(parse_node, name_id); return true; } auto HandleNameExpression(Context& context, Parse::Node parse_node) -> bool { - auto name_id = context.tokens().GetIdentifier( - context.parse_tree().node_token(parse_node)); + auto name_id = SemIR::NameId::ForIdentifier(context.tokens().GetIdentifier( + context.parse_tree().node_token(parse_node))); auto value_id = context.LookupUnqualifiedName(parse_node, name_id); value_id = GetExpressionValueForLookupResult(context, value_id); auto value = context.insts().Get(value_id); @@ -277,11 +277,7 @@ auto HandleQualifiedDeclaration(Context& context, Parse::Node parse_node) auto HandleSelfTypeNameExpression(Context& context, Parse::Node parse_node) -> bool { - // TODO: This will find a local variable declared with name `r#Self`, but - // should not. See #2984 and the corresponding code in - // HandleClassDefinitionStart. - auto name_id = context.identifiers().Add( - Lex::TokenKind::SelfTypeIdentifier.fixed_spelling()); + auto name_id = SemIR::NameId::SelfType; auto value_id = context.LookupUnqualifiedName(parse_node, name_id); auto value = context.insts().Get(value_id); context.AddInstAndPush( @@ -297,10 +293,7 @@ auto HandleSelfValueName(Context& context, Parse::Node parse_node) -> bool { auto HandleSelfValueNameExpression(Context& context, Parse::Node parse_node) -> bool { - // TODO: This will find a local variable declared with name `r#self`, but - // should not. See #2984 and the corresponding code in - // HandleFunctionDefinitionStart. - auto name_id = context.identifiers().Add(SemIR::SelfParameter::Name); + auto name_id = SemIR::NameId::SelfValue; auto value_id = context.LookupUnqualifiedName(parse_node, name_id); auto value = context.insts().Get(value_id); context.AddInstAndPush( diff --git a/toolchain/check/handle_struct.cpp b/toolchain/check/handle_struct.cpp index 0b5afd0c86e4..9976d556de42 100644 --- a/toolchain/check/handle_struct.cpp +++ b/toolchain/check/handle_struct.cpp @@ -41,7 +41,7 @@ auto HandleStructFieldUnknown(Context& context, Parse::Node parse_node) auto HandleStructFieldValue(Context& context, Parse::Node parse_node) -> bool { auto [value_parse_node, value_inst_id] = context.node_stack().PopExpressionWithParseNode(); - IdentifierId name_id = context.node_stack().Pop(); + SemIR::NameId name_id = context.node_stack().Pop(); // Store the name for the type. context.args_type_info_stack().AddInst(SemIR::StructTypeField{ diff --git a/toolchain/check/node_stack.h b/toolchain/check/node_stack.h index 1f2655b130ac..c46cfb46b972 100644 --- a/toolchain/check/node_stack.h +++ b/toolchain/check/node_stack.h @@ -131,8 +131,8 @@ class NodeStack { RequireParseKind(back.first); return back; } - if constexpr (RequiredIdKind == IdKind::IdentifierId) { - auto back = PopWithParseNode(); + if constexpr (RequiredIdKind == IdKind::NameId) { + auto back = PopWithParseNode(); RequireParseKind(back.first); return back; } @@ -190,8 +190,8 @@ class NodeStack { if constexpr (RequiredIdKind == IdKind::ClassId) { return back.id(); } - if constexpr (RequiredIdKind == IdKind::IdentifierId) { - return back.id(); + if constexpr (RequiredIdKind == IdKind::NameId) { + return back.id(); } if constexpr (RequiredIdKind == IdKind::TypeId) { return back.id(); @@ -214,7 +214,7 @@ class NodeStack { InstBlockId, FunctionId, ClassId, - IdentifierId, + NameId, TypeId, // No associated ID type. SoloParseNode, @@ -232,7 +232,7 @@ class NodeStack { : parse_node(parse_node), function_id(function_id) {} explicit Entry(Parse::Node parse_node, SemIR::ClassId class_id) : parse_node(parse_node), class_id(class_id) {} - explicit Entry(Parse::Node parse_node, IdentifierId name_id) + explicit Entry(Parse::Node parse_node, SemIR::NameId name_id) : parse_node(parse_node), name_id(name_id) {} explicit Entry(Parse::Node parse_node, SemIR::TypeId type_id) : parse_node(parse_node), type_id(type_id) {} @@ -252,7 +252,7 @@ class NodeStack { if constexpr (std::is_same()) { return class_id; } - if constexpr (std::is_same()) { + if constexpr (std::is_same()) { return name_id; } if constexpr (std::is_same()) { @@ -273,7 +273,7 @@ class NodeStack { SemIR::InstBlockId inst_block_id; SemIR::FunctionId function_id; SemIR::ClassId class_id; - IdentifierId name_id; + SemIR::NameId name_id; SemIR::TypeId type_id; }; }; @@ -318,7 +318,7 @@ class NodeStack { case Parse::NodeKind::ClassDefinitionStart: return IdKind::ClassId; case Parse::NodeKind::Name: - return IdKind::IdentifierId; + return IdKind::NameId; case Parse::NodeKind::ArrayExpressionSemi: case Parse::NodeKind::ClassIntroducer: case Parse::NodeKind::CodeBlockStart: @@ -356,8 +356,8 @@ class NodeStack { if constexpr (std::is_same_v) { return IdKind::ClassId; } - if constexpr (std::is_same_v) { - return IdKind::IdentifierId; + if constexpr (std::is_same_v) { + return IdKind::NameId; } if constexpr (std::is_same_v) { return IdKind::TypeId; diff --git a/toolchain/check/testdata/array/array_in_place.carbon b/toolchain/check/testdata/array/array_in_place.carbon index 63e976d84ee3..de06d7478954 100644 --- a/toolchain/check/testdata/array/array_in_place.carbon +++ b/toolchain/check/testdata/array/array_in_place.carbon @@ -30,15 +30,15 @@ fn G() { // CHECK:STDOUT: %.loc10_25: (type, type, type) = tuple_literal (i32, i32, i32) // CHECK:STDOUT: %.loc10_28: i32 = int_literal 2 // CHECK:STDOUT: %.loc10_29: type = array_type %.loc10_28, (i32, i32, i32) -// CHECK:STDOUT: %v.var: ref [(i32, i32, i32); 2] = var "v" -// CHECK:STDOUT: %v: ref [(i32, i32, i32); 2] = bind_name "v", %v.var -// CHECK:STDOUT: %F.ref.loc10_34: = name_reference "F", file.%F +// CHECK:STDOUT: %v.var: ref [(i32, i32, i32); 2] = var v +// CHECK:STDOUT: %v: ref [(i32, i32, i32); 2] = bind_name v, %v.var +// CHECK:STDOUT: %F.ref.loc10_34: = name_reference F, file.%F // CHECK:STDOUT: %.loc10_42.3: ref (i32, i32, i32) = splice_block %.loc10_42.2 { // CHECK:STDOUT: %.loc10_42.1: i32 = int_literal 0 // CHECK:STDOUT: %.loc10_42.2: ref (i32, i32, i32) = array_index %v.var, %.loc10_42.1 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc10_35: init (i32, i32, i32) = call %F.ref.loc10_34() to %.loc10_42.3 -// CHECK:STDOUT: %F.ref.loc10_39: = name_reference "F", file.%F +// CHECK:STDOUT: %F.ref.loc10_39: = name_reference F, file.%F // CHECK:STDOUT: %.loc10_42.6: ref (i32, i32, i32) = splice_block %.loc10_42.5 { // CHECK:STDOUT: %.loc10_42.4: i32 = int_literal 1 // CHECK:STDOUT: %.loc10_42.5: ref (i32, i32, i32) = array_index %v.var, %.loc10_42.4 diff --git a/toolchain/check/testdata/array/assign_return_value.carbon b/toolchain/check/testdata/array/assign_return_value.carbon index 0aaf0b0a63bc..d053ff702965 100644 --- a/toolchain/check/testdata/array/assign_return_value.carbon +++ b/toolchain/check/testdata/array/assign_return_value.carbon @@ -33,9 +33,9 @@ fn Run() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc10_16: i32 = int_literal 1 // CHECK:STDOUT: %.loc10_17: type = array_type %.loc10_16, i32 -// CHECK:STDOUT: %t.var: ref [i32; 1] = var "t" -// CHECK:STDOUT: %t: ref [i32; 1] = bind_name "t", %t.var -// CHECK:STDOUT: %F.ref: = name_reference "F", file.%F +// CHECK:STDOUT: %t.var: ref [i32; 1] = var t +// CHECK:STDOUT: %t: ref [i32; 1] = bind_name t, %t.var +// CHECK:STDOUT: %F.ref: = name_reference F, file.%F // CHECK:STDOUT: %.loc10_22.1: init (i32,) = call %F.ref() // CHECK:STDOUT: %.loc10_22.2: ref (i32,) = temporary_storage // CHECK:STDOUT: %.loc10_22.3: ref (i32,) = temporary %.loc10_22.2, %.loc10_22.1 diff --git a/toolchain/check/testdata/array/assign_var.carbon b/toolchain/check/testdata/array/assign_var.carbon index b1caf214de7a..35b5325ad0f1 100644 --- a/toolchain/check/testdata/array/assign_var.carbon +++ b/toolchain/check/testdata/array/assign_var.carbon @@ -16,8 +16,8 @@ var b: [i32; 3] = a; // CHECK:STDOUT: // CHECK:STDOUT: file "assign_var.carbon" { // CHECK:STDOUT: %.loc7_22: (type, type, type) = tuple_literal (i32, i32, i32) -// CHECK:STDOUT: %a.var: ref (i32, i32, i32) = var "a" -// CHECK:STDOUT: %a: ref (i32, i32, i32) = bind_name "a", %a.var +// CHECK:STDOUT: %a.var: ref (i32, i32, i32) = var a +// CHECK:STDOUT: %a: ref (i32, i32, i32) = bind_name a, %a.var // CHECK:STDOUT: %.loc7_27: i32 = int_literal 1 // CHECK:STDOUT: %.loc7_30: i32 = int_literal 2 // CHECK:STDOUT: %.loc7_33: i32 = int_literal 3 @@ -32,9 +32,9 @@ var b: [i32; 3] = a; // CHECK:STDOUT: assign %a.var, %.loc7_34.8 // CHECK:STDOUT: %.loc8_14: i32 = int_literal 3 // CHECK:STDOUT: %.loc8_15: type = array_type %.loc8_14, i32 -// CHECK:STDOUT: %b.var: ref [i32; 3] = var "b" -// CHECK:STDOUT: %b: ref [i32; 3] = bind_name "b", %b.var -// CHECK:STDOUT: %a.ref: ref (i32, i32, i32) = name_reference "a", %a +// CHECK:STDOUT: %b.var: ref [i32; 3] = var b +// CHECK:STDOUT: %b: ref [i32; 3] = bind_name b, %b.var +// CHECK:STDOUT: %a.ref: ref (i32, i32, i32) = name_reference a, %a // CHECK:STDOUT: %.loc8_19.1: ref i32 = tuple_access %a.ref, member0 // CHECK:STDOUT: %.loc8_19.2: i32 = bind_value %.loc8_19.1 // CHECK:STDOUT: %.loc8_19.3: i32 = int_literal 0 diff --git a/toolchain/check/testdata/array/base.carbon b/toolchain/check/testdata/array/base.carbon index 89a25de6f3f6..f171a4e12dfc 100644 --- a/toolchain/check/testdata/array/base.carbon +++ b/toolchain/check/testdata/array/base.carbon @@ -21,8 +21,8 @@ var c: [(); 5] = ((), (), (), (), (),); // CHECK:STDOUT: file "base.carbon" { // CHECK:STDOUT: %.loc7_14: i32 = int_literal 1 // CHECK:STDOUT: %.loc7_15: type = array_type %.loc7_14, i32 -// CHECK:STDOUT: %a.var: ref [i32; 1] = var "a" -// CHECK:STDOUT: %a: ref [i32; 1] = bind_name "a", %a.var +// CHECK:STDOUT: %a.var: ref [i32; 1] = var a +// CHECK:STDOUT: %a: ref [i32; 1] = bind_name a, %a.var // CHECK:STDOUT: %.loc7_20: i32 = int_literal 1 // CHECK:STDOUT: %.loc7_22.1: (i32,) = tuple_literal (%.loc7_20) // CHECK:STDOUT: %.loc7_22.2: i32 = int_literal 0 @@ -32,8 +32,8 @@ var c: [(); 5] = ((), (), (), (), (),); // CHECK:STDOUT: assign %a.var, %.loc7_22.5 // CHECK:STDOUT: %.loc8_14: i32 = int_literal 2 // CHECK:STDOUT: %.loc8_15: type = array_type %.loc8_14, f64 -// CHECK:STDOUT: %b.var: ref [f64; 2] = var "b" -// CHECK:STDOUT: %b: ref [f64; 2] = bind_name "b", %b.var +// CHECK:STDOUT: %b.var: ref [f64; 2] = var b +// CHECK:STDOUT: %b: ref [f64; 2] = bind_name b, %b.var // CHECK:STDOUT: %.loc8_20: f64 = real_literal 111e-1 // CHECK:STDOUT: %.loc8_26: f64 = real_literal 22e-1 // CHECK:STDOUT: %.loc8_30.1: (f64, f64) = tuple_literal (%.loc8_20, %.loc8_26) @@ -48,8 +48,8 @@ var c: [(); 5] = ((), (), (), (), (),); // CHECK:STDOUT: %.loc9_10: () = tuple_literal () // CHECK:STDOUT: %.loc9_13: i32 = int_literal 5 // CHECK:STDOUT: %.loc9_14: type = array_type %.loc9_13, () -// CHECK:STDOUT: %c.var: ref [(); 5] = var "c" -// CHECK:STDOUT: %c: ref [(); 5] = bind_name "c", %c.var +// CHECK:STDOUT: %c.var: ref [(); 5] = var c +// CHECK:STDOUT: %c: ref [(); 5] = bind_name c, %c.var // CHECK:STDOUT: %.loc9_20.1: () = tuple_literal () // CHECK:STDOUT: %.loc9_24.1: () = tuple_literal () // CHECK:STDOUT: %.loc9_28.1: () = tuple_literal () diff --git a/toolchain/check/testdata/array/fail_bound_overflow.carbon b/toolchain/check/testdata/array/fail_bound_overflow.carbon index 9c62f8d59073..3c5c28f80a53 100644 --- a/toolchain/check/testdata/array/fail_bound_overflow.carbon +++ b/toolchain/check/testdata/array/fail_bound_overflow.carbon @@ -12,6 +12,6 @@ var a: [1; 39999999999999999993]; // CHECK:STDOUT: file "fail_bound_overflow.carbon" { // CHECK:STDOUT: %.loc10_9: i32 = int_literal 1 // CHECK:STDOUT: %.loc10_12: i32 = int_literal 39999999999999999993 -// CHECK:STDOUT: %a.var: ref = var "a" -// CHECK:STDOUT: %a: ref = bind_name "a", %a.var +// CHECK:STDOUT: %a.var: ref = var a +// CHECK:STDOUT: %a: ref = bind_name a, %a.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/array/fail_incomplete_element.carbon b/toolchain/check/testdata/array/fail_incomplete_element.carbon index be2a3e062432..a2a4b9bc056e 100644 --- a/toolchain/check/testdata/array/fail_incomplete_element.carbon +++ b/toolchain/check/testdata/array/fail_incomplete_element.carbon @@ -26,16 +26,16 @@ var p: Incomplete* = &a[0]; // CHECK:STDOUT: file "fail_incomplete_element.carbon" { // CHECK:STDOUT: class_declaration @Incomplete, () // CHECK:STDOUT: %Incomplete: type = class_type @Incomplete -// CHECK:STDOUT: %Incomplete.ref.loc15: type = name_reference "Incomplete", %Incomplete +// CHECK:STDOUT: %Incomplete.ref.loc15: type = name_reference Incomplete, %Incomplete // CHECK:STDOUT: %.loc15_21: i32 = int_literal 1 // CHECK:STDOUT: %.loc15_22: type = array_type %.loc15_21, Incomplete -// CHECK:STDOUT: %a.var: ref = var "a" -// CHECK:STDOUT: %a: ref = bind_name "a", %a.var -// CHECK:STDOUT: %Incomplete.ref.loc20: type = name_reference "Incomplete", %Incomplete +// CHECK:STDOUT: %a.var: ref = var a +// CHECK:STDOUT: %a: ref = bind_name a, %a.var +// CHECK:STDOUT: %Incomplete.ref.loc20: type = name_reference Incomplete, %Incomplete // CHECK:STDOUT: %.loc20_18: type = ptr_type Incomplete -// CHECK:STDOUT: %p.var: ref Incomplete* = var "p" -// CHECK:STDOUT: %p: ref Incomplete* = bind_name "p", %p.var -// CHECK:STDOUT: %a.ref: ref = name_reference "a", %a +// CHECK:STDOUT: %p.var: ref Incomplete* = var p +// CHECK:STDOUT: %p: ref Incomplete* = bind_name p, %p.var +// CHECK:STDOUT: %a.ref: ref = name_reference a, %a // CHECK:STDOUT: %.loc20_25: i32 = int_literal 0 // CHECK:STDOUT: %.loc20_22: * = address_of // CHECK:STDOUT: assign %p.var, diff --git a/toolchain/check/testdata/array/fail_invalid_type.carbon b/toolchain/check/testdata/array/fail_invalid_type.carbon index 1d43cef44f26..902683c6a986 100644 --- a/toolchain/check/testdata/array/fail_invalid_type.carbon +++ b/toolchain/check/testdata/array/fail_invalid_type.carbon @@ -17,6 +17,6 @@ var a: [1; 1]; // CHECK:STDOUT: %.loc10_9: i32 = int_literal 1 // CHECK:STDOUT: %.loc10_12: i32 = int_literal 1 // CHECK:STDOUT: %.loc10_13: type = array_type %.loc10_12, -// CHECK:STDOUT: %a.var: ref [; 1] = var "a" -// CHECK:STDOUT: %a: ref [; 1] = bind_name "a", %a.var +// CHECK:STDOUT: %a.var: ref [; 1] = var a +// CHECK:STDOUT: %a: ref [; 1] = bind_name a, %a.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/array/fail_out_of_bound.carbon b/toolchain/check/testdata/array/fail_out_of_bound.carbon index 1fefe46f735c..bf8a370a4197 100644 --- a/toolchain/check/testdata/array/fail_out_of_bound.carbon +++ b/toolchain/check/testdata/array/fail_out_of_bound.carbon @@ -17,8 +17,8 @@ var a: [i32; 1] = (1, 2, 3); // CHECK:STDOUT: file "fail_out_of_bound.carbon" { // CHECK:STDOUT: %.loc10_14: i32 = int_literal 1 // CHECK:STDOUT: %.loc10_15: type = array_type %.loc10_14, i32 -// CHECK:STDOUT: %a.var: ref [i32; 1] = var "a" -// CHECK:STDOUT: %a: ref [i32; 1] = bind_name "a", %a.var +// CHECK:STDOUT: %a.var: ref [i32; 1] = var a +// CHECK:STDOUT: %a: ref [i32; 1] = bind_name a, %a.var // CHECK:STDOUT: %.loc10_20: i32 = int_literal 1 // CHECK:STDOUT: %.loc10_23: i32 = int_literal 2 // CHECK:STDOUT: %.loc10_26: i32 = int_literal 3 diff --git a/toolchain/check/testdata/array/fail_type_mismatch.carbon b/toolchain/check/testdata/array/fail_type_mismatch.carbon index e98c37a17f6c..e622596f603c 100644 --- a/toolchain/check/testdata/array/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/array/fail_type_mismatch.carbon @@ -41,8 +41,8 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: file "fail_type_mismatch.carbon" { // CHECK:STDOUT: %.loc10_14: i32 = int_literal 3 // CHECK:STDOUT: %.loc10_15: type = array_type %.loc10_14, i32 -// CHECK:STDOUT: %a.var: ref [i32; 3] = var "a" -// CHECK:STDOUT: %a: ref [i32; 3] = bind_name "a", %a.var +// CHECK:STDOUT: %a.var: ref [i32; 3] = var a +// CHECK:STDOUT: %a: ref [i32; 3] = bind_name a, %a.var // CHECK:STDOUT: %.loc10_20: i32 = int_literal 1 // CHECK:STDOUT: %.loc10_23: String = string_literal "Hello" // CHECK:STDOUT: %.loc10_32: String = string_literal "World" @@ -52,13 +52,13 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: %.loc10_39.4: init i32 = initialize_from %.loc10_20 to %.loc10_39.3 // CHECK:STDOUT: assign %a.var, // CHECK:STDOUT: %.loc12: (type, type, type) = tuple_literal (i32, String, String) -// CHECK:STDOUT: %t1.var: ref (i32, String, String) = var "t1" -// CHECK:STDOUT: %t1: ref (i32, String, String) = bind_name "t1", %t1.var +// CHECK:STDOUT: %t1.var: ref (i32, String, String) = var t1 +// CHECK:STDOUT: %t1: ref (i32, String, String) = bind_name t1, %t1.var // CHECK:STDOUT: %.loc16_14: i32 = int_literal 3 // CHECK:STDOUT: %.loc16_15: type = array_type %.loc16_14, i32 -// CHECK:STDOUT: %b.var: ref [i32; 3] = var "b" -// CHECK:STDOUT: %b: ref [i32; 3] = bind_name "b", %b.var -// CHECK:STDOUT: %t1.ref: ref (i32, String, String) = name_reference "t1", %t1 +// CHECK:STDOUT: %b.var: ref [i32; 3] = var b +// CHECK:STDOUT: %b: ref [i32; 3] = bind_name b, %b.var +// CHECK:STDOUT: %t1.ref: ref (i32, String, String) = name_reference t1, %t1 // CHECK:STDOUT: %.loc16_19.1: ref i32 = tuple_access %t1.ref, member0 // CHECK:STDOUT: %.loc16_19.2: i32 = bind_value %.loc16_19.1 // CHECK:STDOUT: %.loc16_19.3: i32 = int_literal 0 @@ -68,19 +68,19 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: assign %b.var, // CHECK:STDOUT: %.loc21_14: i32 = int_literal 3 // CHECK:STDOUT: %.loc21_15: type = array_type %.loc21_14, i32 -// CHECK:STDOUT: %c.var: ref [i32; 3] = var "c" -// CHECK:STDOUT: %c: ref [i32; 3] = bind_name "c", %c.var +// CHECK:STDOUT: %c.var: ref [i32; 3] = var c +// CHECK:STDOUT: %c: ref [i32; 3] = bind_name c, %c.var // CHECK:STDOUT: %.loc21_20: i32 = int_literal 1 // CHECK:STDOUT: %.loc21_23: i32 = int_literal 2 // CHECK:STDOUT: %.loc21_24: (i32, i32) = tuple_literal (%.loc21_20, %.loc21_23) // CHECK:STDOUT: assign %c.var, // CHECK:STDOUT: %.loc23: (type, type) = tuple_literal (i32, i32) -// CHECK:STDOUT: %t2.var: ref (i32, i32) = var "t2" -// CHECK:STDOUT: %t2: ref (i32, i32) = bind_name "t2", %t2.var +// CHECK:STDOUT: %t2.var: ref (i32, i32) = var t2 +// CHECK:STDOUT: %t2: ref (i32, i32) = bind_name t2, %t2.var // CHECK:STDOUT: %.loc27_14: i32 = int_literal 3 // CHECK:STDOUT: %.loc27_15: type = array_type %.loc27_14, i32 -// CHECK:STDOUT: %d.var: ref [i32; 3] = var "d" -// CHECK:STDOUT: %d: ref [i32; 3] = bind_name "d", %d.var -// CHECK:STDOUT: %t2.ref: ref (i32, i32) = name_reference "t2", %t2 +// CHECK:STDOUT: %d.var: ref [i32; 3] = var d +// CHECK:STDOUT: %d: ref [i32; 3] = bind_name d, %d.var +// CHECK:STDOUT: %t2.ref: ref (i32, i32) = name_reference t2, %t2 // CHECK:STDOUT: assign %d.var, // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/array/function_param.carbon b/toolchain/check/testdata/array/function_param.carbon index 83e7736c522b..435fb72f797f 100644 --- a/toolchain/check/testdata/array/function_param.carbon +++ b/toolchain/check/testdata/array/function_param.carbon @@ -24,8 +24,8 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%arr: [i32; 3], %i: i32) -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %arr.ref: [i32; 3] = name_reference "arr", %arr -// CHECK:STDOUT: %i.ref: i32 = name_reference "i", %i +// CHECK:STDOUT: %arr.ref: [i32; 3] = name_reference arr, %arr +// CHECK:STDOUT: %i.ref: i32 = name_reference i, %i // CHECK:STDOUT: %.loc8_15.1: ref [i32; 3] = value_as_reference %arr.ref // CHECK:STDOUT: %.loc8_15.2: ref i32 = array_index %.loc8_15.1, %i.ref // CHECK:STDOUT: %.loc8_15.3: i32 = bind_value %.loc8_15.2 @@ -34,7 +34,7 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @G() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: = name_reference "F", file.%F +// CHECK:STDOUT: %F.ref: = name_reference F, file.%F // CHECK:STDOUT: %.loc12_13: i32 = int_literal 1 // CHECK:STDOUT: %.loc12_16: i32 = int_literal 2 // CHECK:STDOUT: %.loc12_19: i32 = int_literal 3 diff --git a/toolchain/check/testdata/array/nine_elements.carbon b/toolchain/check/testdata/array/nine_elements.carbon index 80f32ccc3acc..64ded888804e 100644 --- a/toolchain/check/testdata/array/nine_elements.carbon +++ b/toolchain/check/testdata/array/nine_elements.carbon @@ -14,8 +14,8 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: file "nine_elements.carbon" { // CHECK:STDOUT: %.loc7_14: i32 = int_literal 9 // CHECK:STDOUT: %.loc7_15: type = array_type %.loc7_14, i32 -// CHECK:STDOUT: %a.var: ref [i32; 9] = var "a" -// CHECK:STDOUT: %a: ref [i32; 9] = bind_name "a", %a.var +// CHECK:STDOUT: %a.var: ref [i32; 9] = var a +// CHECK:STDOUT: %a: ref [i32; 9] = bind_name a, %a.var // CHECK:STDOUT: %.loc7_20: i32 = int_literal 1 // CHECK:STDOUT: %.loc7_23: i32 = int_literal 2 // CHECK:STDOUT: %.loc7_26: i32 = int_literal 3 diff --git a/toolchain/check/testdata/as/as_type.carbon b/toolchain/check/testdata/as/as_type.carbon index b4d237f42b22..967974eba6c8 100644 --- a/toolchain/check/testdata/as/as_type.carbon +++ b/toolchain/check/testdata/as/as_type.carbon @@ -13,5 +13,5 @@ let t: type = (i32, i32) as type; // CHECK:STDOUT: // CHECK:STDOUT: file "as_type.carbon" { // CHECK:STDOUT: %.loc7: (type, type) = tuple_literal (i32, i32) -// CHECK:STDOUT: %t: type = bind_name "t", constants.%.loc7_26 +// CHECK:STDOUT: %t: type = bind_name t, constants.%.loc7_26 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/as/fail_no_conversion.carbon b/toolchain/check/testdata/as/fail_no_conversion.carbon index e0741410a7f3..a8c6692cc5bf 100644 --- a/toolchain/check/testdata/as/fail_no_conversion.carbon +++ b/toolchain/check/testdata/as/fail_no_conversion.carbon @@ -19,5 +19,5 @@ let n: (i32, i32) = 1 as (i32, i32); // CHECK:STDOUT: %.loc10_17: (type, type) = tuple_literal (i32, i32) // CHECK:STDOUT: %.loc10_21: i32 = int_literal 1 // CHECK:STDOUT: %.loc10_35: (type, type) = tuple_literal (i32, i32) -// CHECK:STDOUT: %n: (i32, i32) = bind_name "n", +// CHECK:STDOUT: %n: (i32, i32) = bind_name n, // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/as/fail_not_type.carbon b/toolchain/check/testdata/as/fail_not_type.carbon index 11eab1a05596..151c7cf32649 100644 --- a/toolchain/check/testdata/as/fail_not_type.carbon +++ b/toolchain/check/testdata/as/fail_not_type.carbon @@ -12,5 +12,5 @@ let n: i32 = 1 as 2; // CHECK:STDOUT: file "fail_not_type.carbon" { // CHECK:STDOUT: %.loc10_14: i32 = int_literal 1 // CHECK:STDOUT: %.loc10_19: i32 = int_literal 2 -// CHECK:STDOUT: %n: i32 = bind_name "n", +// CHECK:STDOUT: %n: i32 = bind_name n, // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/as/identity.carbon b/toolchain/check/testdata/as/identity.carbon index cb42a79e2da7..c5e2c268bd52 100644 --- a/toolchain/check/testdata/as/identity.carbon +++ b/toolchain/check/testdata/as/identity.carbon @@ -46,22 +46,22 @@ fn Initializing() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Value(%n: X) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %X.ref.loc14_10: type = name_reference "X", file.%X -// CHECK:STDOUT: %n.ref: X = name_reference "n", %n -// CHECK:STDOUT: %X.ref.loc14_19: type = name_reference "X", file.%X -// CHECK:STDOUT: %m: X = bind_name "m", %n.ref +// CHECK:STDOUT: %X.ref.loc14_10: type = name_reference X, file.%X +// CHECK:STDOUT: %n.ref: X = name_reference n, %n +// CHECK:STDOUT: %X.ref.loc14_19: type = name_reference X, file.%X +// CHECK:STDOUT: %m: X = bind_name m, %n.ref // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Reference(%p: X*) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %X.ref.loc18_10: type = name_reference "X", file.%X +// CHECK:STDOUT: %X.ref.loc18_10: type = name_reference X, file.%X // CHECK:STDOUT: %.loc18_11: type = ptr_type X -// CHECK:STDOUT: %p.ref: X* = name_reference "p", %p +// CHECK:STDOUT: %p.ref: X* = name_reference p, %p // CHECK:STDOUT: %.loc18_17: ref X = dereference %p.ref -// CHECK:STDOUT: %X.ref.loc18_23: type = name_reference "X", file.%X +// CHECK:STDOUT: %X.ref.loc18_23: type = name_reference X, file.%X // CHECK:STDOUT: %.loc18_15: X* = address_of %.loc18_17 -// CHECK:STDOUT: %q: X* = bind_name "q", %.loc18_15 +// CHECK:STDOUT: %q: X* = bind_name q, %.loc18_15 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -69,13 +69,13 @@ fn Initializing() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Initializing() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %X.ref.loc24_10: type = name_reference "X", file.%X -// CHECK:STDOUT: %x.var: ref X = var "x" -// CHECK:STDOUT: %x: ref X = bind_name "x", %x.var -// CHECK:STDOUT: %Make.ref: = name_reference "Make", file.%Make +// CHECK:STDOUT: %X.ref.loc24_10: type = name_reference X, file.%X +// CHECK:STDOUT: %x.var: ref X = var x +// CHECK:STDOUT: %x: ref X = bind_name x, %x.var +// CHECK:STDOUT: %Make.ref: = name_reference Make, file.%Make // CHECK:STDOUT: %.loc24_7: ref X = splice_block %x.var {} // CHECK:STDOUT: %.loc24_19: init X = call %Make.ref() to %.loc24_7 -// CHECK:STDOUT: %X.ref.loc24_25: type = name_reference "X", file.%X +// CHECK:STDOUT: %X.ref.loc24_25: type = name_reference X, file.%X // CHECK:STDOUT: assign %x.var, %.loc24_19 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/as/tuple.carbon b/toolchain/check/testdata/as/tuple.carbon index a871bc29efde..99ede42cda1b 100644 --- a/toolchain/check/testdata/as/tuple.carbon +++ b/toolchain/check/testdata/as/tuple.carbon @@ -47,44 +47,44 @@ fn Var() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Let() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %X.ref.loc15_11: type = name_reference "X", file.%X -// CHECK:STDOUT: %X.ref.loc15_14: type = name_reference "X", file.%X +// CHECK:STDOUT: %X.ref.loc15_11: type = name_reference X, file.%X +// CHECK:STDOUT: %X.ref.loc15_14: type = name_reference X, file.%X // CHECK:STDOUT: %.loc15_15: (type, type) = tuple_literal (%X.ref.loc15_11, %X.ref.loc15_14) -// CHECK:STDOUT: %Make.ref.loc15_20: = name_reference "Make", file.%Make +// CHECK:STDOUT: %Make.ref.loc15_20: = name_reference Make, file.%Make // CHECK:STDOUT: %.loc15_24.1: ref X = temporary_storage // CHECK:STDOUT: %.loc15_24.2: init X = call %Make.ref.loc15_20() to %.loc15_24.1 -// CHECK:STDOUT: %Make.ref.loc15_28: = name_reference "Make", file.%Make +// CHECK:STDOUT: %Make.ref.loc15_28: = name_reference Make, file.%Make // CHECK:STDOUT: %.loc15_32.1: ref X = temporary_storage // CHECK:STDOUT: %.loc15_32.2: init X = call %Make.ref.loc15_28() to %.loc15_32.1 // CHECK:STDOUT: %.loc15_34.1: (X, X) = tuple_literal (%.loc15_24.2, %.loc15_32.2) -// CHECK:STDOUT: %X.ref.loc15_40: type = name_reference "X", file.%X -// CHECK:STDOUT: %X.ref.loc15_43: type = name_reference "X", file.%X +// CHECK:STDOUT: %X.ref.loc15_40: type = name_reference X, file.%X +// CHECK:STDOUT: %X.ref.loc15_43: type = name_reference X, file.%X // CHECK:STDOUT: %.loc15_44: (type, type) = tuple_literal (%X.ref.loc15_40, %X.ref.loc15_43) // CHECK:STDOUT: %.loc15_24.3: ref X = temporary %.loc15_24.1, %.loc15_24.2 // CHECK:STDOUT: %.loc15_24.4: X = bind_value %.loc15_24.3 // CHECK:STDOUT: %.loc15_32.3: ref X = temporary %.loc15_32.1, %.loc15_32.2 // CHECK:STDOUT: %.loc15_32.4: X = bind_value %.loc15_32.3 // CHECK:STDOUT: %.loc15_34.2: (X, X) = tuple_value %.loc15_34.1, (%.loc15_24.4, %.loc15_32.4) -// CHECK:STDOUT: %a: (X, X) = bind_name "a", %.loc15_34.2 +// CHECK:STDOUT: %a: (X, X) = bind_name a, %.loc15_34.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Var() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %X.ref.loc20_11: type = name_reference "X", file.%X -// CHECK:STDOUT: %X.ref.loc20_14: type = name_reference "X", file.%X +// CHECK:STDOUT: %X.ref.loc20_11: type = name_reference X, file.%X +// CHECK:STDOUT: %X.ref.loc20_14: type = name_reference X, file.%X // CHECK:STDOUT: %.loc20_15: (type, type) = tuple_literal (%X.ref.loc20_11, %X.ref.loc20_14) -// CHECK:STDOUT: %b.var: ref (X, X) = var "b" -// CHECK:STDOUT: %b: ref (X, X) = bind_name "b", %b.var -// CHECK:STDOUT: %Make.ref.loc20_20: = name_reference "Make", file.%Make +// CHECK:STDOUT: %b.var: ref (X, X) = var b +// CHECK:STDOUT: %b: ref (X, X) = bind_name b, %b.var +// CHECK:STDOUT: %Make.ref.loc20_20: = name_reference Make, file.%Make // CHECK:STDOUT: %.loc20_34.1: ref X = tuple_access %b.var, member0 // CHECK:STDOUT: %.loc20_24: init X = call %Make.ref.loc20_20() to %.loc20_34.1 -// CHECK:STDOUT: %Make.ref.loc20_28: = name_reference "Make", file.%Make +// CHECK:STDOUT: %Make.ref.loc20_28: = name_reference Make, file.%Make // CHECK:STDOUT: %.loc20_34.2: ref X = tuple_access %b.var, member1 // CHECK:STDOUT: %.loc20_32: init X = call %Make.ref.loc20_28() to %.loc20_34.2 // CHECK:STDOUT: %.loc20_34.3: (X, X) = tuple_literal (%.loc20_24, %.loc20_32) -// CHECK:STDOUT: %X.ref.loc20_40: type = name_reference "X", file.%X -// CHECK:STDOUT: %X.ref.loc20_43: type = name_reference "X", file.%X +// CHECK:STDOUT: %X.ref.loc20_40: type = name_reference X, file.%X +// CHECK:STDOUT: %X.ref.loc20_43: type = name_reference X, file.%X // CHECK:STDOUT: %.loc20_44: (type, type) = tuple_literal (%X.ref.loc20_40, %X.ref.loc20_43) // CHECK:STDOUT: %.loc20_34.4: init (X, X) = tuple_init %.loc20_34.3, (%.loc20_24, %.loc20_32) // CHECK:STDOUT: assign %b.var, %.loc20_34.4 diff --git a/toolchain/check/testdata/basics/builtin_types.carbon b/toolchain/check/testdata/basics/builtin_types.carbon index 4b7731dd4b52..325f489fad13 100644 --- a/toolchain/check/testdata/basics/builtin_types.carbon +++ b/toolchain/check/testdata/basics/builtin_types.carbon @@ -14,17 +14,17 @@ var test_type: type = i32; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file "builtin_types.carbon" { -// CHECK:STDOUT: %test_i32.var: ref i32 = var "test_i32" -// CHECK:STDOUT: %test_i32: ref i32 = bind_name "test_i32", %test_i32.var +// CHECK:STDOUT: %test_i32.var: ref i32 = var test_i32 +// CHECK:STDOUT: %test_i32: ref i32 = bind_name test_i32, %test_i32.var // CHECK:STDOUT: %.loc7: i32 = int_literal 0 // CHECK:STDOUT: assign %test_i32.var, %.loc7 -// CHECK:STDOUT: %test_f64.var: ref f64 = var "test_f64" -// CHECK:STDOUT: %test_f64: ref f64 = bind_name "test_f64", %test_f64.var +// CHECK:STDOUT: %test_f64.var: ref f64 = var test_f64 +// CHECK:STDOUT: %test_f64: ref f64 = bind_name test_f64, %test_f64.var // CHECK:STDOUT: %.loc8: f64 = real_literal 1e-1 // CHECK:STDOUT: assign %test_f64.var, %.loc8 // CHECK:STDOUT: %.loc9: String = string_literal "Test" -// CHECK:STDOUT: %test_str: String = bind_name "test_str", %.loc9 -// CHECK:STDOUT: %test_type.var: ref type = var "test_type" -// CHECK:STDOUT: %test_type: ref type = bind_name "test_type", %test_type.var +// CHECK:STDOUT: %test_str: String = bind_name test_str, %.loc9 +// CHECK:STDOUT: %test_type.var: ref type = var test_type +// CHECK:STDOUT: %test_type: ref type = bind_name test_type, %test_type.var // CHECK:STDOUT: assign %test_type.var, i32 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/basics/fail_name_lookup.carbon b/toolchain/check/testdata/basics/fail_name_lookup.carbon index e248bc015e40..55f2aec57474 100644 --- a/toolchain/check/testdata/basics/fail_name_lookup.carbon +++ b/toolchain/check/testdata/basics/fail_name_lookup.carbon @@ -17,6 +17,6 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %x.ref: = name_reference "x", +// CHECK:STDOUT: %x.ref: = name_reference x, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/basics/fail_non_type_as_type.carbon b/toolchain/check/testdata/basics/fail_non_type_as_type.carbon index 97c4a4337400..ff054e96a5df 100644 --- a/toolchain/check/testdata/basics/fail_non_type_as_type.carbon +++ b/toolchain/check/testdata/basics/fail_non_type_as_type.carbon @@ -10,8 +10,8 @@ var x: type = 42; // CHECK:STDOUT: file "fail_non_type_as_type.carbon" { -// CHECK:STDOUT: %x.var: ref type = var "x" -// CHECK:STDOUT: %x: ref type = bind_name "x", %x.var +// CHECK:STDOUT: %x.var: ref type = var x +// CHECK:STDOUT: %x: ref type = bind_name x, %x.var // CHECK:STDOUT: %.loc10: i32 = int_literal 42 // CHECK:STDOUT: assign %x.var, // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/basics/fail_qualifier_unsupported.carbon b/toolchain/check/testdata/basics/fail_qualifier_unsupported.carbon index a33e2625ac27..eae97caa2fb8 100644 --- a/toolchain/check/testdata/basics/fail_qualifier_unsupported.carbon +++ b/toolchain/check/testdata/basics/fail_qualifier_unsupported.carbon @@ -11,10 +11,10 @@ var x: i32; var y: i32 = x.b; // CHECK:STDOUT: file "fail_qualifier_unsupported.carbon" { -// CHECK:STDOUT: %x.var: ref i32 = var "x" -// CHECK:STDOUT: %x: ref i32 = bind_name "x", %x.var -// CHECK:STDOUT: %y.var: ref i32 = var "y" -// CHECK:STDOUT: %y: ref i32 = bind_name "y", %y.var -// CHECK:STDOUT: %x.ref: ref i32 = name_reference "x", %x +// CHECK:STDOUT: %x.var: ref i32 = var x +// CHECK:STDOUT: %x: ref i32 = bind_name x, %x.var +// CHECK:STDOUT: %y.var: ref i32 = var y +// CHECK:STDOUT: %y: ref i32 = bind_name y, %y.var +// CHECK:STDOUT: %x.ref: ref i32 = name_reference x, %x // CHECK:STDOUT: assign %y.var, // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/basics/multifile_raw_and_textual_ir.carbon b/toolchain/check/testdata/basics/multifile_raw_and_textual_ir.carbon index 9c64cff75fc4..94da86a57bd3 100644 --- a/toolchain/check/testdata/basics/multifile_raw_and_textual_ir.carbon +++ b/toolchain/check/testdata/basics/multifile_raw_and_textual_ir.carbon @@ -19,7 +19,7 @@ fn B() {} // CHECK:STDOUT: sem_ir: // CHECK:STDOUT: cross_reference_irs_size: 1 // CHECK:STDOUT: functions: -// CHECK:STDOUT: function0: {name: strId0, param_refs: block0, body: [block1]} +// CHECK:STDOUT: function0: {name: name0, param_refs: block0, body: [block1]} // CHECK:STDOUT: classes: {} // CHECK:STDOUT: types: // CHECK:STDOUT: type0: {inst: instFunctionType, value_rep: {kind: copy, type: type0}} @@ -48,7 +48,7 @@ fn B() {} // CHECK:STDOUT: sem_ir: // CHECK:STDOUT: cross_reference_irs_size: 1 // CHECK:STDOUT: functions: -// CHECK:STDOUT: function0: {name: strId0, param_refs: block0, body: [block1]} +// CHECK:STDOUT: function0: {name: name0, param_refs: block0, body: [block1]} // CHECK:STDOUT: classes: {} // CHECK:STDOUT: types: // CHECK:STDOUT: type0: {inst: instFunctionType, value_rep: {kind: copy, type: type0}} diff --git a/toolchain/check/testdata/basics/multifile_raw_ir.carbon b/toolchain/check/testdata/basics/multifile_raw_ir.carbon index 0798479f0ae7..7c8b34960146 100644 --- a/toolchain/check/testdata/basics/multifile_raw_ir.carbon +++ b/toolchain/check/testdata/basics/multifile_raw_ir.carbon @@ -19,7 +19,7 @@ fn B() {} // CHECK:STDOUT: sem_ir: // CHECK:STDOUT: cross_reference_irs_size: 1 // CHECK:STDOUT: functions: -// CHECK:STDOUT: function0: {name: strId0, param_refs: block0, body: [block1]} +// CHECK:STDOUT: function0: {name: name0, param_refs: block0, body: [block1]} // CHECK:STDOUT: classes: {} // CHECK:STDOUT: types: // CHECK:STDOUT: type0: {inst: instFunctionType, value_rep: {kind: copy, type: type0}} @@ -39,7 +39,7 @@ fn B() {} // CHECK:STDOUT: sem_ir: // CHECK:STDOUT: cross_reference_irs_size: 1 // CHECK:STDOUT: functions: -// CHECK:STDOUT: function0: {name: strId0, param_refs: block0, body: [block1]} +// CHECK:STDOUT: function0: {name: name0, param_refs: block0, body: [block1]} // CHECK:STDOUT: classes: {} // CHECK:STDOUT: types: // CHECK:STDOUT: type0: {inst: instFunctionType, value_rep: {kind: copy, type: type0}} diff --git a/toolchain/check/testdata/basics/numeric_literals.carbon b/toolchain/check/testdata/basics/numeric_literals.carbon index 1af6d5b033e2..c63ec07fe231 100644 --- a/toolchain/check/testdata/basics/numeric_literals.carbon +++ b/toolchain/check/testdata/basics/numeric_literals.carbon @@ -40,8 +40,8 @@ fn F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc10_19: i32 = int_literal 5 // CHECK:STDOUT: %.loc10_20: type = array_type %.loc10_19, i32 -// CHECK:STDOUT: %ints.var: ref [i32; 5] = var "ints" -// CHECK:STDOUT: %ints: ref [i32; 5] = bind_name "ints", %ints.var +// CHECK:STDOUT: %ints.var: ref [i32; 5] = var ints +// CHECK:STDOUT: %ints: ref [i32; 5] = bind_name ints, %ints.var // CHECK:STDOUT: %.loc11: i32 = int_literal 8 // CHECK:STDOUT: %.loc12: i32 = int_literal 9 // CHECK:STDOUT: %.loc13: i32 = int_literal 8 @@ -67,8 +67,8 @@ fn F() { // CHECK:STDOUT: assign %ints.var, %.loc16_3.17 // CHECK:STDOUT: %.loc17_21: i32 = int_literal 7 // CHECK:STDOUT: %.loc17_22: type = array_type %.loc17_21, f64 -// CHECK:STDOUT: %floats.var: ref [f64; 7] = var "floats" -// CHECK:STDOUT: %floats: ref [f64; 7] = bind_name "floats", %floats.var +// CHECK:STDOUT: %floats.var: ref [f64; 7] = var floats +// CHECK:STDOUT: %floats: ref [f64; 7] = bind_name floats, %floats.var // CHECK:STDOUT: %.loc18: f64 = real_literal 9e-1 // CHECK:STDOUT: %.loc19: f64 = real_literal 80e-1 // CHECK:STDOUT: %.loc20: f64 = real_literal 800e-1 diff --git a/toolchain/check/testdata/basics/parens.carbon b/toolchain/check/testdata/basics/parens.carbon index a47c02bfc621..edd4e822c8a0 100644 --- a/toolchain/check/testdata/basics/parens.carbon +++ b/toolchain/check/testdata/basics/parens.carbon @@ -7,8 +7,8 @@ var test_i32: i32 = ((1) + (2)); // CHECK:STDOUT: file "parens.carbon" { -// CHECK:STDOUT: %test_i32.var: ref i32 = var "test_i32" -// CHECK:STDOUT: %test_i32: ref i32 = bind_name "test_i32", %test_i32.var +// CHECK:STDOUT: %test_i32.var: ref i32 = var test_i32 +// CHECK:STDOUT: %test_i32: ref i32 = bind_name test_i32, %test_i32.var // CHECK:STDOUT: %.loc7_23: i32 = int_literal 1 // CHECK:STDOUT: %.loc7_29: i32 = int_literal 2 // CHECK:STDOUT: %.loc7_26: i32 = add %.loc7_23, %.loc7_29 diff --git a/toolchain/check/testdata/basics/raw_and_textual_ir.carbon b/toolchain/check/testdata/basics/raw_and_textual_ir.carbon index a608e43caa85..8f13483df6cc 100644 --- a/toolchain/check/testdata/basics/raw_and_textual_ir.carbon +++ b/toolchain/check/testdata/basics/raw_and_textual_ir.carbon @@ -17,7 +17,7 @@ fn Foo(n: i32) -> (i32, f64) { // CHECK:STDOUT: sem_ir: // CHECK:STDOUT: cross_reference_irs_size: 1 // CHECK:STDOUT: functions: -// CHECK:STDOUT: function0: {name: strId0, param_refs: block1, return_type: type3, return_slot: inst+4, body: [block4]} +// CHECK:STDOUT: function0: {name: name0, param_refs: block1, return_type: type3, return_slot: inst+4, body: [block4]} // CHECK:STDOUT: classes: {} // CHECK:STDOUT: types: // CHECK:STDOUT: type0: {inst: instIntegerType, value_rep: {kind: copy, type: type0}} @@ -34,14 +34,14 @@ fn Foo(n: i32) -> (i32, f64) { // CHECK:STDOUT: 0: type0 // CHECK:STDOUT: 1: type2 // CHECK:STDOUT: insts: -// CHECK:STDOUT: inst+0: {kind: Parameter, arg0: strId1, type: type0} +// CHECK:STDOUT: inst+0: {kind: Parameter, arg0: name1, type: type0} // CHECK:STDOUT: inst+1: {kind: TupleType, arg0: typeBlock0, type: typeTypeType} // CHECK:STDOUT: inst+2: {kind: TupleLiteral, arg0: block2, type: type1} // CHECK:STDOUT: inst+3: {kind: TupleType, arg0: typeBlock1, type: typeTypeType} -// CHECK:STDOUT: inst+4: {kind: VarStorage, arg0: strId2, type: type3} +// CHECK:STDOUT: inst+4: {kind: VarStorage, arg0: nameReturnSlot, type: type3} // CHECK:STDOUT: inst+5: {kind: PointerType, arg0: type3, type: typeTypeType} // CHECK:STDOUT: inst+6: {kind: FunctionDeclaration, arg0: function0, type: type5} -// CHECK:STDOUT: inst+7: {kind: NameReference, arg0: strId1, arg1: inst+0, type: type0} +// CHECK:STDOUT: inst+7: {kind: NameReference, arg0: name1, arg1: inst+0, type: type0} // CHECK:STDOUT: inst+8: {kind: IntegerLiteral, arg0: int3, type: type0} // CHECK:STDOUT: inst+9: {kind: BinaryOperatorAdd, arg0: inst+7, arg1: inst+8, type: type0} // CHECK:STDOUT: inst+10: {kind: RealLiteral, arg0: real0, type: type2} @@ -97,7 +97,7 @@ fn Foo(n: i32) -> (i32, f64) { // CHECK:STDOUT: // CHECK:STDOUT: fn @Foo(%n: i32) -> %return: (i32, f64) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.ref: i32 = name_reference "n", %n +// CHECK:STDOUT: %n.ref: i32 = name_reference n, %n // CHECK:STDOUT: %.loc12_15: i32 = int_literal 2 // CHECK:STDOUT: %.loc12_13: i32 = add %n.ref, %.loc12_15 // CHECK:STDOUT: %.loc12_18: f64 = real_literal 34e-1 diff --git a/toolchain/check/testdata/basics/raw_identifier.carbon b/toolchain/check/testdata/basics/raw_identifier.carbon index 420cbea31795..9370b2ef0697 100644 --- a/toolchain/check/testdata/basics/raw_identifier.carbon +++ b/toolchain/check/testdata/basics/raw_identifier.carbon @@ -28,18 +28,18 @@ fn C(r#if: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @A(%n: i32) -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.ref: i32 = name_reference "n", %n +// CHECK:STDOUT: %n.ref: i32 = name_reference n, %n // CHECK:STDOUT: return %n.ref // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @B(%n: i32) -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.ref: i32 = name_reference "n", %n +// CHECK:STDOUT: %n.ref: i32 = name_reference n, %n // CHECK:STDOUT: return %n.ref // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @C(%if: i32) -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %if.ref: i32 = name_reference "if", %if +// CHECK:STDOUT: %if.ref: i32 = name_reference r#if, %if // CHECK:STDOUT: return %if.ref // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/basics/raw_ir.carbon b/toolchain/check/testdata/basics/raw_ir.carbon index f13ece07ad87..6297ecd55ce5 100644 --- a/toolchain/check/testdata/basics/raw_ir.carbon +++ b/toolchain/check/testdata/basics/raw_ir.carbon @@ -17,7 +17,7 @@ fn Foo(n: i32) -> (i32, f64) { // CHECK:STDOUT: sem_ir: // CHECK:STDOUT: cross_reference_irs_size: 1 // CHECK:STDOUT: functions: -// CHECK:STDOUT: function0: {name: strId0, param_refs: block1, return_type: type3, return_slot: inst+4, body: [block4]} +// CHECK:STDOUT: function0: {name: name0, param_refs: block1, return_type: type3, return_slot: inst+4, body: [block4]} // CHECK:STDOUT: classes: {} // CHECK:STDOUT: types: // CHECK:STDOUT: type0: {inst: instIntegerType, value_rep: {kind: copy, type: type0}} @@ -34,14 +34,14 @@ fn Foo(n: i32) -> (i32, f64) { // CHECK:STDOUT: 0: type0 // CHECK:STDOUT: 1: type2 // CHECK:STDOUT: insts: -// CHECK:STDOUT: inst+0: {kind: Parameter, arg0: strId1, type: type0} +// CHECK:STDOUT: inst+0: {kind: Parameter, arg0: name1, type: type0} // CHECK:STDOUT: inst+1: {kind: TupleType, arg0: typeBlock0, type: typeTypeType} // CHECK:STDOUT: inst+2: {kind: TupleLiteral, arg0: block2, type: type1} // CHECK:STDOUT: inst+3: {kind: TupleType, arg0: typeBlock1, type: typeTypeType} -// CHECK:STDOUT: inst+4: {kind: VarStorage, arg0: strId2, type: type3} +// CHECK:STDOUT: inst+4: {kind: VarStorage, arg0: nameReturnSlot, type: type3} // CHECK:STDOUT: inst+5: {kind: PointerType, arg0: type3, type: typeTypeType} // CHECK:STDOUT: inst+6: {kind: FunctionDeclaration, arg0: function0, type: type5} -// CHECK:STDOUT: inst+7: {kind: NameReference, arg0: strId1, arg1: inst+0, type: type0} +// CHECK:STDOUT: inst+7: {kind: NameReference, arg0: name1, arg1: inst+0, type: type0} // CHECK:STDOUT: inst+8: {kind: IntegerLiteral, arg0: int3, type: type0} // CHECK:STDOUT: inst+9: {kind: BinaryOperatorAdd, arg0: inst+7, arg1: inst+8, type: type0} // CHECK:STDOUT: inst+10: {kind: RealLiteral, arg0: real0, type: type2} diff --git a/toolchain/check/testdata/basics/textual_ir.carbon b/toolchain/check/testdata/basics/textual_ir.carbon index 282896e408d9..530d640a9597 100644 --- a/toolchain/check/testdata/basics/textual_ir.carbon +++ b/toolchain/check/testdata/basics/textual_ir.carbon @@ -24,7 +24,7 @@ fn Foo(n: i32) -> (i32, f64) { // CHECK:STDOUT: // CHECK:STDOUT: fn @Foo(%n: i32) -> %return: (i32, f64) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.ref: i32 = name_reference "n", %n +// CHECK:STDOUT: %n.ref: i32 = name_reference n, %n // CHECK:STDOUT: %.loc12_15: i32 = int_literal 2 // CHECK:STDOUT: %.loc12_13: i32 = add %n.ref, %.loc12_15 // CHECK:STDOUT: %.loc12_18: f64 = real_literal 34e-1 diff --git a/toolchain/check/testdata/class/basic.carbon b/toolchain/check/testdata/class/basic.carbon index 9d6361b62204..4437156cca1d 100644 --- a/toolchain/check/testdata/class/basic.carbon +++ b/toolchain/check/testdata/class/basic.carbon @@ -37,8 +37,8 @@ fn Run() -> i32 { // CHECK:STDOUT: %F: = fn_decl @F // CHECK:STDOUT: %G: = fn_decl @G // CHECK:STDOUT: %.loc14_8.1: type = unbound_field_type Class, i32 -// CHECK:STDOUT: %.loc14_8.2: = field "k", member0 -// CHECK:STDOUT: %k: = bind_name "k", %.loc14_8.2 +// CHECK:STDOUT: %.loc14_8.2: = field k, member0 +// CHECK:STDOUT: %k: = bind_name k, %.loc14_8.2 // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F @@ -48,20 +48,20 @@ fn Run() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%n: i32) -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.ref: i32 = name_reference "n", %n +// CHECK:STDOUT: %n.ref: i32 = name_reference n, %n // CHECK:STDOUT: return %n.ref // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @G(%n: i32) -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.ref: i32 = name_reference "n", %n +// CHECK:STDOUT: %n.ref: i32 = name_reference n, %n // CHECK:STDOUT: return %n.ref // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Class.ref: type = name_reference "Class", file.%Class -// CHECK:STDOUT: %F.ref: = name_reference "F", @Class.%F +// CHECK:STDOUT: %Class.ref: type = name_reference Class, file.%Class +// CHECK:STDOUT: %F.ref: = name_reference F, @Class.%F // CHECK:STDOUT: %.loc22_18: i32 = int_literal 4 // CHECK:STDOUT: %.loc22_17: init i32 = call %F.ref(%.loc22_18) // CHECK:STDOUT: %.loc22_20: i32 = value_of_initializer %.loc22_17 diff --git a/toolchain/check/testdata/class/fail_addr_self.carbon b/toolchain/check/testdata/class/fail_addr_self.carbon index 888cd7389178..a46f986cbb2b 100644 --- a/toolchain/check/testdata/class/fail_addr_self.carbon +++ b/toolchain/check/testdata/class/fail_addr_self.carbon @@ -65,18 +65,18 @@ fn F(c: Class, p: Class*) { // CHECK:STDOUT: // CHECK:STDOUT: fn @F.2(%c: Class, %p: Class*) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %c.ref.loc19: Class = name_reference "c", %c +// CHECK:STDOUT: %c.ref.loc19: Class = name_reference c, %c // CHECK:STDOUT: %.loc19_4: = bound_method %c.ref.loc19, @Class.%F // CHECK:STDOUT: %.loc19_6: init () = call %.loc19_4() -// CHECK:STDOUT: %c.ref.loc27: Class = name_reference "c", %c +// CHECK:STDOUT: %c.ref.loc27: Class = name_reference c, %c // CHECK:STDOUT: %.loc27_4: = bound_method %c.ref.loc27, @Class.%G // CHECK:STDOUT: %.loc27_6: init () = call %.loc27_4() -// CHECK:STDOUT: %p.ref.loc30: Class* = name_reference "p", %p +// CHECK:STDOUT: %p.ref.loc30: Class* = name_reference p, %p // CHECK:STDOUT: %.loc30_4.1: ref Class = dereference %p.ref.loc30 // CHECK:STDOUT: %.loc30_7: = bound_method %.loc30_4.1, @Class.%F // CHECK:STDOUT: %.loc30_4.2: Class* = address_of %.loc30_4.1 // CHECK:STDOUT: %.loc30_9: init () = call %.loc30_7(%.loc30_4.2) -// CHECK:STDOUT: %p.ref.loc38: Class* = name_reference "p", %p +// CHECK:STDOUT: %p.ref.loc38: Class* = name_reference p, %p // CHECK:STDOUT: %.loc38_4.1: ref Class = dereference %p.ref.loc38 // CHECK:STDOUT: %.loc38_7: = bound_method %.loc38_4.1, @Class.%G // CHECK:STDOUT: %.loc38_4.2: Class* = address_of %.loc38_4.1 diff --git a/toolchain/check/testdata/class/fail_incomplete.carbon b/toolchain/check/testdata/class/fail_incomplete.carbon index c2317188e722..ec5984ffcd93 100644 --- a/toolchain/check/testdata/class/fail_incomplete.carbon +++ b/toolchain/check/testdata/class/fail_incomplete.carbon @@ -125,9 +125,9 @@ fn CallReturnIncomplete() { // CHECK:STDOUT: %Class: type = class_type @Class // CHECK:STDOUT: %.loc15: = fn_decl @.1 // CHECK:STDOUT: %CallClassFunction: = fn_decl @CallClassFunction -// CHECK:STDOUT: %Class.ref: type = name_reference "Class", %Class -// CHECK:STDOUT: %global_var.var: ref = var "global_var" -// CHECK:STDOUT: %global_var: ref = bind_name "global_var", %global_var.var +// CHECK:STDOUT: %Class.ref: type = name_reference Class, %Class +// CHECK:STDOUT: %global_var.var: ref = var global_var +// CHECK:STDOUT: %global_var: ref = bind_name global_var, %global_var.var // CHECK:STDOUT: %ConvertFromStruct: = fn_decl @ConvertFromStruct // CHECK:STDOUT: %MemberAccess: = fn_decl @MemberAccess // CHECK:STDOUT: %Copy: = fn_decl @Copy @@ -147,8 +147,8 @@ fn CallReturnIncomplete() { // CHECK:STDOUT: // CHECK:STDOUT: fn @CallClassFunction() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Class.ref: type = name_reference "Class", file.%Class -// CHECK:STDOUT: %Function.ref: = name_reference "Function", +// CHECK:STDOUT: %Class.ref: type = name_reference Class, file.%Class +// CHECK:STDOUT: %Function.ref: = name_reference Function, // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -160,24 +160,24 @@ fn CallReturnIncomplete() { // CHECK:STDOUT: // CHECK:STDOUT: fn @MemberAccess(%p: Class*) -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: Class* = name_reference "p", %p +// CHECK:STDOUT: %p.ref: Class* = name_reference p, %p // CHECK:STDOUT: %.loc55: ref Class = dereference %p.ref // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Copy(%p: Class*) -> { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: Class* = name_reference "p", %p +// CHECK:STDOUT: %p.ref: Class* = name_reference p, %p // CHECK:STDOUT: %.loc65: ref Class = dereference %p.ref // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Let(%p: Class*) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Class.ref: type = name_reference "Class", file.%Class -// CHECK:STDOUT: %p.ref: Class* = name_reference "p", %p +// CHECK:STDOUT: %Class.ref: type = name_reference Class, file.%Class +// CHECK:STDOUT: %p.ref: Class* = name_reference p, %p // CHECK:STDOUT: %.loc75: ref Class = dereference %p.ref -// CHECK:STDOUT: %c: = bind_name "c", +// CHECK:STDOUT: %c: = bind_name c, // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -187,11 +187,11 @@ fn CallReturnIncomplete() { // CHECK:STDOUT: // CHECK:STDOUT: fn @CallTakeIncomplete(%p: Class*) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %TakeIncomplete.ref.loc100: = name_reference "TakeIncomplete", file.%TakeIncomplete -// CHECK:STDOUT: %p.ref: Class* = name_reference "p", %p +// CHECK:STDOUT: %TakeIncomplete.ref.loc100: = name_reference TakeIncomplete, file.%TakeIncomplete +// CHECK:STDOUT: %p.ref: Class* = name_reference p, %p // CHECK:STDOUT: %.loc100_18: ref Class = dereference %p.ref // CHECK:STDOUT: %.loc100_17: init () = call %TakeIncomplete.ref.loc100() -// CHECK:STDOUT: %TakeIncomplete.ref.loc111: = name_reference "TakeIncomplete", file.%TakeIncomplete +// CHECK:STDOUT: %TakeIncomplete.ref.loc111: = name_reference TakeIncomplete, file.%TakeIncomplete // CHECK:STDOUT: %.loc111_19: {} = struct_literal () // CHECK:STDOUT: %.loc111_17: init () = call %TakeIncomplete.ref.loc111() // CHECK:STDOUT: return @@ -199,7 +199,7 @@ fn CallReturnIncomplete() { // CHECK:STDOUT: // CHECK:STDOUT: fn @CallReturnIncomplete() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %ReturnIncomplete.ref: = name_reference "ReturnIncomplete", file.%ReturnIncomplete +// CHECK:STDOUT: %ReturnIncomplete.ref: = name_reference ReturnIncomplete, file.%ReturnIncomplete // CHECK:STDOUT: %.loc115: init = call %ReturnIncomplete.ref() // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_init.carbon b/toolchain/check/testdata/class/fail_init.carbon index 33680e459978..0a40d94f464b 100644 --- a/toolchain/check/testdata/class/fail_init.carbon +++ b/toolchain/check/testdata/class/fail_init.carbon @@ -40,11 +40,11 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %.loc8_8.1: type = unbound_field_type Class, i32 -// CHECK:STDOUT: %.loc8_8.2: = field "a", member0 -// CHECK:STDOUT: %a: = bind_name "a", %.loc8_8.2 +// CHECK:STDOUT: %.loc8_8.2: = field a, member0 +// CHECK:STDOUT: %a: = bind_name a, %.loc8_8.2 // CHECK:STDOUT: %.loc9_8.1: type = unbound_field_type Class, i32 -// CHECK:STDOUT: %.loc9_8.2: = field "b", member1 -// CHECK:STDOUT: %b: = bind_name "b", %.loc9_8.2 +// CHECK:STDOUT: %.loc9_8.2: = field b, member1 +// CHECK:STDOUT: %b: = bind_name b, %.loc9_8.2 // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .a = %a @@ -55,13 +55,13 @@ fn F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc16_9: i32 = int_literal 1 // CHECK:STDOUT: %.loc16_10.1: {.a: i32} = struct_literal (%.loc16_9) -// CHECK:STDOUT: %Class.ref.loc16: type = name_reference "Class", file.%Class +// CHECK:STDOUT: %Class.ref.loc16: type = name_reference Class, file.%Class // CHECK:STDOUT: %.loc16_10.2: ref Class = temporary_storage // CHECK:STDOUT: %.loc16_10.3: ref Class = temporary %.loc16_10.2, // CHECK:STDOUT: %.loc20_9: i32 = int_literal 1 // CHECK:STDOUT: %.loc20_17: i32 = int_literal 2 // CHECK:STDOUT: %.loc20_18.1: {.a: i32, .c: i32} = struct_literal (%.loc20_9, %.loc20_17) -// CHECK:STDOUT: %Class.ref.loc20: type = name_reference "Class", file.%Class +// CHECK:STDOUT: %Class.ref.loc20: type = name_reference Class, file.%Class // CHECK:STDOUT: %.loc20_18.2: ref Class = temporary_storage // CHECK:STDOUT: %.loc20_18.3: ref i32 = class_field_access %.loc20_18.2, member0 // CHECK:STDOUT: %.loc20_18.4: init i32 = initialize_from %.loc20_9 to %.loc20_18.3 @@ -70,7 +70,7 @@ fn F() { // CHECK:STDOUT: %.loc24_17: i32 = int_literal 2 // CHECK:STDOUT: %.loc24_25: i32 = int_literal 3 // CHECK:STDOUT: %.loc24_26.1: {.a: i32, .b: i32, .c: i32} = struct_literal (%.loc24_9, %.loc24_17, %.loc24_25) -// CHECK:STDOUT: %Class.ref.loc24: type = name_reference "Class", file.%Class +// CHECK:STDOUT: %Class.ref.loc24: type = name_reference Class, file.%Class // CHECK:STDOUT: %.loc24_26.2: ref Class = temporary_storage // CHECK:STDOUT: %.loc24_26.3: ref Class = temporary %.loc24_26.2, // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/class/fail_init_as_inplace.carbon b/toolchain/check/testdata/class/fail_init_as_inplace.carbon index c481a51c3bbc..a7b25edb0a98 100644 --- a/toolchain/check/testdata/class/fail_init_as_inplace.carbon +++ b/toolchain/check/testdata/class/fail_init_as_inplace.carbon @@ -37,11 +37,11 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %.loc8_8.1: type = unbound_field_type Class, i32 -// CHECK:STDOUT: %.loc8_8.2: = field "a", member0 -// CHECK:STDOUT: %a: = bind_name "a", %.loc8_8.2 +// CHECK:STDOUT: %.loc8_8.2: = field a, member0 +// CHECK:STDOUT: %a: = bind_name a, %.loc8_8.2 // CHECK:STDOUT: %.loc9_8.1: type = unbound_field_type Class, i32 -// CHECK:STDOUT: %.loc9_8.2: = field "b", member1 -// CHECK:STDOUT: %b: = bind_name "b", %.loc9_8.2 +// CHECK:STDOUT: %.loc9_8.2: = field b, member1 +// CHECK:STDOUT: %b: = bind_name b, %.loc9_8.2 // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .a = %a @@ -52,13 +52,13 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Class.ref.loc21_10: type = name_reference "Class", file.%Class -// CHECK:STDOUT: %c.var: ref Class = var "c" -// CHECK:STDOUT: %c: ref Class = bind_name "c", %c.var +// CHECK:STDOUT: %Class.ref.loc21_10: type = name_reference Class, file.%Class +// CHECK:STDOUT: %c.var: ref Class = var c +// CHECK:STDOUT: %c: ref Class = bind_name c, %c.var // CHECK:STDOUT: %.loc21_24: i32 = int_literal 1 // CHECK:STDOUT: %.loc21_32: i32 = int_literal 2 // CHECK:STDOUT: %.loc21_33.1: {.a: i32, .b: i32} = struct_literal (%.loc21_24, %.loc21_32) -// CHECK:STDOUT: %Class.ref.loc21_38: type = name_reference "Class", file.%Class +// CHECK:STDOUT: %Class.ref.loc21_38: type = name_reference Class, file.%Class // CHECK:STDOUT: %.loc21_33.2: ref Class = temporary_storage // CHECK:STDOUT: %.loc21_33.3: ref i32 = class_field_access %.loc21_33.2, member0 // CHECK:STDOUT: %.loc21_33.4: init i32 = initialize_from %.loc21_24 to %.loc21_33.3 @@ -68,8 +68,8 @@ fn F() { // CHECK:STDOUT: %.loc21_33.8: ref Class = temporary %.loc21_33.2, %.loc21_33.7 // CHECK:STDOUT: %.loc21_33.9: Class = bind_value %.loc21_33.8 // CHECK:STDOUT: assign %c.var, -// CHECK:STDOUT: %G.ref: = name_reference "G", file.%G -// CHECK:STDOUT: %c.ref: ref Class = name_reference "c", %c +// CHECK:STDOUT: %G.ref: = name_reference G, file.%G +// CHECK:STDOUT: %c.ref: ref Class = name_reference c, %c // CHECK:STDOUT: %.loc22_5: Class* = address_of %c.ref // CHECK:STDOUT: %.loc22_4: init () = call %G.ref(%.loc22_5) // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/class/fail_memaccess_category.carbon b/toolchain/check/testdata/class/fail_memaccess_category.carbon index 463ccbb38e3c..b2b21555e7bb 100644 --- a/toolchain/check/testdata/class/fail_memaccess_category.carbon +++ b/toolchain/check/testdata/class/fail_memaccess_category.carbon @@ -58,10 +58,10 @@ fn F(s: {.a: A}, b: B) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B { -// CHECK:STDOUT: %A.ref: type = name_reference "A", file.%A +// CHECK:STDOUT: %A.ref: type = name_reference A, file.%A // CHECK:STDOUT: %.loc12_8.1: type = unbound_field_type B, A -// CHECK:STDOUT: %.loc12_8.2: = field "a", member0 -// CHECK:STDOUT: %a: = bind_name "a", %.loc12_8.2 +// CHECK:STDOUT: %.loc12_8.2: = field a, member0 +// CHECK:STDOUT: %a: = bind_name a, %.loc12_8.2 // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .a = %a @@ -71,11 +71,11 @@ fn F(s: {.a: A}, b: B) { // CHECK:STDOUT: // CHECK:STDOUT: fn @F.2(%s: {.a: A}, %b: B) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %s.ref: {.a: A} = name_reference "s", %s +// CHECK:STDOUT: %s.ref: {.a: A} = name_reference s, %s // CHECK:STDOUT: %.loc23_4: A = struct_access %s.ref, member0 // CHECK:STDOUT: %.loc23_6: = bound_method %.loc23_4, @A.%F // CHECK:STDOUT: %.loc23_8: init () = call %.loc23_6() -// CHECK:STDOUT: %b.ref: B = name_reference "b", %b +// CHECK:STDOUT: %b.ref: B = name_reference b, %b // CHECK:STDOUT: %.loc33_4.1: ref A = class_field_access %b.ref, member0 // CHECK:STDOUT: %.loc33_4.2: A = bind_value %.loc33_4.1 // CHECK:STDOUT: %.loc33_6: = bound_method %.loc33_4.2, @A.%F diff --git a/toolchain/check/testdata/class/fail_member_of_let.carbon b/toolchain/check/testdata/class/fail_member_of_let.carbon index 0c3d370aabd7..d86e7ffce9b3 100644 --- a/toolchain/check/testdata/class/fail_member_of_let.carbon +++ b/toolchain/check/testdata/class/fail_member_of_let.carbon @@ -28,8 +28,8 @@ fn T.F() {} // CHECK:STDOUT: file "fail_member_of_let.carbon" { // CHECK:STDOUT: class_declaration @Class, () // CHECK:STDOUT: %Class: type = class_type @Class -// CHECK:STDOUT: %Class.ref: type = name_reference "Class", %Class -// CHECK:STDOUT: %T: type = bind_name "T", %Class.ref +// CHECK:STDOUT: %Class.ref: type = name_reference Class, %Class +// CHECK:STDOUT: %T: type = bind_name T, %Class.ref // CHECK:STDOUT: %.loc22: = fn_decl @.1 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_method.carbon b/toolchain/check/testdata/class/fail_method.carbon index 740157b89a14..a80b8e77ca26 100644 --- a/toolchain/check/testdata/class/fail_method.carbon +++ b/toolchain/check/testdata/class/fail_method.carbon @@ -57,21 +57,21 @@ fn F(c: Class) { // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%c: Class) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %c.ref.loc13: Class = name_reference "c", %c -// CHECK:STDOUT: %NoSelf.ref.loc13: = name_reference "NoSelf", @Class.%NoSelf +// CHECK:STDOUT: %c.ref.loc13: Class = name_reference c, %c +// CHECK:STDOUT: %NoSelf.ref.loc13: = name_reference NoSelf, @Class.%NoSelf // CHECK:STDOUT: %.loc13: init () = call %NoSelf.ref.loc13() -// CHECK:STDOUT: %c.ref.loc14: Class = name_reference "c", %c +// CHECK:STDOUT: %c.ref.loc14: Class = name_reference c, %c // CHECK:STDOUT: %.loc14_4: = bound_method %c.ref.loc14, @Class.%WithSelf // CHECK:STDOUT: %.loc14_13: init () = call %.loc14_4(%c.ref.loc14) -// CHECK:STDOUT: %Class.ref.loc16: type = name_reference "Class", file.%Class -// CHECK:STDOUT: %NoSelf.ref.loc16: = name_reference "NoSelf", @Class.%NoSelf +// CHECK:STDOUT: %Class.ref.loc16: type = name_reference Class, file.%Class +// CHECK:STDOUT: %NoSelf.ref.loc16: = name_reference NoSelf, @Class.%NoSelf // CHECK:STDOUT: %.loc16: init () = call %NoSelf.ref.loc16() -// CHECK:STDOUT: %Class.ref.loc23: type = name_reference "Class", file.%Class -// CHECK:STDOUT: %WithSelf.ref.loc23: = name_reference "WithSelf", @Class.%WithSelf +// CHECK:STDOUT: %Class.ref.loc23: type = name_reference Class, file.%Class +// CHECK:STDOUT: %WithSelf.ref.loc23: = name_reference WithSelf, @Class.%WithSelf // CHECK:STDOUT: %.loc23: init () = call %WithSelf.ref.loc23() -// CHECK:STDOUT: %Class.ref.loc30: type = name_reference "Class", file.%Class -// CHECK:STDOUT: %WithSelf.ref.loc30: = name_reference "WithSelf", @Class.%WithSelf -// CHECK:STDOUT: %c.ref.loc30: Class = name_reference "c", %c +// CHECK:STDOUT: %Class.ref.loc30: type = name_reference Class, file.%Class +// CHECK:STDOUT: %WithSelf.ref.loc30: = name_reference WithSelf, @Class.%WithSelf +// CHECK:STDOUT: %c.ref.loc30: Class = name_reference c, %c // CHECK:STDOUT: %.loc30: init () = call %WithSelf.ref.loc30() // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_reorder.carbon b/toolchain/check/testdata/class/fail_reorder.carbon index 6c5f96b568dc..56007a680d70 100644 --- a/toolchain/check/testdata/class/fail_reorder.carbon +++ b/toolchain/check/testdata/class/fail_reorder.carbon @@ -45,8 +45,8 @@ class Class { // CHECK:STDOUT: // CHECK:STDOUT: fn @G() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Class.ref: type = name_reference "Class", file.%Class -// CHECK:STDOUT: %F.ref: = name_reference "F", +// CHECK:STDOUT: %Class.ref: type = name_reference Class, file.%Class +// CHECK:STDOUT: %F.ref: = name_reference F, // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_scope.carbon b/toolchain/check/testdata/class/fail_scope.carbon index b2b306dd9527..ce5a9ca183c6 100644 --- a/toolchain/check/testdata/class/fail_scope.carbon +++ b/toolchain/check/testdata/class/fail_scope.carbon @@ -42,6 +42,6 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @G() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: = name_reference "F", +// CHECK:STDOUT: %F.ref: = name_reference F, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_self.carbon b/toolchain/check/testdata/class/fail_self.carbon index 9711c0e8951f..e396e86d2649 100644 --- a/toolchain/check/testdata/class/fail_self.carbon +++ b/toolchain/check/testdata/class/fail_self.carbon @@ -89,9 +89,9 @@ fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDOUT: // CHECK:STDOUT: fn @G() -> %return: Class { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Class.ref: type = name_reference "Class", file.%Class +// CHECK:STDOUT: %Class.ref: type = name_reference Class, file.%Class // CHECK:STDOUT: %self: Class = self_parameter false -// CHECK:STDOUT: %self.ref: = name_reference "self", +// CHECK:STDOUT: %self.ref: = name_reference self, // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -99,7 +99,7 @@ fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDOUT: // CHECK:STDOUT: fn @CallWrongSelf(%ws: WrongSelf) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %ws.ref: WrongSelf = name_reference "ws", %ws +// CHECK:STDOUT: %ws.ref: WrongSelf = name_reference ws, %ws // CHECK:STDOUT: %.loc50_5: = bound_method %ws.ref, @WrongSelf.%F // CHECK:STDOUT: %.loc50_7: init () = call %.loc50_5() // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/class/fail_unbound_field.carbon b/toolchain/check/testdata/class/fail_unbound_field.carbon index dac3d1100bcf..ced581e093fe 100644 --- a/toolchain/check/testdata/class/fail_unbound_field.carbon +++ b/toolchain/check/testdata/class/fail_unbound_field.carbon @@ -33,8 +33,8 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %.loc8_12.1: type = unbound_field_type Class, i32 -// CHECK:STDOUT: %.loc8_12.2: = field "field", member0 -// CHECK:STDOUT: %field: = bind_name "field", %.loc8_12.2 +// CHECK:STDOUT: %.loc8_12.2: = field field, member0 +// CHECK:STDOUT: %field: = bind_name field, %.loc8_12.2 // CHECK:STDOUT: %F: = fn_decl @F // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -44,13 +44,13 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %field.ref: = name_reference "field", @Class.%field +// CHECK:STDOUT: %field.ref: = name_reference field, @Class.%field // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @G() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Class.ref: type = name_reference "Class", file.%Class -// CHECK:STDOUT: %field.ref: = name_reference "field", @Class.%field +// CHECK:STDOUT: %Class.ref: type = name_reference Class, file.%Class +// CHECK:STDOUT: %field.ref: = name_reference field, @Class.%field // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_unknown_member.carbon b/toolchain/check/testdata/class/fail_unknown_member.carbon index 2ad0dd53040d..9a56239727e2 100644 --- a/toolchain/check/testdata/class/fail_unknown_member.carbon +++ b/toolchain/check/testdata/class/fail_unknown_member.carbon @@ -29,8 +29,8 @@ fn G(c: Class) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %.loc8_8.1: type = unbound_field_type Class, i32 -// CHECK:STDOUT: %.loc8_8.2: = field "n", member0 -// CHECK:STDOUT: %n: = bind_name "n", %.loc8_8.2 +// CHECK:STDOUT: %.loc8_8.2: = field n, member0 +// CHECK:STDOUT: %n: = bind_name n, %.loc8_8.2 // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .n = %n @@ -38,7 +38,7 @@ fn G(c: Class) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @G(%c: Class) -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %c.ref: Class = name_reference "c", %c -// CHECK:STDOUT: %something.ref: = name_reference "something", +// CHECK:STDOUT: %c.ref: Class = name_reference c, %c +// CHECK:STDOUT: %something.ref: = name_reference something, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/field_access.carbon b/toolchain/check/testdata/class/field_access.carbon index 8ccae3abea01..2043142ec31e 100644 --- a/toolchain/check/testdata/class/field_access.carbon +++ b/toolchain/check/testdata/class/field_access.carbon @@ -29,11 +29,11 @@ fn Run() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %.loc8_8.1: type = unbound_field_type Class, i32 -// CHECK:STDOUT: %.loc8_8.2: = field "j", member0 -// CHECK:STDOUT: %j: = bind_name "j", %.loc8_8.2 +// CHECK:STDOUT: %.loc8_8.2: = field j, member0 +// CHECK:STDOUT: %j: = bind_name j, %.loc8_8.2 // CHECK:STDOUT: %.loc9_8.1: type = unbound_field_type Class, i32 -// CHECK:STDOUT: %.loc9_8.2: = field "k", member1 -// CHECK:STDOUT: %k: = bind_name "k", %.loc9_8.2 +// CHECK:STDOUT: %.loc9_8.2: = field k, member1 +// CHECK:STDOUT: %k: = bind_name k, %.loc9_8.2 // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .j = %j @@ -42,20 +42,20 @@ fn Run() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Class.ref: type = name_reference "Class", file.%Class -// CHECK:STDOUT: %c.var: ref Class = var "c" -// CHECK:STDOUT: %c: ref Class = bind_name "c", %c.var -// CHECK:STDOUT: %c.ref.loc14: ref Class = name_reference "c", %c +// CHECK:STDOUT: %Class.ref: type = name_reference Class, file.%Class +// CHECK:STDOUT: %c.var: ref Class = var c +// CHECK:STDOUT: %c: ref Class = bind_name c, %c.var +// CHECK:STDOUT: %c.ref.loc14: ref Class = name_reference c, %c // CHECK:STDOUT: %.loc14_4: ref i32 = class_field_access %c.ref.loc14, member0 // CHECK:STDOUT: %.loc14_9: i32 = int_literal 1 // CHECK:STDOUT: assign %.loc14_4, %.loc14_9 -// CHECK:STDOUT: %c.ref.loc15: ref Class = name_reference "c", %c +// CHECK:STDOUT: %c.ref.loc15: ref Class = name_reference c, %c // CHECK:STDOUT: %.loc15_4: ref i32 = class_field_access %c.ref.loc15, member1 // CHECK:STDOUT: %.loc15_9: i32 = int_literal 2 // CHECK:STDOUT: assign %.loc15_4, %.loc15_9 -// CHECK:STDOUT: %c.ref.loc16_10: ref Class = name_reference "c", %c +// CHECK:STDOUT: %c.ref.loc16_10: ref Class = name_reference c, %c // CHECK:STDOUT: %.loc16_11.1: ref i32 = class_field_access %c.ref.loc16_10, member0 -// CHECK:STDOUT: %c.ref.loc16_16: ref Class = name_reference "c", %c +// CHECK:STDOUT: %c.ref.loc16_16: ref Class = name_reference c, %c // CHECK:STDOUT: %.loc16_17.1: ref i32 = class_field_access %c.ref.loc16_16, member1 // CHECK:STDOUT: %.loc16_11.2: i32 = bind_value %.loc16_11.1 // CHECK:STDOUT: %.loc16_17.2: i32 = bind_value %.loc16_17.1 diff --git a/toolchain/check/testdata/class/field_access_in_value.carbon b/toolchain/check/testdata/class/field_access_in_value.carbon index 5d230e0ce6ac..ba4069d11fff 100644 --- a/toolchain/check/testdata/class/field_access_in_value.carbon +++ b/toolchain/check/testdata/class/field_access_in_value.carbon @@ -30,11 +30,11 @@ fn Run() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %.loc8_8.1: type = unbound_field_type Class, i32 -// CHECK:STDOUT: %.loc8_8.2: = field "j", member0 -// CHECK:STDOUT: %j: = bind_name "j", %.loc8_8.2 +// CHECK:STDOUT: %.loc8_8.2: = field j, member0 +// CHECK:STDOUT: %j: = bind_name j, %.loc8_8.2 // CHECK:STDOUT: %.loc9_8.1: type = unbound_field_type Class, i32 -// CHECK:STDOUT: %.loc9_8.2: = field "k", member1 -// CHECK:STDOUT: %k: = bind_name "k", %.loc9_8.2 +// CHECK:STDOUT: %.loc9_8.2: = field k, member1 +// CHECK:STDOUT: %k: = bind_name k, %.loc9_8.2 // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .j = %j @@ -43,25 +43,25 @@ fn Run() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Class.ref.loc13: type = name_reference "Class", file.%Class -// CHECK:STDOUT: %cv.var: ref Class = var "cv" -// CHECK:STDOUT: %cv: ref Class = bind_name "cv", %cv.var -// CHECK:STDOUT: %cv.ref.loc14: ref Class = name_reference "cv", %cv +// CHECK:STDOUT: %Class.ref.loc13: type = name_reference Class, file.%Class +// CHECK:STDOUT: %cv.var: ref Class = var cv +// CHECK:STDOUT: %cv: ref Class = bind_name cv, %cv.var +// CHECK:STDOUT: %cv.ref.loc14: ref Class = name_reference cv, %cv // CHECK:STDOUT: %.loc14_5: ref i32 = class_field_access %cv.ref.loc14, member0 // CHECK:STDOUT: %.loc14_10: i32 = int_literal 1 // CHECK:STDOUT: assign %.loc14_5, %.loc14_10 -// CHECK:STDOUT: %cv.ref.loc15: ref Class = name_reference "cv", %cv +// CHECK:STDOUT: %cv.ref.loc15: ref Class = name_reference cv, %cv // CHECK:STDOUT: %.loc15_5: ref i32 = class_field_access %cv.ref.loc15, member1 // CHECK:STDOUT: %.loc15_10: i32 = int_literal 2 // CHECK:STDOUT: assign %.loc15_5, %.loc15_10 -// CHECK:STDOUT: %Class.ref.loc16: type = name_reference "Class", file.%Class -// CHECK:STDOUT: %cv.ref.loc16: ref Class = name_reference "cv", %cv +// CHECK:STDOUT: %Class.ref.loc16: type = name_reference Class, file.%Class +// CHECK:STDOUT: %cv.ref.loc16: ref Class = name_reference cv, %cv // CHECK:STDOUT: %.loc16: Class = bind_value %cv.ref.loc16 -// CHECK:STDOUT: %c: Class = bind_name "c", %.loc16 -// CHECK:STDOUT: %c.ref.loc17_10: Class = name_reference "c", %c +// CHECK:STDOUT: %c: Class = bind_name c, %.loc16 +// CHECK:STDOUT: %c.ref.loc17_10: Class = name_reference c, %c // CHECK:STDOUT: %.loc17_11.1: ref i32 = class_field_access %c.ref.loc17_10, member0 // CHECK:STDOUT: %.loc17_11.2: i32 = bind_value %.loc17_11.1 -// CHECK:STDOUT: %c.ref.loc17_16: Class = name_reference "c", %c +// CHECK:STDOUT: %c.ref.loc17_16: Class = name_reference c, %c // CHECK:STDOUT: %.loc17_17.1: ref i32 = class_field_access %c.ref.loc17_16, member1 // CHECK:STDOUT: %.loc17_17.2: i32 = bind_value %.loc17_17.1 // CHECK:STDOUT: %.loc17_14: i32 = add %.loc17_11.2, %.loc17_17.2 diff --git a/toolchain/check/testdata/class/forward_declared.carbon b/toolchain/check/testdata/class/forward_declared.carbon index acdb2d9d0925..0542cc653bc5 100644 --- a/toolchain/check/testdata/class/forward_declared.carbon +++ b/toolchain/check/testdata/class/forward_declared.carbon @@ -18,6 +18,6 @@ fn F(p: Class*) -> Class* { return p; } // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%p: Class*) -> Class* { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: Class* = name_reference "p", %p +// CHECK:STDOUT: %p.ref: Class* = name_reference p, %p // CHECK:STDOUT: return %p.ref // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/init.carbon b/toolchain/check/testdata/class/init.carbon index 024b3533a94c..e604b1503b9f 100644 --- a/toolchain/check/testdata/class/init.carbon +++ b/toolchain/check/testdata/class/init.carbon @@ -32,13 +32,13 @@ fn MakeReorder(n: i32, next: Class*) -> Class { // CHECK:STDOUT: // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %.loc8_8.1: type = unbound_field_type Class, i32 -// CHECK:STDOUT: %.loc8_8.2: = field "n", member0 -// CHECK:STDOUT: %n: = bind_name "n", %.loc8_8.2 -// CHECK:STDOUT: %Class.ref: type = name_reference "Class", file.%Class +// CHECK:STDOUT: %.loc8_8.2: = field n, member0 +// CHECK:STDOUT: %n: = bind_name n, %.loc8_8.2 +// CHECK:STDOUT: %Class.ref: type = name_reference Class, file.%Class // CHECK:STDOUT: %.loc9_18: type = ptr_type Class // CHECK:STDOUT: %.loc9_11.1: type = unbound_field_type Class, Class* -// CHECK:STDOUT: %.loc9_11.2: = field "next", member1 -// CHECK:STDOUT: %next: = bind_name "next", %.loc9_11.2 +// CHECK:STDOUT: %.loc9_11.2: = field next, member1 +// CHECK:STDOUT: %next: = bind_name next, %.loc9_11.2 // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .n = %n @@ -47,8 +47,8 @@ fn MakeReorder(n: i32, next: Class*) -> Class { // CHECK:STDOUT: // CHECK:STDOUT: fn @Make(%n: i32, %next: Class*) -> %return: Class { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.ref: i32 = name_reference "n", %n -// CHECK:STDOUT: %next.ref: Class* = name_reference "next", %next +// CHECK:STDOUT: %n.ref: i32 = name_reference n, %n +// CHECK:STDOUT: %next.ref: Class* = name_reference next, %next // CHECK:STDOUT: %.loc13_31.1: {.n: i32, .next: Class*} = struct_literal (%n.ref, %next.ref) // CHECK:STDOUT: %.loc13_31.2: ref i32 = class_field_access %return, member0 // CHECK:STDOUT: %.loc13_31.3: init i32 = initialize_from %n.ref to %.loc13_31.2 @@ -60,8 +60,8 @@ fn MakeReorder(n: i32, next: Class*) -> Class { // CHECK:STDOUT: // CHECK:STDOUT: fn @MakeReorder(%n: i32, %next: Class*) -> %return: Class { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %next.ref: Class* = name_reference "next", %next -// CHECK:STDOUT: %n.ref: i32 = name_reference "n", %n +// CHECK:STDOUT: %next.ref: Class* = name_reference next, %next +// CHECK:STDOUT: %n.ref: i32 = name_reference n, %n // CHECK:STDOUT: %.loc17_31.1: {.next: Class*, .n: i32} = struct_literal (%next.ref, %n.ref) // CHECK:STDOUT: %.loc17_31.2: ref i32 = class_field_access %return, member1 // CHECK:STDOUT: %.loc17_31.3: init i32 = initialize_from %n.ref to %.loc17_31.2 diff --git a/toolchain/check/testdata/class/init_as.carbon b/toolchain/check/testdata/class/init_as.carbon index 97306e3f418e..d319168ce08a 100644 --- a/toolchain/check/testdata/class/init_as.carbon +++ b/toolchain/check/testdata/class/init_as.carbon @@ -26,11 +26,11 @@ fn F() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %.loc8_8.1: type = unbound_field_type Class, i32 -// CHECK:STDOUT: %.loc8_8.2: = field "a", member0 -// CHECK:STDOUT: %a: = bind_name "a", %.loc8_8.2 +// CHECK:STDOUT: %.loc8_8.2: = field a, member0 +// CHECK:STDOUT: %a: = bind_name a, %.loc8_8.2 // CHECK:STDOUT: %.loc9_8.1: type = unbound_field_type Class, i32 -// CHECK:STDOUT: %.loc9_8.2: = field "b", member1 -// CHECK:STDOUT: %b: = bind_name "b", %.loc9_8.2 +// CHECK:STDOUT: %.loc9_8.2: = field b, member1 +// CHECK:STDOUT: %b: = bind_name b, %.loc9_8.2 // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .a = %a @@ -42,7 +42,7 @@ fn F() -> i32 { // CHECK:STDOUT: %.loc13_17: i32 = int_literal 1 // CHECK:STDOUT: %.loc13_25: i32 = int_literal 2 // CHECK:STDOUT: %.loc13_26.1: {.a: i32, .b: i32} = struct_literal (%.loc13_17, %.loc13_25) -// CHECK:STDOUT: %Class.ref: type = name_reference "Class", file.%Class +// CHECK:STDOUT: %Class.ref: type = name_reference Class, file.%Class // CHECK:STDOUT: %.loc13_26.2: ref Class = temporary_storage // CHECK:STDOUT: %.loc13_26.3: ref i32 = class_field_access %.loc13_26.2, member0 // CHECK:STDOUT: %.loc13_26.4: init i32 = initialize_from %.loc13_17 to %.loc13_26.3 diff --git a/toolchain/check/testdata/class/init_nested.carbon b/toolchain/check/testdata/class/init_nested.carbon index 46ab3916001d..a26b7949dc56 100644 --- a/toolchain/check/testdata/class/init_nested.carbon +++ b/toolchain/check/testdata/class/init_nested.carbon @@ -40,11 +40,11 @@ fn MakeOuter() -> Outer { // CHECK:STDOUT: // CHECK:STDOUT: class @Inner { // CHECK:STDOUT: %.loc8_8.1: type = unbound_field_type Inner, i32 -// CHECK:STDOUT: %.loc8_8.2: = field "a", member0 -// CHECK:STDOUT: %a: = bind_name "a", %.loc8_8.2 +// CHECK:STDOUT: %.loc8_8.2: = field a, member0 +// CHECK:STDOUT: %a: = bind_name a, %.loc8_8.2 // CHECK:STDOUT: %.loc9_8.1: type = unbound_field_type Inner, i32 -// CHECK:STDOUT: %.loc9_8.2: = field "b", member1 -// CHECK:STDOUT: %b: = bind_name "b", %.loc9_8.2 +// CHECK:STDOUT: %.loc9_8.2: = field b, member1 +// CHECK:STDOUT: %b: = bind_name b, %.loc9_8.2 // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .a = %a @@ -52,14 +52,14 @@ fn MakeOuter() -> Outer { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Outer { -// CHECK:STDOUT: %Inner.ref.loc15: type = name_reference "Inner", file.%Inner +// CHECK:STDOUT: %Inner.ref.loc15: type = name_reference Inner, file.%Inner // CHECK:STDOUT: %.loc15_8.1: type = unbound_field_type Outer, Inner -// CHECK:STDOUT: %.loc15_8.2: = field "c", member0 -// CHECK:STDOUT: %c: = bind_name "c", %.loc15_8.2 -// CHECK:STDOUT: %Inner.ref.loc16: type = name_reference "Inner", file.%Inner +// CHECK:STDOUT: %.loc15_8.2: = field c, member0 +// CHECK:STDOUT: %c: = bind_name c, %.loc15_8.2 +// CHECK:STDOUT: %Inner.ref.loc16: type = name_reference Inner, file.%Inner // CHECK:STDOUT: %.loc16_8.1: type = unbound_field_type Outer, Inner -// CHECK:STDOUT: %.loc16_8.2: = field "d", member1 -// CHECK:STDOUT: %d: = bind_name "d", %.loc16_8.2 +// CHECK:STDOUT: %.loc16_8.2: = field d, member1 +// CHECK:STDOUT: %d: = bind_name d, %.loc16_8.2 // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .c = %c @@ -70,10 +70,10 @@ fn MakeOuter() -> Outer { // CHECK:STDOUT: // CHECK:STDOUT: fn @MakeOuter() -> %return: Outer { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %MakeInner.ref.loc20_16: = name_reference "MakeInner", file.%MakeInner +// CHECK:STDOUT: %MakeInner.ref.loc20_16: = name_reference MakeInner, file.%MakeInner // CHECK:STDOUT: %.loc20_45.1: ref Inner = class_field_access %return, member0 // CHECK:STDOUT: %.loc20_25: init Inner = call %MakeInner.ref.loc20_16() to %.loc20_45.1 -// CHECK:STDOUT: %MakeInner.ref.loc20_34: = name_reference "MakeInner", file.%MakeInner +// CHECK:STDOUT: %MakeInner.ref.loc20_34: = name_reference MakeInner, file.%MakeInner // CHECK:STDOUT: %.loc20_45.2: ref Inner = class_field_access %return, member1 // CHECK:STDOUT: %.loc20_43: init Inner = call %MakeInner.ref.loc20_34() to %.loc20_45.2 // CHECK:STDOUT: %.loc20_45.3: {.c: Inner, .d: Inner} = struct_literal (%.loc20_25, %.loc20_43) diff --git a/toolchain/check/testdata/class/method.carbon b/toolchain/check/testdata/class/method.carbon index 8c3a69bf6514..52843320ab5f 100644 --- a/toolchain/check/testdata/class/method.carbon +++ b/toolchain/check/testdata/class/method.carbon @@ -66,8 +66,8 @@ fn CallGOnInitializingExpression() -> i32 { // CHECK:STDOUT: %F: = fn_decl @F // CHECK:STDOUT: %G: = fn_decl @G // CHECK:STDOUT: %.loc11_8.1: type = unbound_field_type Class, i32 -// CHECK:STDOUT: %.loc11_8.2: = field "k", member0 -// CHECK:STDOUT: %k: = bind_name "k", %.loc11_8.2 +// CHECK:STDOUT: %.loc11_8.2: = field k, member0 +// CHECK:STDOUT: %k: = bind_name k, %.loc11_8.2 // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F @@ -77,7 +77,7 @@ fn CallGOnInitializingExpression() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @F[%self: Class]() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %self.ref: Class = name_reference "self", %self +// CHECK:STDOUT: %self.ref: Class = name_reference self, %self // CHECK:STDOUT: %.loc15_14.1: ref i32 = class_field_access %self.ref, member0 // CHECK:STDOUT: %.loc15_14.2: i32 = bind_value %.loc15_14.1 // CHECK:STDOUT: return %.loc15_14.2 @@ -87,7 +87,7 @@ fn CallGOnInitializingExpression() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @Call(%c: Class) -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %c.ref: Class = name_reference "c", %c +// CHECK:STDOUT: %c.ref: Class = name_reference c, %c // CHECK:STDOUT: %.loc21_11: = bound_method %c.ref, @Class.%F // CHECK:STDOUT: %.loc21_13: init i32 = call %.loc21_11(%c.ref) // CHECK:STDOUT: %.loc21_15: i32 = value_of_initializer %.loc21_13 @@ -96,10 +96,10 @@ fn CallGOnInitializingExpression() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @CallWithAddr() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Class.ref: type = name_reference "Class", file.%Class -// CHECK:STDOUT: %c.var: ref Class = var "c" -// CHECK:STDOUT: %c: ref Class = bind_name "c", %c.var -// CHECK:STDOUT: %c.ref: ref Class = name_reference "c", %c +// CHECK:STDOUT: %Class.ref: type = name_reference Class, file.%Class +// CHECK:STDOUT: %c.var: ref Class = var c +// CHECK:STDOUT: %c: ref Class = bind_name c, %c.var +// CHECK:STDOUT: %c.ref: ref Class = name_reference c, %c // CHECK:STDOUT: %.loc26_11: = bound_method %c.ref, @Class.%G // CHECK:STDOUT: %.loc26_10: Class* = address_of %c.ref // CHECK:STDOUT: %.loc26_13: init i32 = call %.loc26_11(%.loc26_10) @@ -109,7 +109,7 @@ fn CallGOnInitializingExpression() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @CallFThroughPointer(%p: Class*) -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: Class* = name_reference "p", %p +// CHECK:STDOUT: %p.ref: Class* = name_reference p, %p // CHECK:STDOUT: %.loc30_11.1: ref Class = dereference %p.ref // CHECK:STDOUT: %.loc30_14: = bound_method %.loc30_11.1, @Class.%F // CHECK:STDOUT: %.loc30_11.2: Class = bind_value %.loc30_11.1 @@ -120,7 +120,7 @@ fn CallGOnInitializingExpression() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @CallGThroughPointer(%p: Class*) -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: Class* = name_reference "p", %p +// CHECK:STDOUT: %p.ref: Class* = name_reference p, %p // CHECK:STDOUT: %.loc34_11.1: ref Class = dereference %p.ref // CHECK:STDOUT: %.loc34_14: = bound_method %.loc34_11.1, @Class.%G // CHECK:STDOUT: %.loc34_11.2: Class* = address_of %.loc34_11.1 @@ -133,7 +133,7 @@ fn CallGOnInitializingExpression() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @CallFOnInitializingExpression() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Make.ref: = name_reference "Make", file.%Make +// CHECK:STDOUT: %Make.ref: = name_reference Make, file.%Make // CHECK:STDOUT: %.loc40_14.1: ref Class = temporary_storage // CHECK:STDOUT: %.loc40_14.2: init Class = call %Make.ref() to %.loc40_14.1 // CHECK:STDOUT: %.loc40_14.3: ref Class = temporary %.loc40_14.1, %.loc40_14.2 @@ -146,7 +146,7 @@ fn CallGOnInitializingExpression() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @CallGOnInitializingExpression() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Make.ref: = name_reference "Make", file.%Make +// CHECK:STDOUT: %Make.ref: = name_reference Make, file.%Make // CHECK:STDOUT: %.loc44_14.1: ref Class = temporary_storage // CHECK:STDOUT: %.loc44_14.2: init Class = call %Make.ref() to %.loc44_14.1 // CHECK:STDOUT: %.loc44_14.3: ref Class = temporary %.loc44_14.1, %.loc44_14.2 diff --git a/toolchain/check/testdata/class/nested.carbon b/toolchain/check/testdata/class/nested.carbon index f80293e35fe3..8c215f824a43 100644 --- a/toolchain/check/testdata/class/nested.carbon +++ b/toolchain/check/testdata/class/nested.carbon @@ -44,21 +44,21 @@ fn F(a: Outer*) { // CHECK:STDOUT: class @Outer { // CHECK:STDOUT: class_declaration @Inner, () // CHECK:STDOUT: %Inner: type = class_type @Inner -// CHECK:STDOUT: %Self.ref: type = name_reference "Self", file.%Outer +// CHECK:STDOUT: %Self.ref: type = name_reference Self, file.%Outer // CHECK:STDOUT: %.loc14_15: type = ptr_type Outer // CHECK:STDOUT: %.loc14_9.1: type = unbound_field_type Outer, Outer* -// CHECK:STDOUT: %.loc14_9.2: = field "po", member0 -// CHECK:STDOUT: %po: = bind_name "po", %.loc14_9.2 -// CHECK:STDOUT: %Outer.ref: type = name_reference "Outer", file.%Outer +// CHECK:STDOUT: %.loc14_9.2: = field po, member0 +// CHECK:STDOUT: %po: = bind_name po, %.loc14_9.2 +// CHECK:STDOUT: %Outer.ref: type = name_reference Outer, file.%Outer // CHECK:STDOUT: %.loc15_16: type = ptr_type Outer // CHECK:STDOUT: %.loc15_9.1: type = unbound_field_type Outer, Outer* -// CHECK:STDOUT: %.loc15_9.2: = field "qo", member1 -// CHECK:STDOUT: %qo: = bind_name "qo", %.loc15_9.2 -// CHECK:STDOUT: %Inner.ref: type = name_reference "Inner", %Inner +// CHECK:STDOUT: %.loc15_9.2: = field qo, member1 +// CHECK:STDOUT: %qo: = bind_name qo, %.loc15_9.2 +// CHECK:STDOUT: %Inner.ref: type = name_reference Inner, %Inner // CHECK:STDOUT: %.loc16_16: type = ptr_type Inner // CHECK:STDOUT: %.loc16_9.1: type = unbound_field_type Outer, Inner* -// CHECK:STDOUT: %.loc16_9.2: = field "pi", member2 -// CHECK:STDOUT: %pi: = bind_name "pi", %.loc16_9.2 +// CHECK:STDOUT: %.loc16_9.2: = field pi, member2 +// CHECK:STDOUT: %pi: = bind_name pi, %.loc16_9.2 // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Inner = @@ -68,21 +68,21 @@ fn F(a: Outer*) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Inner { -// CHECK:STDOUT: %Self.ref: type = name_reference "Self", @Outer.%Inner +// CHECK:STDOUT: %Self.ref: type = name_reference Self, @Outer.%Inner // CHECK:STDOUT: %.loc9_17: type = ptr_type Inner // CHECK:STDOUT: %.loc9_11.1: type = unbound_field_type Inner, Inner* -// CHECK:STDOUT: %.loc9_11.2: = field "pi", member0 -// CHECK:STDOUT: %pi: = bind_name "pi", %.loc9_11.2 -// CHECK:STDOUT: %Outer.ref: type = name_reference "Outer", file.%Outer +// CHECK:STDOUT: %.loc9_11.2: = field pi, member0 +// CHECK:STDOUT: %pi: = bind_name pi, %.loc9_11.2 +// CHECK:STDOUT: %Outer.ref: type = name_reference Outer, file.%Outer // CHECK:STDOUT: %.loc10_18: type = ptr_type Outer // CHECK:STDOUT: %.loc10_11.1: type = unbound_field_type Inner, Outer* -// CHECK:STDOUT: %.loc10_11.2: = field "po", member1 -// CHECK:STDOUT: %po: = bind_name "po", %.loc10_11.2 -// CHECK:STDOUT: %Inner.ref: type = name_reference "Inner", @Outer.%Inner +// CHECK:STDOUT: %.loc10_11.2: = field po, member1 +// CHECK:STDOUT: %po: = bind_name po, %.loc10_11.2 +// CHECK:STDOUT: %Inner.ref: type = name_reference Inner, @Outer.%Inner // CHECK:STDOUT: %.loc11_18: type = ptr_type Inner // CHECK:STDOUT: %.loc11_11.1: type = unbound_field_type Inner, Inner* -// CHECK:STDOUT: %.loc11_11.2: = field "qi", member2 -// CHECK:STDOUT: %qi: = bind_name "qi", %.loc11_11.2 +// CHECK:STDOUT: %.loc11_11.2: = field qi, member2 +// CHECK:STDOUT: %qi: = bind_name qi, %.loc11_11.2 // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .pi = %pi @@ -92,50 +92,50 @@ fn F(a: Outer*) { // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%a: Outer*) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a.ref.loc23_5: Outer* = name_reference "a", %a +// CHECK:STDOUT: %a.ref.loc23_5: Outer* = name_reference a, %a // CHECK:STDOUT: %.loc23_4: ref Outer = dereference %a.ref.loc23_5 // CHECK:STDOUT: %.loc23_7: ref Outer* = class_field_access %.loc23_4, member0 -// CHECK:STDOUT: %a.ref.loc23_13: Outer* = name_reference "a", %a +// CHECK:STDOUT: %a.ref.loc23_13: Outer* = name_reference a, %a // CHECK:STDOUT: assign %.loc23_7, %a.ref.loc23_13 -// CHECK:STDOUT: %a.ref.loc24_5: Outer* = name_reference "a", %a +// CHECK:STDOUT: %a.ref.loc24_5: Outer* = name_reference a, %a // CHECK:STDOUT: %.loc24_4: ref Outer = dereference %a.ref.loc24_5 // CHECK:STDOUT: %.loc24_7: ref Outer* = class_field_access %.loc24_4, member1 -// CHECK:STDOUT: %a.ref.loc24_13: Outer* = name_reference "a", %a +// CHECK:STDOUT: %a.ref.loc24_13: Outer* = name_reference a, %a // CHECK:STDOUT: assign %.loc24_7, %a.ref.loc24_13 -// CHECK:STDOUT: %a.ref.loc25_5: Outer* = name_reference "a", %a +// CHECK:STDOUT: %a.ref.loc25_5: Outer* = name_reference a, %a // CHECK:STDOUT: %.loc25_4: ref Outer = dereference %a.ref.loc25_5 // CHECK:STDOUT: %.loc25_7: ref Inner* = class_field_access %.loc25_4, member2 -// CHECK:STDOUT: %a.ref.loc25_15: Outer* = name_reference "a", %a +// CHECK:STDOUT: %a.ref.loc25_15: Outer* = name_reference a, %a // CHECK:STDOUT: %.loc25_14: ref Outer = dereference %a.ref.loc25_15 // CHECK:STDOUT: %.loc25_17.1: ref Inner* = class_field_access %.loc25_14, member2 // CHECK:STDOUT: %.loc25_17.2: Inner* = bind_value %.loc25_17.1 // CHECK:STDOUT: assign %.loc25_7, %.loc25_17.2 -// CHECK:STDOUT: %a.ref.loc26_7: Outer* = name_reference "a", %a +// CHECK:STDOUT: %a.ref.loc26_7: Outer* = name_reference a, %a // CHECK:STDOUT: %.loc26_6: ref Outer = dereference %a.ref.loc26_7 // CHECK:STDOUT: %.loc26_9.1: ref Inner* = class_field_access %.loc26_6, member2 // CHECK:STDOUT: %.loc26_9.2: Inner* = bind_value %.loc26_9.1 // CHECK:STDOUT: %.loc26_4: ref Inner = dereference %.loc26_9.2 // CHECK:STDOUT: %.loc26_13: ref Outer* = class_field_access %.loc26_4, member1 -// CHECK:STDOUT: %a.ref.loc26_19: Outer* = name_reference "a", %a +// CHECK:STDOUT: %a.ref.loc26_19: Outer* = name_reference a, %a // CHECK:STDOUT: assign %.loc26_13, %a.ref.loc26_19 -// CHECK:STDOUT: %a.ref.loc27_7: Outer* = name_reference "a", %a +// CHECK:STDOUT: %a.ref.loc27_7: Outer* = name_reference a, %a // CHECK:STDOUT: %.loc27_6: ref Outer = dereference %a.ref.loc27_7 // CHECK:STDOUT: %.loc27_9.1: ref Inner* = class_field_access %.loc27_6, member2 // CHECK:STDOUT: %.loc27_9.2: Inner* = bind_value %.loc27_9.1 // CHECK:STDOUT: %.loc27_4: ref Inner = dereference %.loc27_9.2 // CHECK:STDOUT: %.loc27_13: ref Inner* = class_field_access %.loc27_4, member0 -// CHECK:STDOUT: %a.ref.loc27_21: Outer* = name_reference "a", %a +// CHECK:STDOUT: %a.ref.loc27_21: Outer* = name_reference a, %a // CHECK:STDOUT: %.loc27_20: ref Outer = dereference %a.ref.loc27_21 // CHECK:STDOUT: %.loc27_23.1: ref Inner* = class_field_access %.loc27_20, member2 // CHECK:STDOUT: %.loc27_23.2: Inner* = bind_value %.loc27_23.1 // CHECK:STDOUT: assign %.loc27_13, %.loc27_23.2 -// CHECK:STDOUT: %a.ref.loc28_7: Outer* = name_reference "a", %a +// CHECK:STDOUT: %a.ref.loc28_7: Outer* = name_reference a, %a // CHECK:STDOUT: %.loc28_6: ref Outer = dereference %a.ref.loc28_7 // CHECK:STDOUT: %.loc28_9.1: ref Inner* = class_field_access %.loc28_6, member2 // CHECK:STDOUT: %.loc28_9.2: Inner* = bind_value %.loc28_9.1 // CHECK:STDOUT: %.loc28_4: ref Inner = dereference %.loc28_9.2 // CHECK:STDOUT: %.loc28_13: ref Inner* = class_field_access %.loc28_4, member2 -// CHECK:STDOUT: %a.ref.loc28_21: Outer* = name_reference "a", %a +// CHECK:STDOUT: %a.ref.loc28_21: Outer* = name_reference a, %a // CHECK:STDOUT: %.loc28_20: ref Outer = dereference %a.ref.loc28_21 // CHECK:STDOUT: %.loc28_23.1: ref Inner* = class_field_access %.loc28_20, member2 // CHECK:STDOUT: %.loc28_23.2: Inner* = bind_value %.loc28_23.1 diff --git a/toolchain/check/testdata/class/nested_name.carbon b/toolchain/check/testdata/class/nested_name.carbon index 601fea8d95d9..faf9b9937bc0 100644 --- a/toolchain/check/testdata/class/nested_name.carbon +++ b/toolchain/check/testdata/class/nested_name.carbon @@ -43,8 +43,8 @@ fn G(o: Outer) { // CHECK:STDOUT: // CHECK:STDOUT: class @Inner { // CHECK:STDOUT: %.loc9_10.1: type = unbound_field_type Inner, i32 -// CHECK:STDOUT: %.loc9_10.2: = field "n", member0 -// CHECK:STDOUT: %n: = bind_name "n", %.loc9_10.2 +// CHECK:STDOUT: %.loc9_10.2: = field n, member0 +// CHECK:STDOUT: %n: = bind_name n, %.loc9_10.2 // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .n = %n @@ -52,7 +52,7 @@ fn G(o: Outer) { // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%oi: Inner) -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %oi.ref: Inner = name_reference "oi", %oi +// CHECK:STDOUT: %oi.ref: Inner = name_reference oi, %oi // CHECK:STDOUT: %.loc14_12.1: ref i32 = class_field_access %oi.ref, member0 // CHECK:STDOUT: %.loc14_12.2: i32 = bind_value %.loc14_12.1 // CHECK:STDOUT: return %.loc14_12.2 @@ -60,9 +60,9 @@ fn G(o: Outer) { // CHECK:STDOUT: // CHECK:STDOUT: fn @G(%o: Outer) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %o.ref: Outer = name_reference "o", %o -// CHECK:STDOUT: %Inner.ref: type = name_reference "Inner", @Outer.%Inner -// CHECK:STDOUT: %i.var: ref Inner = var "i" -// CHECK:STDOUT: %i: ref Inner = bind_name "i", %i.var +// CHECK:STDOUT: %o.ref: Outer = name_reference o, %o +// CHECK:STDOUT: %Inner.ref: type = name_reference Inner, @Outer.%Inner +// CHECK:STDOUT: %i.var: ref Inner = var i +// CHECK:STDOUT: %i: ref Inner = bind_name i, %i.var // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/reenter_scope.carbon b/toolchain/check/testdata/class/reenter_scope.carbon index 33420e019059..8109406e5701 100644 --- a/toolchain/check/testdata/class/reenter_scope.carbon +++ b/toolchain/check/testdata/class/reenter_scope.carbon @@ -34,7 +34,7 @@ fn Class.F() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %G.ref: = name_reference "G", @Class.%G +// CHECK:STDOUT: %G.ref: = name_reference G, @Class.%G // CHECK:STDOUT: %.loc13_11: init i32 = call %G.ref() // CHECK:STDOUT: %.loc13_13: i32 = value_of_initializer %.loc13_11 // CHECK:STDOUT: return %.loc13_13 diff --git a/toolchain/check/testdata/class/scope.carbon b/toolchain/check/testdata/class/scope.carbon index 80fb039a21fd..884ead7abf09 100644 --- a/toolchain/check/testdata/class/scope.carbon +++ b/toolchain/check/testdata/class/scope.carbon @@ -50,7 +50,7 @@ fn Run() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @G() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: = name_reference "F", @Class.%F +// CHECK:STDOUT: %F.ref: = name_reference F, @Class.%F // CHECK:STDOUT: %.loc13_13: init i32 = call %F.ref() // CHECK:STDOUT: %.loc13_15: i32 = value_of_initializer %.loc13_13 // CHECK:STDOUT: return %.loc13_15 @@ -64,10 +64,10 @@ fn Run() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref.loc22_10: = name_reference "F", file.%F +// CHECK:STDOUT: %F.ref.loc22_10: = name_reference F, file.%F // CHECK:STDOUT: %.loc22_11: init i32 = call %F.ref.loc22_10() -// CHECK:STDOUT: %Class.ref: type = name_reference "Class", file.%Class -// CHECK:STDOUT: %F.ref.loc22_21: = name_reference "F", @Class.%F +// CHECK:STDOUT: %Class.ref: type = name_reference Class, file.%Class +// CHECK:STDOUT: %F.ref.loc22_21: = name_reference F, @Class.%F // CHECK:STDOUT: %.loc22_23.1: init i32 = call %F.ref.loc22_21() // CHECK:STDOUT: %.loc22_14.1: i32 = value_of_initializer %.loc22_11 // CHECK:STDOUT: %.loc22_23.2: i32 = value_of_initializer %.loc22_23.1 diff --git a/toolchain/check/testdata/class/self.carbon b/toolchain/check/testdata/class/self.carbon index 79d8356f45d7..eef416fb8ede 100644 --- a/toolchain/check/testdata/class/self.carbon +++ b/toolchain/check/testdata/class/self.carbon @@ -35,8 +35,8 @@ fn Class.G[addr self: Class*]() -> i32 { // CHECK:STDOUT: %F: = fn_decl @F // CHECK:STDOUT: %G: = fn_decl @G // CHECK:STDOUT: %.loc11_8.1: type = unbound_field_type Class, i32 -// CHECK:STDOUT: %.loc11_8.2: = field "n", member0 -// CHECK:STDOUT: %n: = bind_name "n", %.loc11_8.2 +// CHECK:STDOUT: %.loc11_8.2: = field n, member0 +// CHECK:STDOUT: %n: = bind_name n, %.loc11_8.2 // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F @@ -46,7 +46,7 @@ fn Class.G[addr self: Class*]() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @F[%self: Class]() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %self.ref: Class = name_reference "self", %self +// CHECK:STDOUT: %self.ref: Class = name_reference self, %self // CHECK:STDOUT: %.loc15_14.1: ref i32 = class_field_access %self.ref, member0 // CHECK:STDOUT: %.loc15_14.2: i32 = bind_value %.loc15_14.1 // CHECK:STDOUT: return %.loc15_14.2 @@ -54,7 +54,7 @@ fn Class.G[addr self: Class*]() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @G[%self.addr: Class*]() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %self.ref: Class* = name_reference "self", %self.addr +// CHECK:STDOUT: %self.ref: Class* = name_reference self, %self.addr // CHECK:STDOUT: %.loc19_11: ref Class = dereference %self.ref // CHECK:STDOUT: %.loc19_17.1: ref i32 = class_field_access %.loc19_11, member0 // CHECK:STDOUT: %.loc19_17.2: i32 = bind_value %.loc19_17.1 diff --git a/toolchain/check/testdata/class/self_type.carbon b/toolchain/check/testdata/class/self_type.carbon index 0984f506cb96..d91303e4614e 100644 --- a/toolchain/check/testdata/class/self_type.carbon +++ b/toolchain/check/testdata/class/self_type.carbon @@ -29,11 +29,11 @@ fn Class.F[self: Class]() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %F: = fn_decl @F -// CHECK:STDOUT: %Self.ref: type = name_reference "Self", file.%Class +// CHECK:STDOUT: %Self.ref: type = name_reference Self, file.%Class // CHECK:STDOUT: %.loc9_14: type = ptr_type Class // CHECK:STDOUT: %.loc9_8.1: type = unbound_field_type Class, Class* -// CHECK:STDOUT: %.loc9_8.2: = field "p", member0 -// CHECK:STDOUT: %p: = bind_name "p", %.loc9_8.2 +// CHECK:STDOUT: %.loc9_8.2: = field p, member0 +// CHECK:STDOUT: %p: = bind_name p, %.loc9_8.2 // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F @@ -42,7 +42,7 @@ fn Class.F[self: Class]() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @F[%self: Class]() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %self.ref: Class = name_reference "self", %self +// CHECK:STDOUT: %self.ref: Class = name_reference self, %self // CHECK:STDOUT: %.loc16_16.1: ref Class* = class_field_access %self.ref, member0 // CHECK:STDOUT: %.loc16_16.2: Class* = bind_value %.loc16_16.1 // CHECK:STDOUT: %.loc16_11.1: ref Class = dereference %.loc16_16.2 diff --git a/toolchain/check/testdata/class/static_method.carbon b/toolchain/check/testdata/class/static_method.carbon index f70c81ddec39..1408dd586103 100644 --- a/toolchain/check/testdata/class/static_method.carbon +++ b/toolchain/check/testdata/class/static_method.carbon @@ -36,11 +36,11 @@ fn Run() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Class.ref: type = name_reference "Class", file.%Class -// CHECK:STDOUT: %c.var: ref Class = var "c" -// CHECK:STDOUT: %c: ref Class = bind_name "c", %c.var -// CHECK:STDOUT: %c.ref: ref Class = name_reference "c", %c -// CHECK:STDOUT: %F.ref: = name_reference "F", @Class.%F +// CHECK:STDOUT: %Class.ref: type = name_reference Class, file.%Class +// CHECK:STDOUT: %c.var: ref Class = var c +// CHECK:STDOUT: %c: ref Class = bind_name c, %c.var +// CHECK:STDOUT: %c.ref: ref Class = name_reference c, %c +// CHECK:STDOUT: %F.ref: = name_reference F, @Class.%F // CHECK:STDOUT: %.loc13_13: init i32 = call %F.ref() // CHECK:STDOUT: %.loc13_15: i32 = value_of_initializer %.loc13_13 // CHECK:STDOUT: return %.loc13_15 diff --git a/toolchain/check/testdata/const/collapse.carbon b/toolchain/check/testdata/const/collapse.carbon index 62d90e7ae22f..1a80d1880727 100644 --- a/toolchain/check/testdata/const/collapse.carbon +++ b/toolchain/check/testdata/const/collapse.carbon @@ -18,6 +18,6 @@ fn F(p: const i32**) -> const (const i32)** { // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%p: const i32**) -> const i32** { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: const i32** = name_reference "p", %p +// CHECK:STDOUT: %p.ref: const i32** = name_reference p, %p // CHECK:STDOUT: return %p.ref // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/const/fail_collapse.carbon b/toolchain/check/testdata/const/fail_collapse.carbon index 9756fd64b853..9be204089a3f 100644 --- a/toolchain/check/testdata/const/fail_collapse.carbon +++ b/toolchain/check/testdata/const/fail_collapse.carbon @@ -20,6 +20,6 @@ fn G(p: const (const i32)**) -> i32** { // CHECK:STDOUT: // CHECK:STDOUT: fn @G(%p: const i32**) -> i32** { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: const i32** = name_reference "p", %p +// CHECK:STDOUT: %p.ref: const i32** = name_reference p, %p // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/expression_category/in_place_tuple_initialization.carbon b/toolchain/check/testdata/expression_category/in_place_tuple_initialization.carbon index aeb0ee156e1d..c64fd35c298e 100644 --- a/toolchain/check/testdata/expression_category/in_place_tuple_initialization.carbon +++ b/toolchain/check/testdata/expression_category/in_place_tuple_initialization.carbon @@ -33,18 +33,18 @@ fn H() -> i32 { // CHECK:STDOUT: fn @G() -> %return: (i32, i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc10_19: (type, type) = tuple_literal (i32, i32) -// CHECK:STDOUT: %v.var: ref (i32, i32) = var "v" -// CHECK:STDOUT: %v: ref (i32, i32) = bind_name "v", %v.var -// CHECK:STDOUT: %F.ref.loc10: = name_reference "F", file.%F +// CHECK:STDOUT: %v.var: ref (i32, i32) = var v +// CHECK:STDOUT: %v: ref (i32, i32) = bind_name v, %v.var +// CHECK:STDOUT: %F.ref.loc10: = name_reference F, file.%F // CHECK:STDOUT: %.loc10_7: ref (i32, i32) = splice_block %v.var {} // CHECK:STDOUT: %.loc10_24: init (i32, i32) = call %F.ref.loc10() to %.loc10_7 // CHECK:STDOUT: assign %v.var, %.loc10_24 -// CHECK:STDOUT: %v.ref: ref (i32, i32) = name_reference "v", %v -// CHECK:STDOUT: %F.ref.loc11: = name_reference "F", file.%F +// CHECK:STDOUT: %v.ref: ref (i32, i32) = name_reference v, %v +// CHECK:STDOUT: %F.ref.loc11: = name_reference F, file.%F // CHECK:STDOUT: %.loc11_3: ref (i32, i32) = splice_block %v.ref {} // CHECK:STDOUT: %.loc11_8: init (i32, i32) = call %F.ref.loc11() to %.loc11_3 // CHECK:STDOUT: assign %v.ref, %.loc11_8 -// CHECK:STDOUT: %F.ref.loc12: = name_reference "F", file.%F +// CHECK:STDOUT: %F.ref.loc12: = name_reference F, file.%F // CHECK:STDOUT: %.loc9: ref (i32, i32) = splice_block %return {} // CHECK:STDOUT: %.loc12: init (i32, i32) = call %F.ref.loc12() to %.loc9 // CHECK:STDOUT: return %.loc12 @@ -52,7 +52,7 @@ fn H() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @H() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %G.ref: = name_reference "G", file.%G +// CHECK:STDOUT: %G.ref: = name_reference G, file.%G // CHECK:STDOUT: %.loc16_11.1: ref (i32, i32) = temporary_storage // CHECK:STDOUT: %.loc16_11.2: init (i32, i32) = call %G.ref() to %.loc16_11.1 // CHECK:STDOUT: %.loc16_14: i32 = int_literal 0 diff --git a/toolchain/check/testdata/function/call/empty_struct.carbon b/toolchain/check/testdata/function/call/empty_struct.carbon index 8078006e9c64..0fdd16bd2aea 100644 --- a/toolchain/check/testdata/function/call/empty_struct.carbon +++ b/toolchain/check/testdata/function/call/empty_struct.carbon @@ -24,13 +24,13 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Echo(%a: {}) -> {} { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a.ref: {} = name_reference "a", %a +// CHECK:STDOUT: %a.ref: {} = name_reference a, %a // CHECK:STDOUT: return %a.ref // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Echo.ref: = name_reference "Echo", file.%Echo +// CHECK:STDOUT: %Echo.ref: = name_reference Echo, file.%Echo // CHECK:STDOUT: %.loc12_9.1: {} = struct_literal () // CHECK:STDOUT: %.loc12_9.2: {} = struct_value %.loc12_9.1, () // CHECK:STDOUT: %.loc12_7: init {} = call %Echo.ref(%.loc12_9.2) diff --git a/toolchain/check/testdata/function/call/empty_tuple.carbon b/toolchain/check/testdata/function/call/empty_tuple.carbon index 38316e00d369..792672ae918f 100644 --- a/toolchain/check/testdata/function/call/empty_tuple.carbon +++ b/toolchain/check/testdata/function/call/empty_tuple.carbon @@ -23,13 +23,13 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Echo(%a: ()) -> () { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a.ref: () = name_reference "a", %a +// CHECK:STDOUT: %a.ref: () = name_reference a, %a // CHECK:STDOUT: return %a.ref // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Echo.ref: = name_reference "Echo", file.%Echo +// CHECK:STDOUT: %Echo.ref: = name_reference Echo, file.%Echo // CHECK:STDOUT: %.loc12_9.1: () = tuple_literal () // CHECK:STDOUT: %.loc12_9.2: () = tuple_value %.loc12_9.1, () // CHECK:STDOUT: %.loc12_7: init () = call %Echo.ref(%.loc12_9.2) diff --git a/toolchain/check/testdata/function/call/fail_not_callable.carbon b/toolchain/check/testdata/function/call/fail_not_callable.carbon index ceaaabaefe75..adb444fb68b1 100644 --- a/toolchain/check/testdata/function/call/fail_not_callable.carbon +++ b/toolchain/check/testdata/function/call/fail_not_callable.carbon @@ -21,8 +21,8 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %x.var: ref i32 = var "x" -// CHECK:STDOUT: %x: ref i32 = bind_name "x", %x.var +// CHECK:STDOUT: %x.var: ref i32 = var x +// CHECK:STDOUT: %x: ref i32 = bind_name x, %x.var // CHECK:STDOUT: %.loc11: String = string_literal "hello" // CHECK:STDOUT: assign %x.var, // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/function/call/fail_param_count.carbon b/toolchain/check/testdata/function/call/fail_param_count.carbon index 72b5fee4d2ef..2d7a9fa854e6 100644 --- a/toolchain/check/testdata/function/call/fail_param_count.carbon +++ b/toolchain/check/testdata/function/call/fail_param_count.carbon @@ -83,22 +83,22 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Run0.ref.loc18: = name_reference "Run0", file.%Run0 +// CHECK:STDOUT: %Run0.ref.loc18: = name_reference Run0, file.%Run0 // CHECK:STDOUT: %.loc18_8: i32 = int_literal 1 // CHECK:STDOUT: %.loc18_7: init () = call %Run0.ref.loc18() -// CHECK:STDOUT: %Run0.ref.loc25: = name_reference "Run0", file.%Run0 +// CHECK:STDOUT: %Run0.ref.loc25: = name_reference Run0, file.%Run0 // CHECK:STDOUT: %.loc25_8: i32 = int_literal 0 // CHECK:STDOUT: %.loc25_11: i32 = int_literal 1 // CHECK:STDOUT: %.loc25_7: init () = call %Run0.ref.loc25() -// CHECK:STDOUT: %Run1.ref.loc33: = name_reference "Run1", file.%Run1 +// CHECK:STDOUT: %Run1.ref.loc33: = name_reference Run1, file.%Run1 // CHECK:STDOUT: %.loc33: init () = call %Run1.ref.loc33() -// CHECK:STDOUT: %Run1.ref.loc40: = name_reference "Run1", file.%Run1 +// CHECK:STDOUT: %Run1.ref.loc40: = name_reference Run1, file.%Run1 // CHECK:STDOUT: %.loc40_8: i32 = int_literal 0 // CHECK:STDOUT: %.loc40_11: i32 = int_literal 1 // CHECK:STDOUT: %.loc40_7: init () = call %Run1.ref.loc40() -// CHECK:STDOUT: %Run2.ref.loc48: = name_reference "Run2", file.%Run2 +// CHECK:STDOUT: %Run2.ref.loc48: = name_reference Run2, file.%Run2 // CHECK:STDOUT: %.loc48: init () = call %Run2.ref.loc48() -// CHECK:STDOUT: %Run2.ref.loc55: = name_reference "Run2", file.%Run2 +// CHECK:STDOUT: %Run2.ref.loc55: = name_reference Run2, file.%Run2 // CHECK:STDOUT: %.loc55_8: i32 = int_literal 0 // CHECK:STDOUT: %.loc55_7: init () = call %Run2.ref.loc55() // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/function/call/fail_param_type.carbon b/toolchain/check/testdata/function/call/fail_param_type.carbon index c3dafeae54db..566e2d168bd9 100644 --- a/toolchain/check/testdata/function/call/fail_param_type.carbon +++ b/toolchain/check/testdata/function/call/fail_param_type.carbon @@ -32,7 +32,7 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %G.ref: = name_reference "G", file.%G +// CHECK:STDOUT: %G.ref: = name_reference G, file.%G // CHECK:STDOUT: %.loc16_5: f64 = real_literal 10e-1 // CHECK:STDOUT: %.loc16_4: init () = call %G.ref() // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon b/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon index ae03a6d5fa7c..d738994cb014 100644 --- a/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon +++ b/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon @@ -26,9 +26,9 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %x.var: ref i32 = var "x" -// CHECK:STDOUT: %x: ref i32 = bind_name "x", %x.var -// CHECK:STDOUT: %Foo.ref: = name_reference "Foo", file.%Foo +// CHECK:STDOUT: %x.var: ref i32 = var x +// CHECK:STDOUT: %x: ref i32 = bind_name x, %x.var +// CHECK:STDOUT: %Foo.ref: = name_reference Foo, file.%Foo // CHECK:STDOUT: %.loc13: init f64 = call %Foo.ref() // CHECK:STDOUT: assign %x.var, // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/function/call/i32.carbon b/toolchain/check/testdata/function/call/i32.carbon index 66118b99d1d7..15ec9c2ec24d 100644 --- a/toolchain/check/testdata/function/call/i32.carbon +++ b/toolchain/check/testdata/function/call/i32.carbon @@ -19,15 +19,15 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Echo(%a: i32) -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a.ref: i32 = name_reference "a", %a +// CHECK:STDOUT: %a.ref: i32 = name_reference a, %a // CHECK:STDOUT: return %a.ref // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %b.var: ref i32 = var "b" -// CHECK:STDOUT: %b: ref i32 = bind_name "b", %b.var -// CHECK:STDOUT: %Echo.ref: = name_reference "Echo", file.%Echo +// CHECK:STDOUT: %b.var: ref i32 = var b +// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var +// CHECK:STDOUT: %Echo.ref: = name_reference Echo, file.%Echo // CHECK:STDOUT: %.loc12_21: i32 = int_literal 1 // CHECK:STDOUT: %.loc12_20: init i32 = call %Echo.ref(%.loc12_21) // CHECK:STDOUT: assign %b.var, %.loc12_20 diff --git a/toolchain/check/testdata/function/call/more_param_ir.carbon b/toolchain/check/testdata/function/call/more_param_ir.carbon index 7d1f5cc47468..68ce39c2460c 100644 --- a/toolchain/check/testdata/function/call/more_param_ir.carbon +++ b/toolchain/check/testdata/function/call/more_param_ir.carbon @@ -27,7 +27,7 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Foo.ref: = name_reference "Foo", file.%Foo +// CHECK:STDOUT: %Foo.ref: = name_reference Foo, file.%Foo // CHECK:STDOUT: %.loc11_7: i32 = int_literal 1 // CHECK:STDOUT: %.loc11_11: i32 = int_literal 2 // CHECK:STDOUT: %.loc11_9: i32 = add %.loc11_7, %.loc11_11 diff --git a/toolchain/check/testdata/function/call/params_one.carbon b/toolchain/check/testdata/function/call/params_one.carbon index 72d3e25c9a02..b9ceaf4c9d90 100644 --- a/toolchain/check/testdata/function/call/params_one.carbon +++ b/toolchain/check/testdata/function/call/params_one.carbon @@ -26,7 +26,7 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Foo.ref: = name_reference "Foo", file.%Foo +// CHECK:STDOUT: %Foo.ref: = name_reference Foo, file.%Foo // CHECK:STDOUT: %.loc10_7: i32 = int_literal 1 // CHECK:STDOUT: %.loc10_6: init () = call %Foo.ref(%.loc10_7) // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/function/call/params_one_comma.carbon b/toolchain/check/testdata/function/call/params_one_comma.carbon index 72b14e8fad25..dc9867afe4aa 100644 --- a/toolchain/check/testdata/function/call/params_one_comma.carbon +++ b/toolchain/check/testdata/function/call/params_one_comma.carbon @@ -27,10 +27,10 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Foo.ref.loc10: = name_reference "Foo", file.%Foo +// CHECK:STDOUT: %Foo.ref.loc10: = name_reference Foo, file.%Foo // CHECK:STDOUT: %.loc10_7: i32 = int_literal 1 // CHECK:STDOUT: %.loc10_6: init () = call %Foo.ref.loc10(%.loc10_7) -// CHECK:STDOUT: %Foo.ref.loc11: = name_reference "Foo", file.%Foo +// CHECK:STDOUT: %Foo.ref.loc11: = name_reference Foo, file.%Foo // CHECK:STDOUT: %.loc11_7: i32 = int_literal 1 // CHECK:STDOUT: %.loc11_6: init () = call %Foo.ref.loc11(%.loc11_7) // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/function/call/params_two.carbon b/toolchain/check/testdata/function/call/params_two.carbon index 9c6fcee8b8b1..414e0da56541 100644 --- a/toolchain/check/testdata/function/call/params_two.carbon +++ b/toolchain/check/testdata/function/call/params_two.carbon @@ -26,7 +26,7 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Foo.ref: = name_reference "Foo", file.%Foo +// CHECK:STDOUT: %Foo.ref: = name_reference Foo, file.%Foo // CHECK:STDOUT: %.loc10_7: i32 = int_literal 1 // CHECK:STDOUT: %.loc10_10: i32 = int_literal 2 // CHECK:STDOUT: %.loc10_6: init () = call %Foo.ref(%.loc10_7, %.loc10_10) diff --git a/toolchain/check/testdata/function/call/params_two_comma.carbon b/toolchain/check/testdata/function/call/params_two_comma.carbon index edfc03959943..59cf90513141 100644 --- a/toolchain/check/testdata/function/call/params_two_comma.carbon +++ b/toolchain/check/testdata/function/call/params_two_comma.carbon @@ -27,11 +27,11 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Foo.ref.loc10: = name_reference "Foo", file.%Foo +// CHECK:STDOUT: %Foo.ref.loc10: = name_reference Foo, file.%Foo // CHECK:STDOUT: %.loc10_7: i32 = int_literal 1 // CHECK:STDOUT: %.loc10_10: i32 = int_literal 2 // CHECK:STDOUT: %.loc10_6: init () = call %Foo.ref.loc10(%.loc10_7, %.loc10_10) -// CHECK:STDOUT: %Foo.ref.loc11: = name_reference "Foo", file.%Foo +// CHECK:STDOUT: %Foo.ref.loc11: = name_reference Foo, file.%Foo // CHECK:STDOUT: %.loc11_7: i32 = int_literal 1 // CHECK:STDOUT: %.loc11_10: i32 = int_literal 2 // CHECK:STDOUT: %.loc11_6: init () = call %Foo.ref.loc11(%.loc11_7, %.loc11_10) diff --git a/toolchain/check/testdata/function/call/params_zero.carbon b/toolchain/check/testdata/function/call/params_zero.carbon index 557d78ea0a31..b15bd191d88e 100644 --- a/toolchain/check/testdata/function/call/params_zero.carbon +++ b/toolchain/check/testdata/function/call/params_zero.carbon @@ -26,7 +26,7 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Foo.ref: = name_reference "Foo", file.%Foo +// CHECK:STDOUT: %Foo.ref: = name_reference Foo, file.%Foo // CHECK:STDOUT: %.loc10: init () = call %Foo.ref() // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/call/return_implicit.carbon b/toolchain/check/testdata/function/call/return_implicit.carbon index 6becffdc7da8..88331b6dd043 100644 --- a/toolchain/check/testdata/function/call/return_implicit.carbon +++ b/toolchain/check/testdata/function/call/return_implicit.carbon @@ -28,9 +28,9 @@ fn Main() { // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc11_11: () = tuple_literal () -// CHECK:STDOUT: %b.var: ref () = var "b" -// CHECK:STDOUT: %b: ref () = bind_name "b", %b.var -// CHECK:STDOUT: %MakeImplicitEmptyTuple.ref: = name_reference "MakeImplicitEmptyTuple", file.%MakeImplicitEmptyTuple +// CHECK:STDOUT: %b.var: ref () = var b +// CHECK:STDOUT: %b: ref () = bind_name b, %b.var +// CHECK:STDOUT: %MakeImplicitEmptyTuple.ref: = name_reference MakeImplicitEmptyTuple, file.%MakeImplicitEmptyTuple // CHECK:STDOUT: %.loc11_37: init () = call %MakeImplicitEmptyTuple.ref() // CHECK:STDOUT: assign %b.var, %.loc11_37 // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/function/declaration/simple.carbon b/toolchain/check/testdata/function/declaration/simple.carbon index 1b41cc5394b7..5c673587dc53 100644 --- a/toolchain/check/testdata/function/declaration/simple.carbon +++ b/toolchain/check/testdata/function/declaration/simple.carbon @@ -21,7 +21,7 @@ fn G() { F(); } // CHECK:STDOUT: // CHECK:STDOUT: fn @G() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: = name_reference "F", file.%F +// CHECK:STDOUT: %F.ref: = name_reference F, file.%F // CHECK:STDOUT: %.loc9: init () = call %F.ref() // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/if/else.carbon b/toolchain/check/testdata/if/else.carbon index 44404e7be5d5..d27fdfa66c42 100644 --- a/toolchain/check/testdata/if/else.carbon +++ b/toolchain/check/testdata/if/else.carbon @@ -45,21 +45,21 @@ fn If(b: bool) { // CHECK:STDOUT: // CHECK:STDOUT: fn @If(%b: bool) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %b.ref: bool = name_reference "b", %b +// CHECK:STDOUT: %b.ref: bool = name_reference b, %b // CHECK:STDOUT: if %b.ref br !if.then else br !if.else // CHECK:STDOUT: // CHECK:STDOUT: !if.then: -// CHECK:STDOUT: %F.ref: = name_reference "F", file.%F +// CHECK:STDOUT: %F.ref: = name_reference F, file.%F // CHECK:STDOUT: %.loc13: init () = call %F.ref() // CHECK:STDOUT: br !if.done // CHECK:STDOUT: // CHECK:STDOUT: !if.else: -// CHECK:STDOUT: %G.ref: = name_reference "G", file.%G +// CHECK:STDOUT: %G.ref: = name_reference G, file.%G // CHECK:STDOUT: %.loc15: init () = call %G.ref() // CHECK:STDOUT: br !if.done // CHECK:STDOUT: // CHECK:STDOUT: !if.done: -// CHECK:STDOUT: %H.ref: = name_reference "H", file.%H +// CHECK:STDOUT: %H.ref: = name_reference H, file.%H // CHECK:STDOUT: %.loc17: init () = call %H.ref() // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon b/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon index edafec6e71b5..980bdbb2fa98 100644 --- a/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon +++ b/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon @@ -41,7 +41,7 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @If1(%b: bool) -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %b.ref: bool = name_reference "b", %b +// CHECK:STDOUT: %b.ref: bool = name_reference b, %b // CHECK:STDOUT: if %b.ref br !if.then else br !if.else // CHECK:STDOUT: // CHECK:STDOUT: !if.then: @@ -56,7 +56,7 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @If2(%b: bool) -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %b.ref: bool = name_reference "b", %b +// CHECK:STDOUT: %b.ref: bool = name_reference b, %b // CHECK:STDOUT: if %b.ref br !if.then else br !if.else // CHECK:STDOUT: // CHECK:STDOUT: !if.then: @@ -71,7 +71,7 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @If3(%b: bool) -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %b.ref: bool = name_reference "b", %b +// CHECK:STDOUT: %b.ref: bool = name_reference b, %b // CHECK:STDOUT: if %b.ref br !if.then else br !if.else // CHECK:STDOUT: // CHECK:STDOUT: !if.then: diff --git a/toolchain/check/testdata/if/fail_scope.carbon b/toolchain/check/testdata/if/fail_scope.carbon index d9395e5e7213..7a7ce6d94cf9 100644 --- a/toolchain/check/testdata/if/fail_scope.carbon +++ b/toolchain/check/testdata/if/fail_scope.carbon @@ -21,19 +21,19 @@ fn VarScope(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @VarScope(%b: bool) -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %b.ref: bool = name_reference "b", %b +// CHECK:STDOUT: %b.ref: bool = name_reference b, %b // CHECK:STDOUT: if %b.ref br !if.then else br !if.else // CHECK:STDOUT: // CHECK:STDOUT: !if.then: -// CHECK:STDOUT: %n.var: ref i32 = var "n" -// CHECK:STDOUT: %n: ref i32 = bind_name "n", %n.var +// CHECK:STDOUT: %n.var: ref i32 = var n +// CHECK:STDOUT: %n: ref i32 = bind_name n, %n.var // CHECK:STDOUT: %.loc9: i32 = int_literal 2 // CHECK:STDOUT: assign %n.var, %.loc9 -// CHECK:STDOUT: %n.ref.loc10: ref i32 = name_reference "n", %n +// CHECK:STDOUT: %n.ref.loc10: ref i32 = name_reference n, %n // CHECK:STDOUT: %.loc10: i32 = bind_value %n.ref.loc10 // CHECK:STDOUT: return %.loc10 // CHECK:STDOUT: // CHECK:STDOUT: !if.else: -// CHECK:STDOUT: %n.ref.loc15: = name_reference "n", +// CHECK:STDOUT: %n.ref.loc15: = name_reference n, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/if/no_else.carbon b/toolchain/check/testdata/if/no_else.carbon index a7d0358d20b9..c1aa909256e1 100644 --- a/toolchain/check/testdata/if/no_else.carbon +++ b/toolchain/check/testdata/if/no_else.carbon @@ -36,16 +36,16 @@ fn If(b: bool) { // CHECK:STDOUT: // CHECK:STDOUT: fn @If(%b: bool) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %b.ref: bool = name_reference "b", %b +// CHECK:STDOUT: %b.ref: bool = name_reference b, %b // CHECK:STDOUT: if %b.ref br !if.then else br !if.else // CHECK:STDOUT: // CHECK:STDOUT: !if.then: -// CHECK:STDOUT: %F.ref: = name_reference "F", file.%F +// CHECK:STDOUT: %F.ref: = name_reference F, file.%F // CHECK:STDOUT: %.loc12: init () = call %F.ref() // CHECK:STDOUT: br !if.else // CHECK:STDOUT: // CHECK:STDOUT: !if.else: -// CHECK:STDOUT: %G.ref: = name_reference "G", file.%G +// CHECK:STDOUT: %G.ref: = name_reference G, file.%G // CHECK:STDOUT: %.loc14: init () = call %G.ref() // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/if/unreachable_fallthrough.carbon b/toolchain/check/testdata/if/unreachable_fallthrough.carbon index f55af8129c43..0ccaf64ec167 100644 --- a/toolchain/check/testdata/if/unreachable_fallthrough.carbon +++ b/toolchain/check/testdata/if/unreachable_fallthrough.carbon @@ -19,7 +19,7 @@ fn If(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @If(%b: bool) -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %b.ref: bool = name_reference "b", %b +// CHECK:STDOUT: %b.ref: bool = name_reference b, %b // CHECK:STDOUT: if %b.ref br !if.then else br !if.else // CHECK:STDOUT: // CHECK:STDOUT: !if.then: diff --git a/toolchain/check/testdata/if_expression/basic.carbon b/toolchain/check/testdata/if_expression/basic.carbon index df50c993cd1e..e7201605665d 100644 --- a/toolchain/check/testdata/if_expression/basic.carbon +++ b/toolchain/check/testdata/if_expression/basic.carbon @@ -14,18 +14,18 @@ fn F(b: bool, n: i32, m: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%b: bool, %n: i32, %m: i32) -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %b.ref: bool = name_reference "b", %b +// CHECK:STDOUT: %b.ref: bool = name_reference b, %b // CHECK:STDOUT: if %b.ref br !if.expr.then else br !if.expr.else // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then: -// CHECK:STDOUT: %n.ref.loc8_20: i32 = name_reference "n", %n -// CHECK:STDOUT: %m.ref.loc8_24: i32 = name_reference "m", %m +// CHECK:STDOUT: %n.ref.loc8_20: i32 = name_reference n, %n +// CHECK:STDOUT: %m.ref.loc8_24: i32 = name_reference m, %m // CHECK:STDOUT: %.loc8_22: i32 = add %n.ref.loc8_20, %m.ref.loc8_24 // CHECK:STDOUT: br !if.expr.result(%.loc8_22) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else: -// CHECK:STDOUT: %m.ref.loc8_31: i32 = name_reference "m", %m -// CHECK:STDOUT: %n.ref.loc8_35: i32 = name_reference "n", %n +// CHECK:STDOUT: %m.ref.loc8_31: i32 = name_reference m, %m +// CHECK:STDOUT: %n.ref.loc8_35: i32 = name_reference n, %n // CHECK:STDOUT: %.loc8_33: i32 = add %m.ref.loc8_31, %n.ref.loc8_35 // CHECK:STDOUT: br !if.expr.result(%.loc8_33) // CHECK:STDOUT: diff --git a/toolchain/check/testdata/if_expression/constant_condition.carbon b/toolchain/check/testdata/if_expression/constant_condition.carbon index dcb672bb3ea1..db82561ba432 100644 --- a/toolchain/check/testdata/if_expression/constant_condition.carbon +++ b/toolchain/check/testdata/if_expression/constant_condition.carbon @@ -40,13 +40,13 @@ fn G() -> i32 { // CHECK:STDOUT: if %.loc11_13 br !if.expr.then else br !if.expr.else // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then: -// CHECK:STDOUT: %A.ref: = name_reference "A", file.%A +// CHECK:STDOUT: %A.ref: = name_reference A, file.%A // CHECK:STDOUT: %.loc11_24.1: init i32 = call %A.ref() // CHECK:STDOUT: %.loc11_24.2: i32 = value_of_initializer %.loc11_24.1 // CHECK:STDOUT: br !if.expr.result(%.loc11_24.2) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else: -// CHECK:STDOUT: %B.ref: = name_reference "B", file.%B +// CHECK:STDOUT: %B.ref: = name_reference B, file.%B // CHECK:STDOUT: %.loc11_33: init i32 = call %B.ref() // CHECK:STDOUT: %.loc11_27: i32 = value_of_initializer %.loc11_33 // CHECK:STDOUT: br !if.expr.result(%.loc11_27) @@ -62,13 +62,13 @@ fn G() -> i32 { // CHECK:STDOUT: if %.loc15_13 br !if.expr.then else br !if.expr.else // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then: -// CHECK:STDOUT: %A.ref: = name_reference "A", file.%A +// CHECK:STDOUT: %A.ref: = name_reference A, file.%A // CHECK:STDOUT: %.loc15_25.1: init i32 = call %A.ref() // CHECK:STDOUT: %.loc15_25.2: i32 = value_of_initializer %.loc15_25.1 // CHECK:STDOUT: br !if.expr.result(%.loc15_25.2) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else: -// CHECK:STDOUT: %B.ref: = name_reference "B", file.%B +// CHECK:STDOUT: %B.ref: = name_reference B, file.%B // CHECK:STDOUT: %.loc15_34: init i32 = call %B.ref() // CHECK:STDOUT: %.loc15_28: i32 = value_of_initializer %.loc15_34 // CHECK:STDOUT: br !if.expr.result(%.loc15_28) diff --git a/toolchain/check/testdata/if_expression/control_flow.carbon b/toolchain/check/testdata/if_expression/control_flow.carbon index 49c579c0e285..6da2c85c3085 100644 --- a/toolchain/check/testdata/if_expression/control_flow.carbon +++ b/toolchain/check/testdata/if_expression/control_flow.carbon @@ -31,17 +31,17 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%b: bool) -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %b.ref: bool = name_reference "b", %b +// CHECK:STDOUT: %b.ref: bool = name_reference b, %b // CHECK:STDOUT: if %b.ref br !if.expr.then else br !if.expr.else // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then: -// CHECK:STDOUT: %A.ref: = name_reference "A", file.%A +// CHECK:STDOUT: %A.ref: = name_reference A, file.%A // CHECK:STDOUT: %.loc11_21.1: init i32 = call %A.ref() // CHECK:STDOUT: %.loc11_21.2: i32 = value_of_initializer %.loc11_21.1 // CHECK:STDOUT: br !if.expr.result(%.loc11_21.2) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else: -// CHECK:STDOUT: %B.ref: = name_reference "B", file.%B +// CHECK:STDOUT: %B.ref: = name_reference B, file.%B // CHECK:STDOUT: %.loc11_30: init i32 = call %B.ref() // CHECK:STDOUT: %.loc11_24: i32 = value_of_initializer %.loc11_30 // CHECK:STDOUT: br !if.expr.result(%.loc11_24) diff --git a/toolchain/check/testdata/if_expression/fail_not_in_function.carbon b/toolchain/check/testdata/if_expression/fail_not_in_function.carbon index f4692fb7bb3d..1f393be78071 100644 --- a/toolchain/check/testdata/if_expression/fail_not_in_function.carbon +++ b/toolchain/check/testdata/if_expression/fail_not_in_function.carbon @@ -39,7 +39,7 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: file "fail_not_in_function.carbon" { // CHECK:STDOUT: %.loc17: i32 = block_arg -// CHECK:STDOUT: %x: i32 = bind_name "x", %.loc17 +// CHECK:STDOUT: %x: i32 = bind_name x, %.loc17 // CHECK:STDOUT: class_declaration @C, () // CHECK:STDOUT: %C: type = class_type @C // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/if_expression/nested.carbon b/toolchain/check/testdata/if_expression/nested.carbon index 232dd7c42556..17995f937d09 100644 --- a/toolchain/check/testdata/if_expression/nested.carbon +++ b/toolchain/check/testdata/if_expression/nested.carbon @@ -14,11 +14,11 @@ fn F(a: bool, b: bool, c: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%a: bool, %b: bool, %c: bool) -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a.ref: bool = name_reference "a", %a +// CHECK:STDOUT: %a.ref: bool = name_reference a, %a // CHECK:STDOUT: if %a.ref br !if.expr.then.loc8_10 else br !if.expr.else.loc8_10 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc8_10: -// CHECK:STDOUT: %b.ref: bool = name_reference "b", %b +// CHECK:STDOUT: %b.ref: bool = name_reference b, %b // CHECK:STDOUT: if %b.ref br !if.expr.then.loc8_20 else br !if.expr.else.loc8_20 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc8_20: @@ -34,7 +34,7 @@ fn F(a: bool, b: bool, c: bool) -> i32 { // CHECK:STDOUT: br !if.expr.result.loc8_10(%.loc8_20) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else.loc8_10: -// CHECK:STDOUT: %c.ref: bool = name_reference "c", %c +// CHECK:STDOUT: %c.ref: bool = name_reference c, %c // CHECK:STDOUT: if %c.ref br !if.expr.then.loc8_44 else br !if.expr.else.loc8_44 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc8_44: diff --git a/toolchain/check/testdata/if_expression/struct.carbon b/toolchain/check/testdata/if_expression/struct.carbon index 0f113b943f3c..8b573254ae49 100644 --- a/toolchain/check/testdata/if_expression/struct.carbon +++ b/toolchain/check/testdata/if_expression/struct.carbon @@ -26,8 +26,8 @@ fn F(cond: bool) { // CHECK:STDOUT: fn @F(%cond: bool) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc10_27: type = struct_type {.a: i32, .b: i32} -// CHECK:STDOUT: %a.var: ref {.a: i32, .b: i32} = var "a" -// CHECK:STDOUT: %a: ref {.a: i32, .b: i32} = bind_name "a", %a.var +// CHECK:STDOUT: %a.var: ref {.a: i32, .b: i32} = var a +// CHECK:STDOUT: %a: ref {.a: i32, .b: i32} = bind_name a, %a.var // CHECK:STDOUT: %.loc10_37: i32 = int_literal 1 // CHECK:STDOUT: %.loc10_45: i32 = int_literal 2 // CHECK:STDOUT: %.loc10_46.1: {.a: i32, .b: i32} = struct_literal (%.loc10_37, %.loc10_45) @@ -37,12 +37,12 @@ fn F(cond: bool) { // CHECK:STDOUT: %.loc10_46.5: init i32 = initialize_from %.loc10_45 to %.loc10_46.4 // CHECK:STDOUT: %.loc10_46.6: init {.a: i32, .b: i32} = struct_init %.loc10_46.1, (%.loc10_46.3, %.loc10_46.5) // CHECK:STDOUT: assign %a.var, %.loc10_46.6 -// CHECK:STDOUT: %G.ref: = name_reference "G", file.%G -// CHECK:STDOUT: %cond.ref: bool = name_reference "cond", %cond +// CHECK:STDOUT: %G.ref: = name_reference G, file.%G +// CHECK:STDOUT: %cond.ref: bool = name_reference cond, %cond // CHECK:STDOUT: if %cond.ref br !if.expr.then else br !if.expr.else // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then: -// CHECK:STDOUT: %a.ref.loc11_18: ref {.a: i32, .b: i32} = name_reference "a", %a +// CHECK:STDOUT: %a.ref.loc11_18: ref {.a: i32, .b: i32} = name_reference a, %a // CHECK:STDOUT: %.loc11_18.1: ref i32 = struct_access %a.ref.loc11_18, member0 // CHECK:STDOUT: %.loc11_18.2: i32 = bind_value %.loc11_18.1 // CHECK:STDOUT: %.loc11_18.3: ref i32 = struct_access %a.ref.loc11_18, member1 @@ -51,7 +51,7 @@ fn F(cond: bool) { // CHECK:STDOUT: br !if.expr.result(%.loc11_18.5) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else: -// CHECK:STDOUT: %a.ref.loc11_25: ref {.a: i32, .b: i32} = name_reference "a", %a +// CHECK:STDOUT: %a.ref.loc11_25: ref {.a: i32, .b: i32} = name_reference a, %a // CHECK:STDOUT: %.loc11_25.1: ref i32 = struct_access %a.ref.loc11_25, member0 // CHECK:STDOUT: %.loc11_25.2: i32 = bind_value %.loc11_25.1 // CHECK:STDOUT: %.loc11_25.3: ref i32 = struct_access %a.ref.loc11_25, member1 diff --git a/toolchain/check/testdata/index/array_element_access.carbon b/toolchain/check/testdata/index/array_element_access.carbon index 96fc7421d524..0f7fbe939c9d 100644 --- a/toolchain/check/testdata/index/array_element_access.carbon +++ b/toolchain/check/testdata/index/array_element_access.carbon @@ -17,8 +17,8 @@ var d: i32 = a[b]; // CHECK:STDOUT: file "array_element_access.carbon" { // CHECK:STDOUT: %.loc7_14: i32 = int_literal 2 // CHECK:STDOUT: %.loc7_15: type = array_type %.loc7_14, i32 -// CHECK:STDOUT: %a.var: ref [i32; 2] = var "a" -// CHECK:STDOUT: %a: ref [i32; 2] = bind_name "a", %a.var +// CHECK:STDOUT: %a.var: ref [i32; 2] = var a +// CHECK:STDOUT: %a: ref [i32; 2] = bind_name a, %a.var // CHECK:STDOUT: %.loc7_20: i32 = int_literal 12 // CHECK:STDOUT: %.loc7_24: i32 = int_literal 24 // CHECK:STDOUT: %.loc7_26.1: (i32, i32) = tuple_literal (%.loc7_20, %.loc7_24) @@ -30,21 +30,21 @@ var d: i32 = a[b]; // CHECK:STDOUT: %.loc7_26.7: init i32 = initialize_from %.loc7_24 to %.loc7_26.6 // CHECK:STDOUT: %.loc7_26.8: init [i32; 2] = array_init %.loc7_26.1, (%.loc7_26.4, %.loc7_26.7) to %a.var // CHECK:STDOUT: assign %a.var, %.loc7_26.8 -// CHECK:STDOUT: %b.var: ref i32 = var "b" -// CHECK:STDOUT: %b: ref i32 = bind_name "b", %b.var +// CHECK:STDOUT: %b.var: ref i32 = var b +// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var // CHECK:STDOUT: %.loc8: i32 = int_literal 1 // CHECK:STDOUT: assign %b.var, %.loc8 -// CHECK:STDOUT: %c.var: ref i32 = var "c" -// CHECK:STDOUT: %c: ref i32 = bind_name "c", %c.var -// CHECK:STDOUT: %a.ref.loc9: ref [i32; 2] = name_reference "a", %a +// CHECK:STDOUT: %c.var: ref i32 = var c +// CHECK:STDOUT: %c: ref i32 = bind_name c, %c.var +// CHECK:STDOUT: %a.ref.loc9: ref [i32; 2] = name_reference a, %a // CHECK:STDOUT: %.loc9_16: i32 = int_literal 0 // CHECK:STDOUT: %.loc9_17.1: ref i32 = array_index %a.ref.loc9, %.loc9_16 // CHECK:STDOUT: %.loc9_17.2: i32 = bind_value %.loc9_17.1 // CHECK:STDOUT: assign %c.var, %.loc9_17.2 -// CHECK:STDOUT: %d.var: ref i32 = var "d" -// CHECK:STDOUT: %d: ref i32 = bind_name "d", %d.var -// CHECK:STDOUT: %a.ref.loc10: ref [i32; 2] = name_reference "a", %a -// CHECK:STDOUT: %b.ref: ref i32 = name_reference "b", %b +// CHECK:STDOUT: %d.var: ref i32 = var d +// CHECK:STDOUT: %d: ref i32 = bind_name d, %d.var +// CHECK:STDOUT: %a.ref.loc10: ref [i32; 2] = name_reference a, %a +// CHECK:STDOUT: %b.ref: ref i32 = name_reference b, %b // CHECK:STDOUT: %.loc10_16: i32 = bind_value %b.ref // CHECK:STDOUT: %.loc10_17.1: ref i32 = array_index %a.ref.loc10, %.loc10_16 // CHECK:STDOUT: %.loc10_17.2: i32 = bind_value %.loc10_17.1 diff --git a/toolchain/check/testdata/index/expression_category.carbon b/toolchain/check/testdata/index/expression_category.carbon index b43ec78a5a2a..53dabfdeaa27 100644 --- a/toolchain/check/testdata/index/expression_category.carbon +++ b/toolchain/check/testdata/index/expression_category.carbon @@ -41,8 +41,8 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc10_16: i32 = int_literal 3 // CHECK:STDOUT: %.loc10_17: type = array_type %.loc10_16, i32 -// CHECK:STDOUT: %a.var: ref [i32; 3] = var "a" -// CHECK:STDOUT: %a: ref [i32; 3] = bind_name "a", %a.var +// CHECK:STDOUT: %a.var: ref [i32; 3] = var a +// CHECK:STDOUT: %a: ref [i32; 3] = bind_name a, %a.var // CHECK:STDOUT: %.loc10_22: i32 = int_literal 1 // CHECK:STDOUT: %.loc10_25: i32 = int_literal 2 // CHECK:STDOUT: %.loc10_28: i32 = int_literal 3 @@ -59,14 +59,14 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %.loc10_29.11: init [i32; 3] = array_init %.loc10_29.1, (%.loc10_29.4, %.loc10_29.7, %.loc10_29.10) to %a.var // CHECK:STDOUT: assign %a.var, %.loc10_29.11 // CHECK:STDOUT: %.loc13_14: type = ptr_type i32 -// CHECK:STDOUT: %pa.var: ref i32* = var "pa" -// CHECK:STDOUT: %pa: ref i32* = bind_name "pa", %pa.var -// CHECK:STDOUT: %a.ref.loc13: ref [i32; 3] = name_reference "a", %a +// CHECK:STDOUT: %pa.var: ref i32* = var pa +// CHECK:STDOUT: %pa: ref i32* = bind_name pa, %pa.var +// CHECK:STDOUT: %a.ref.loc13: ref [i32; 3] = name_reference a, %a // CHECK:STDOUT: %.loc13_21: i32 = int_literal 0 // CHECK:STDOUT: %.loc13_22: ref i32 = array_index %a.ref.loc13, %.loc13_21 // CHECK:STDOUT: %.loc13_18: i32* = address_of %.loc13_22 // CHECK:STDOUT: assign %pa.var, %.loc13_18 -// CHECK:STDOUT: %a.ref.loc14: ref [i32; 3] = name_reference "a", %a +// CHECK:STDOUT: %a.ref.loc14: ref [i32; 3] = name_reference a, %a // CHECK:STDOUT: %.loc14_5: i32 = int_literal 0 // CHECK:STDOUT: %.loc14_6: ref i32 = array_index %a.ref.loc14, %.loc14_5 // CHECK:STDOUT: %.loc14_10: i32 = int_literal 4 @@ -78,8 +78,8 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc18_16: i32 = int_literal 3 // CHECK:STDOUT: %.loc18_17: type = array_type %.loc18_16, i32 -// CHECK:STDOUT: %a.var: ref [i32; 3] = var "a" -// CHECK:STDOUT: %a: ref [i32; 3] = bind_name "a", %a.var +// CHECK:STDOUT: %a.var: ref [i32; 3] = var a +// CHECK:STDOUT: %a: ref [i32; 3] = bind_name a, %a.var // CHECK:STDOUT: %.loc18_22: i32 = int_literal 1 // CHECK:STDOUT: %.loc18_25: i32 = int_literal 2 // CHECK:STDOUT: %.loc18_28: i32 = int_literal 3 @@ -95,15 +95,15 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %.loc18_29.10: init i32 = initialize_from %.loc18_28 to %.loc18_29.9 // CHECK:STDOUT: %.loc18_29.11: init [i32; 3] = array_init %.loc18_29.1, (%.loc18_29.4, %.loc18_29.7, %.loc18_29.10) to %a.var // CHECK:STDOUT: assign %a.var, %.loc18_29.11 -// CHECK:STDOUT: %a.ref: ref [i32; 3] = name_reference "a", %a +// CHECK:STDOUT: %a.ref: ref [i32; 3] = name_reference a, %a // CHECK:STDOUT: %.loc22_5: i32 = int_literal 0 // CHECK:STDOUT: %.loc22_6: ref i32 = array_index %a.ref, %.loc22_5 -// CHECK:STDOUT: %b.ref: [i32; 3] = name_reference "b", %b +// CHECK:STDOUT: %b.ref: [i32; 3] = name_reference b, %b // CHECK:STDOUT: %.loc23_5: i32 = int_literal 0 // CHECK:STDOUT: %.loc23_6.1: ref [i32; 3] = value_as_reference %b.ref // CHECK:STDOUT: %.loc23_6.2: ref i32 = array_index %.loc23_6.1, %.loc23_5 // CHECK:STDOUT: %.loc23_6.3: i32 = bind_value %.loc23_6.2 -// CHECK:STDOUT: %F.ref: = name_reference "F", file.%F +// CHECK:STDOUT: %F.ref: = name_reference F, file.%F // CHECK:STDOUT: %.loc24_4.1: ref [i32; 3] = temporary_storage // CHECK:STDOUT: %.loc24_4.2: init [i32; 3] = call %F.ref() to %.loc24_4.1 // CHECK:STDOUT: %.loc24_7: i32 = int_literal 0 diff --git a/toolchain/check/testdata/index/fail_array_large_index.carbon b/toolchain/check/testdata/index/fail_array_large_index.carbon index 5c63f99019d9..da771dda9560 100644 --- a/toolchain/check/testdata/index/fail_array_large_index.carbon +++ b/toolchain/check/testdata/index/fail_array_large_index.carbon @@ -18,8 +18,8 @@ var b: i32 = a[0xFFFFFFFFFFFFFFFFF]; // CHECK:STDOUT: file "fail_array_large_index.carbon" { // CHECK:STDOUT: %.loc7_14: i32 = int_literal 1 // CHECK:STDOUT: %.loc7_15: type = array_type %.loc7_14, i32 -// CHECK:STDOUT: %a.var: ref [i32; 1] = var "a" -// CHECK:STDOUT: %a: ref [i32; 1] = bind_name "a", %a.var +// CHECK:STDOUT: %a.var: ref [i32; 1] = var a +// CHECK:STDOUT: %a: ref [i32; 1] = bind_name a, %a.var // CHECK:STDOUT: %.loc7_20: i32 = int_literal 12 // CHECK:STDOUT: %.loc7_23.1: (i32,) = tuple_literal (%.loc7_20) // CHECK:STDOUT: %.loc7_23.2: i32 = int_literal 0 @@ -27,9 +27,9 @@ var b: i32 = a[0xFFFFFFFFFFFFFFFFF]; // CHECK:STDOUT: %.loc7_23.4: init i32 = initialize_from %.loc7_20 to %.loc7_23.3 // CHECK:STDOUT: %.loc7_23.5: init [i32; 1] = array_init %.loc7_23.1, (%.loc7_23.4) to %a.var // CHECK:STDOUT: assign %a.var, %.loc7_23.5 -// CHECK:STDOUT: %b.var: ref i32 = var "b" -// CHECK:STDOUT: %b: ref i32 = bind_name "b", %b.var -// CHECK:STDOUT: %a.ref: ref [i32; 1] = name_reference "a", %a +// CHECK:STDOUT: %b.var: ref i32 = var b +// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var +// CHECK:STDOUT: %a.ref: ref [i32; 1] = name_reference a, %a // CHECK:STDOUT: %.loc11_16: i32 = int_literal 295147905179352825855 // CHECK:STDOUT: %.loc11_35.1: ref i32 = array_index %a.ref, // CHECK:STDOUT: %.loc11_35.2: i32 = bind_value %.loc11_35.1 diff --git a/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon b/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon index bdbb3e80c6ba..091bc2218a0a 100644 --- a/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon +++ b/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon @@ -18,8 +18,8 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: file "fail_array_non_int_indexing.carbon" { // CHECK:STDOUT: %.loc7_14: i32 = int_literal 1 // CHECK:STDOUT: %.loc7_15: type = array_type %.loc7_14, i32 -// CHECK:STDOUT: %a.var: ref [i32; 1] = var "a" -// CHECK:STDOUT: %a: ref [i32; 1] = bind_name "a", %a.var +// CHECK:STDOUT: %a.var: ref [i32; 1] = var a +// CHECK:STDOUT: %a: ref [i32; 1] = bind_name a, %a.var // CHECK:STDOUT: %.loc7_20: i32 = int_literal 12 // CHECK:STDOUT: %.loc7_23.1: (i32,) = tuple_literal (%.loc7_20) // CHECK:STDOUT: %.loc7_23.2: i32 = int_literal 0 @@ -27,9 +27,9 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: %.loc7_23.4: init i32 = initialize_from %.loc7_20 to %.loc7_23.3 // CHECK:STDOUT: %.loc7_23.5: init [i32; 1] = array_init %.loc7_23.1, (%.loc7_23.4) to %a.var // CHECK:STDOUT: assign %a.var, %.loc7_23.5 -// CHECK:STDOUT: %b.var: ref i32 = var "b" -// CHECK:STDOUT: %b: ref i32 = bind_name "b", %b.var -// CHECK:STDOUT: %a.ref: ref [i32; 1] = name_reference "a", %a +// CHECK:STDOUT: %b.var: ref i32 = var b +// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var +// CHECK:STDOUT: %a.ref: ref [i32; 1] = name_reference a, %a // CHECK:STDOUT: %.loc11_16: f64 = real_literal 26e-1 // CHECK:STDOUT: %.loc11_19.1: ref i32 = array_index %a.ref, // CHECK:STDOUT: %.loc11_19.2: i32 = bind_value %.loc11_19.1 diff --git a/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon b/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon index 119f5bf340c3..fff6230e8811 100644 --- a/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon +++ b/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon @@ -18,8 +18,8 @@ var b: i32 = a[2]; // CHECK:STDOUT: file "fail_array_out_of_bound_access.carbon" { // CHECK:STDOUT: %.loc7_14: i32 = int_literal 1 // CHECK:STDOUT: %.loc7_15: type = array_type %.loc7_14, i32 -// CHECK:STDOUT: %a.var: ref [i32; 1] = var "a" -// CHECK:STDOUT: %a: ref [i32; 1] = bind_name "a", %a.var +// CHECK:STDOUT: %a.var: ref [i32; 1] = var a +// CHECK:STDOUT: %a: ref [i32; 1] = bind_name a, %a.var // CHECK:STDOUT: %.loc7_20: i32 = int_literal 12 // CHECK:STDOUT: %.loc7_23.1: (i32,) = tuple_literal (%.loc7_20) // CHECK:STDOUT: %.loc7_23.2: i32 = int_literal 0 @@ -27,9 +27,9 @@ var b: i32 = a[2]; // CHECK:STDOUT: %.loc7_23.4: init i32 = initialize_from %.loc7_20 to %.loc7_23.3 // CHECK:STDOUT: %.loc7_23.5: init [i32; 1] = array_init %.loc7_23.1, (%.loc7_23.4) to %a.var // CHECK:STDOUT: assign %a.var, %.loc7_23.5 -// CHECK:STDOUT: %b.var: ref i32 = var "b" -// CHECK:STDOUT: %b: ref i32 = bind_name "b", %b.var -// CHECK:STDOUT: %a.ref: ref [i32; 1] = name_reference "a", %a +// CHECK:STDOUT: %b.var: ref i32 = var b +// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var +// CHECK:STDOUT: %a.ref: ref [i32; 1] = name_reference a, %a // CHECK:STDOUT: %.loc11_16: i32 = int_literal 2 // CHECK:STDOUT: %.loc11_17.1: ref i32 = array_index %a.ref, // CHECK:STDOUT: %.loc11_17.2: i32 = bind_value %.loc11_17.1 diff --git a/toolchain/check/testdata/index/fail_empty_tuple_access.carbon b/toolchain/check/testdata/index/fail_empty_tuple_access.carbon index 7047d7adb4a1..f1ba80eee186 100644 --- a/toolchain/check/testdata/index/fail_empty_tuple_access.carbon +++ b/toolchain/check/testdata/index/fail_empty_tuple_access.carbon @@ -29,7 +29,7 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: = name_reference "F", file.%F +// CHECK:STDOUT: %F.ref: = name_reference F, file.%F // CHECK:STDOUT: %.loc13_4.1: init () = call %F.ref() // CHECK:STDOUT: %.loc13_7: i32 = int_literal 0 // CHECK:STDOUT: %.loc13_4.2: ref () = temporary_storage diff --git a/toolchain/check/testdata/index/fail_expression_category.carbon b/toolchain/check/testdata/index/fail_expression_category.carbon index 03add28cb2f6..d9b27887c70c 100644 --- a/toolchain/check/testdata/index/fail_expression_category.carbon +++ b/toolchain/check/testdata/index/fail_expression_category.carbon @@ -43,16 +43,16 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: fn @G(%b: [i32; 3]) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc14_14: type = ptr_type i32 -// CHECK:STDOUT: %pb.var: ref i32* = var "pb" -// CHECK:STDOUT: %pb: ref i32* = bind_name "pb", %pb.var -// CHECK:STDOUT: %b.ref.loc14: [i32; 3] = name_reference "b", %b +// CHECK:STDOUT: %pb.var: ref i32* = var pb +// CHECK:STDOUT: %pb: ref i32* = bind_name pb, %pb.var +// CHECK:STDOUT: %b.ref.loc14: [i32; 3] = name_reference b, %b // CHECK:STDOUT: %.loc14_21: i32 = int_literal 0 // CHECK:STDOUT: %.loc14_22.1: ref [i32; 3] = value_as_reference %b.ref.loc14 // CHECK:STDOUT: %.loc14_22.2: ref i32 = array_index %.loc14_22.1, %.loc14_21 // CHECK:STDOUT: %.loc14_22.3: i32 = bind_value %.loc14_22.2 // CHECK:STDOUT: %.loc14_18: i32* = address_of %.loc14_22.3 // CHECK:STDOUT: assign %pb.var, %.loc14_18 -// CHECK:STDOUT: %b.ref.loc18: [i32; 3] = name_reference "b", %b +// CHECK:STDOUT: %b.ref.loc18: [i32; 3] = name_reference b, %b // CHECK:STDOUT: %.loc18_5: i32 = int_literal 0 // CHECK:STDOUT: %.loc18_6.1: ref [i32; 3] = value_as_reference %b.ref.loc18 // CHECK:STDOUT: %.loc18_6.2: ref i32 = array_index %.loc18_6.1, %.loc18_5 @@ -60,9 +60,9 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: %.loc18_10: i32 = int_literal 4 // CHECK:STDOUT: assign %.loc18_6.3, %.loc18_10 // CHECK:STDOUT: %.loc25_14: type = ptr_type i32 -// CHECK:STDOUT: %pf.var: ref i32* = var "pf" -// CHECK:STDOUT: %pf: ref i32* = bind_name "pf", %pf.var -// CHECK:STDOUT: %F.ref.loc25: = name_reference "F", file.%F +// CHECK:STDOUT: %pf.var: ref i32* = var pf +// CHECK:STDOUT: %pf: ref i32* = bind_name pf, %pf.var +// CHECK:STDOUT: %F.ref.loc25: = name_reference F, file.%F // CHECK:STDOUT: %.loc25_20.1: ref [i32; 3] = temporary_storage // CHECK:STDOUT: %.loc25_20.2: init [i32; 3] = call %F.ref.loc25() to %.loc25_20.1 // CHECK:STDOUT: %.loc25_23: i32 = int_literal 0 @@ -71,7 +71,7 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: %.loc25_24.2: i32 = bind_value %.loc25_24.1 // CHECK:STDOUT: %.loc25_18: i32* = address_of %.loc25_24.2 // CHECK:STDOUT: assign %pf.var, %.loc25_18 -// CHECK:STDOUT: %F.ref.loc29: = name_reference "F", file.%F +// CHECK:STDOUT: %F.ref.loc29: = name_reference F, file.%F // CHECK:STDOUT: %.loc29_4.1: ref [i32; 3] = temporary_storage // CHECK:STDOUT: %.loc29_4.2: init [i32; 3] = call %F.ref.loc29() to %.loc29_4.1 // CHECK:STDOUT: %.loc29_7: i32 = int_literal 0 diff --git a/toolchain/check/testdata/index/fail_invalid_base.carbon b/toolchain/check/testdata/index/fail_invalid_base.carbon index 65574dcdf7a8..dd6dc8a0e2bd 100644 --- a/toolchain/check/testdata/index/fail_invalid_base.carbon +++ b/toolchain/check/testdata/index/fail_invalid_base.carbon @@ -37,27 +37,27 @@ var d: i32 = {.a: i32, .b: i32}[0]; // CHECK:STDOUT: // CHECK:STDOUT: file "fail_invalid_base.carbon" { // CHECK:STDOUT: %.loc11: = namespace {} -// CHECK:STDOUT: %a.var: ref i32 = var "a" -// CHECK:STDOUT: %a: ref i32 = bind_name "a", %a.var -// CHECK:STDOUT: %N.ref: = name_reference "N", %.loc11 +// CHECK:STDOUT: %a.var: ref i32 = var a +// CHECK:STDOUT: %a: ref i32 = bind_name a, %a.var +// CHECK:STDOUT: %N.ref: = name_reference N, %.loc11 // CHECK:STDOUT: %.loc15: i32 = int_literal 0 // CHECK:STDOUT: assign %a.var, // CHECK:STDOUT: %F: = fn_decl @F -// CHECK:STDOUT: %b.var: ref i32 = var "b" -// CHECK:STDOUT: %b: ref i32 = bind_name "b", %b.var -// CHECK:STDOUT: %F.ref: = name_reference "F", %F +// CHECK:STDOUT: %b.var: ref i32 = var b +// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var +// CHECK:STDOUT: %F.ref: = name_reference F, %F // CHECK:STDOUT: %.loc21: i32 = int_literal 1 // CHECK:STDOUT: assign %b.var, -// CHECK:STDOUT: %c.var: ref i32 = var "c" -// CHECK:STDOUT: %c: ref i32 = bind_name "c", %c.var +// CHECK:STDOUT: %c.var: ref i32 = var c +// CHECK:STDOUT: %c: ref i32 = bind_name c, %c.var // CHECK:STDOUT: %.loc26_20: i32 = int_literal 1 // CHECK:STDOUT: %.loc26_28: i32 = int_literal 2 // CHECK:STDOUT: %.loc26_29.1: {.a: i32, .b: i32} = struct_literal (%.loc26_20, %.loc26_28) // CHECK:STDOUT: %.loc26_31: i32 = int_literal 0 // CHECK:STDOUT: %.loc26_29.2: {.a: i32, .b: i32} = struct_value %.loc26_29.1, (%.loc26_20, %.loc26_28) // CHECK:STDOUT: assign %c.var, -// CHECK:STDOUT: %d.var: ref i32 = var "d" -// CHECK:STDOUT: %d: ref i32 = bind_name "d", %d.var +// CHECK:STDOUT: %d.var: ref i32 = var d +// CHECK:STDOUT: %d: ref i32 = bind_name d, %d.var // CHECK:STDOUT: %.loc31_31: type = struct_type {.a: i32, .b: i32} // CHECK:STDOUT: %.loc31_33: i32 = int_literal 0 // CHECK:STDOUT: assign %d.var, diff --git a/toolchain/check/testdata/index/fail_name_not_found.carbon b/toolchain/check/testdata/index/fail_name_not_found.carbon index f3a4dfbc5090..9d95b8f680f5 100644 --- a/toolchain/check/testdata/index/fail_name_not_found.carbon +++ b/toolchain/check/testdata/index/fail_name_not_found.carbon @@ -17,9 +17,9 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %b.var: ref i32 = var "b" -// CHECK:STDOUT: %b: ref i32 = bind_name "b", %b.var -// CHECK:STDOUT: %a.ref: = name_reference "a", +// CHECK:STDOUT: %b.var: ref i32 = var b +// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var +// CHECK:STDOUT: %a.ref: = name_reference a, // CHECK:STDOUT: %.loc11: i32 = int_literal 0 // CHECK:STDOUT: assign %b.var, // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/index/fail_non_deterministic_type.carbon b/toolchain/check/testdata/index/fail_non_deterministic_type.carbon index a8c0d4651f52..b9a294964c4f 100644 --- a/toolchain/check/testdata/index/fail_non_deterministic_type.carbon +++ b/toolchain/check/testdata/index/fail_non_deterministic_type.carbon @@ -19,8 +19,8 @@ var c: i32 = a[b]; // CHECK:STDOUT: // CHECK:STDOUT: file "fail_non_deterministic_type.carbon" { // CHECK:STDOUT: %.loc7_17: (type, type) = tuple_literal (i32, i32) -// CHECK:STDOUT: %a.var: ref (i32, i32) = var "a" -// CHECK:STDOUT: %a: ref (i32, i32) = bind_name "a", %a.var +// CHECK:STDOUT: %a.var: ref (i32, i32) = var a +// CHECK:STDOUT: %a: ref (i32, i32) = bind_name a, %a.var // CHECK:STDOUT: %.loc7_22: i32 = int_literal 2 // CHECK:STDOUT: %.loc7_25: i32 = int_literal 3 // CHECK:STDOUT: %.loc7_26.1: (i32, i32) = tuple_literal (%.loc7_22, %.loc7_25) @@ -30,14 +30,14 @@ var c: i32 = a[b]; // CHECK:STDOUT: %.loc7_26.5: init i32 = initialize_from %.loc7_25 to %.loc7_26.4 // CHECK:STDOUT: %.loc7_26.6: init (i32, i32) = tuple_init %.loc7_26.1, (%.loc7_26.3, %.loc7_26.5) // CHECK:STDOUT: assign %a.var, %.loc7_26.6 -// CHECK:STDOUT: %b.var: ref i32 = var "b" -// CHECK:STDOUT: %b: ref i32 = bind_name "b", %b.var +// CHECK:STDOUT: %b.var: ref i32 = var b +// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var // CHECK:STDOUT: %.loc8: i32 = int_literal 0 // CHECK:STDOUT: assign %b.var, %.loc8 -// CHECK:STDOUT: %c.var: ref i32 = var "c" -// CHECK:STDOUT: %c: ref i32 = bind_name "c", %c.var -// CHECK:STDOUT: %a.ref: ref (i32, i32) = name_reference "a", %a -// CHECK:STDOUT: %b.ref: ref i32 = name_reference "b", %b +// CHECK:STDOUT: %c.var: ref i32 = var c +// CHECK:STDOUT: %c: ref i32 = bind_name c, %c.var +// CHECK:STDOUT: %a.ref: ref (i32, i32) = name_reference a, %a +// CHECK:STDOUT: %b.ref: ref i32 = name_reference b, %b // CHECK:STDOUT: %.loc12: ref = tuple_index %a.ref, // CHECK:STDOUT: assign %c.var, // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/index/fail_tuple_index_error.carbon b/toolchain/check/testdata/index/fail_tuple_index_error.carbon index 0ea7971ddc81..8aa7fa0d44c7 100644 --- a/toolchain/check/testdata/index/fail_tuple_index_error.carbon +++ b/toolchain/check/testdata/index/fail_tuple_index_error.carbon @@ -18,8 +18,8 @@ var b: i32 = a[oops]; // CHECK:STDOUT: // CHECK:STDOUT: file "fail_tuple_index_error.carbon" { // CHECK:STDOUT: %.loc7_17: (type, type) = tuple_literal (i32, i32) -// CHECK:STDOUT: %a.var: ref (i32, i32) = var "a" -// CHECK:STDOUT: %a: ref (i32, i32) = bind_name "a", %a.var +// CHECK:STDOUT: %a.var: ref (i32, i32) = var a +// CHECK:STDOUT: %a: ref (i32, i32) = bind_name a, %a.var // CHECK:STDOUT: %.loc7_22: i32 = int_literal 12 // CHECK:STDOUT: %.loc7_26: i32 = int_literal 6 // CHECK:STDOUT: %.loc7_27.1: (i32, i32) = tuple_literal (%.loc7_22, %.loc7_26) @@ -29,10 +29,10 @@ var b: i32 = a[oops]; // CHECK:STDOUT: %.loc7_27.5: init i32 = initialize_from %.loc7_26 to %.loc7_27.4 // CHECK:STDOUT: %.loc7_27.6: init (i32, i32) = tuple_init %.loc7_27.1, (%.loc7_27.3, %.loc7_27.5) // CHECK:STDOUT: assign %a.var, %.loc7_27.6 -// CHECK:STDOUT: %b.var: ref i32 = var "b" -// CHECK:STDOUT: %b: ref i32 = bind_name "b", %b.var -// CHECK:STDOUT: %a.ref: ref (i32, i32) = name_reference "a", %a -// CHECK:STDOUT: %oops.ref: = name_reference "oops", +// CHECK:STDOUT: %b.var: ref i32 = var b +// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var +// CHECK:STDOUT: %a.ref: ref (i32, i32) = name_reference a, %a +// CHECK:STDOUT: %oops.ref: = name_reference oops, // CHECK:STDOUT: %.loc11: ref = tuple_index %a.ref, %oops.ref // CHECK:STDOUT: assign %b.var, // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/index/fail_tuple_large_index.carbon b/toolchain/check/testdata/index/fail_tuple_large_index.carbon index 9efed1c6ee07..94228639e9ed 100644 --- a/toolchain/check/testdata/index/fail_tuple_large_index.carbon +++ b/toolchain/check/testdata/index/fail_tuple_large_index.carbon @@ -18,23 +18,23 @@ var c: i32 = b[0xFFFFFFFFFFFFFFFFF]; // CHECK:STDOUT: // CHECK:STDOUT: file "fail_tuple_large_index.carbon" { // CHECK:STDOUT: %.loc7_13: (type,) = tuple_literal (i32) -// CHECK:STDOUT: %a.var: ref (i32,) = var "a" -// CHECK:STDOUT: %a: ref (i32,) = bind_name "a", %a.var +// CHECK:STDOUT: %a.var: ref (i32,) = var a +// CHECK:STDOUT: %a: ref (i32,) = bind_name a, %a.var // CHECK:STDOUT: %.loc7_18: i32 = int_literal 12 // CHECK:STDOUT: %.loc7_21.1: (i32,) = tuple_literal (%.loc7_18) // CHECK:STDOUT: %.loc7_21.2: init (i32,) = tuple_init %.loc7_21.1, (%.loc7_18) // CHECK:STDOUT: assign %a.var, %.loc7_21.2 // CHECK:STDOUT: %.loc8_13: (type,) = tuple_literal (i32) -// CHECK:STDOUT: %b.var: ref (i32,) = var "b" -// CHECK:STDOUT: %b: ref (i32,) = bind_name "b", %b.var -// CHECK:STDOUT: %a.ref: ref (i32,) = name_reference "a", %a +// CHECK:STDOUT: %b.var: ref (i32,) = var b +// CHECK:STDOUT: %b: ref (i32,) = bind_name b, %b.var +// CHECK:STDOUT: %a.ref: ref (i32,) = name_reference a, %a // CHECK:STDOUT: %.loc8_17.1: ref i32 = tuple_access %a.ref, member0 // CHECK:STDOUT: %.loc8_17.2: i32 = bind_value %.loc8_17.1 // CHECK:STDOUT: %.loc8_17.3: init (i32,) = tuple_init %a.ref, (%.loc8_17.2) // CHECK:STDOUT: assign %b.var, %.loc8_17.3 -// CHECK:STDOUT: %c.var: ref i32 = var "c" -// CHECK:STDOUT: %c: ref i32 = bind_name "c", %c.var -// CHECK:STDOUT: %b.ref: ref (i32,) = name_reference "b", %b +// CHECK:STDOUT: %c.var: ref i32 = var c +// CHECK:STDOUT: %c: ref i32 = bind_name c, %c.var +// CHECK:STDOUT: %b.ref: ref (i32,) = name_reference b, %b // CHECK:STDOUT: %.loc12_16: i32 = int_literal 295147905179352825855 // CHECK:STDOUT: %.loc12_35: ref = tuple_index %b.ref, // CHECK:STDOUT: assign %c.var, diff --git a/toolchain/check/testdata/index/fail_tuple_non_int_indexing.carbon b/toolchain/check/testdata/index/fail_tuple_non_int_indexing.carbon index ecc4a15c195a..469e5f6c0d48 100644 --- a/toolchain/check/testdata/index/fail_tuple_non_int_indexing.carbon +++ b/toolchain/check/testdata/index/fail_tuple_non_int_indexing.carbon @@ -18,8 +18,8 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: // CHECK:STDOUT: file "fail_tuple_non_int_indexing.carbon" { // CHECK:STDOUT: %.loc7_17: (type, type) = tuple_literal (i32, i32) -// CHECK:STDOUT: %a.var: ref (i32, i32) = var "a" -// CHECK:STDOUT: %a: ref (i32, i32) = bind_name "a", %a.var +// CHECK:STDOUT: %a.var: ref (i32, i32) = var a +// CHECK:STDOUT: %a: ref (i32, i32) = bind_name a, %a.var // CHECK:STDOUT: %.loc7_22: i32 = int_literal 12 // CHECK:STDOUT: %.loc7_26: i32 = int_literal 6 // CHECK:STDOUT: %.loc7_27.1: (i32, i32) = tuple_literal (%.loc7_22, %.loc7_26) @@ -29,9 +29,9 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: %.loc7_27.5: init i32 = initialize_from %.loc7_26 to %.loc7_27.4 // CHECK:STDOUT: %.loc7_27.6: init (i32, i32) = tuple_init %.loc7_27.1, (%.loc7_27.3, %.loc7_27.5) // CHECK:STDOUT: assign %a.var, %.loc7_27.6 -// CHECK:STDOUT: %b.var: ref i32 = var "b" -// CHECK:STDOUT: %b: ref i32 = bind_name "b", %b.var -// CHECK:STDOUT: %a.ref: ref (i32, i32) = name_reference "a", %a +// CHECK:STDOUT: %b.var: ref i32 = var b +// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var +// CHECK:STDOUT: %a.ref: ref (i32, i32) = name_reference a, %a // CHECK:STDOUT: %.loc11_16: f64 = real_literal 26e-1 // CHECK:STDOUT: %.loc11_19: ref = tuple_index %a.ref, // CHECK:STDOUT: assign %b.var, diff --git a/toolchain/check/testdata/index/fail_tuple_out_of_bound_access.carbon b/toolchain/check/testdata/index/fail_tuple_out_of_bound_access.carbon index d1104ee1156a..d73146a3008a 100644 --- a/toolchain/check/testdata/index/fail_tuple_out_of_bound_access.carbon +++ b/toolchain/check/testdata/index/fail_tuple_out_of_bound_access.carbon @@ -18,8 +18,8 @@ var b: i32 = a[2]; // CHECK:STDOUT: // CHECK:STDOUT: file "fail_tuple_out_of_bound_access.carbon" { // CHECK:STDOUT: %.loc7_17: (type, type) = tuple_literal (i32, i32) -// CHECK:STDOUT: %a.var: ref (i32, i32) = var "a" -// CHECK:STDOUT: %a: ref (i32, i32) = bind_name "a", %a.var +// CHECK:STDOUT: %a.var: ref (i32, i32) = var a +// CHECK:STDOUT: %a: ref (i32, i32) = bind_name a, %a.var // CHECK:STDOUT: %.loc7_22: i32 = int_literal 12 // CHECK:STDOUT: %.loc7_26: i32 = int_literal 6 // CHECK:STDOUT: %.loc7_27.1: (i32, i32) = tuple_literal (%.loc7_22, %.loc7_26) @@ -29,9 +29,9 @@ var b: i32 = a[2]; // CHECK:STDOUT: %.loc7_27.5: init i32 = initialize_from %.loc7_26 to %.loc7_27.4 // CHECK:STDOUT: %.loc7_27.6: init (i32, i32) = tuple_init %.loc7_27.1, (%.loc7_27.3, %.loc7_27.5) // CHECK:STDOUT: assign %a.var, %.loc7_27.6 -// CHECK:STDOUT: %b.var: ref i32 = var "b" -// CHECK:STDOUT: %b: ref i32 = bind_name "b", %b.var -// CHECK:STDOUT: %a.ref: ref (i32, i32) = name_reference "a", %a +// CHECK:STDOUT: %b.var: ref i32 = var b +// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var +// CHECK:STDOUT: %a.ref: ref (i32, i32) = name_reference a, %a // CHECK:STDOUT: %.loc11_16: i32 = int_literal 2 // CHECK:STDOUT: %.loc11_17: ref = tuple_index %a.ref, // CHECK:STDOUT: assign %b.var, diff --git a/toolchain/check/testdata/index/tuple_element_access.carbon b/toolchain/check/testdata/index/tuple_element_access.carbon index 0695177d88a5..736d9e207432 100644 --- a/toolchain/check/testdata/index/tuple_element_access.carbon +++ b/toolchain/check/testdata/index/tuple_element_access.carbon @@ -15,23 +15,23 @@ var c: i32 = b[0]; // CHECK:STDOUT: // CHECK:STDOUT: file "tuple_element_access.carbon" { // CHECK:STDOUT: %.loc7_13: (type,) = tuple_literal (i32) -// CHECK:STDOUT: %a.var: ref (i32,) = var "a" -// CHECK:STDOUT: %a: ref (i32,) = bind_name "a", %a.var +// CHECK:STDOUT: %a.var: ref (i32,) = var a +// CHECK:STDOUT: %a: ref (i32,) = bind_name a, %a.var // CHECK:STDOUT: %.loc7_18: i32 = int_literal 12 // CHECK:STDOUT: %.loc7_21.1: (i32,) = tuple_literal (%.loc7_18) // CHECK:STDOUT: %.loc7_21.2: init (i32,) = tuple_init %.loc7_21.1, (%.loc7_18) // CHECK:STDOUT: assign %a.var, %.loc7_21.2 // CHECK:STDOUT: %.loc8_13: (type,) = tuple_literal (i32) -// CHECK:STDOUT: %b.var: ref (i32,) = var "b" -// CHECK:STDOUT: %b: ref (i32,) = bind_name "b", %b.var -// CHECK:STDOUT: %a.ref: ref (i32,) = name_reference "a", %a +// CHECK:STDOUT: %b.var: ref (i32,) = var b +// CHECK:STDOUT: %b: ref (i32,) = bind_name b, %b.var +// CHECK:STDOUT: %a.ref: ref (i32,) = name_reference a, %a // CHECK:STDOUT: %.loc8_17.1: ref i32 = tuple_access %a.ref, member0 // CHECK:STDOUT: %.loc8_17.2: i32 = bind_value %.loc8_17.1 // CHECK:STDOUT: %.loc8_17.3: init (i32,) = tuple_init %a.ref, (%.loc8_17.2) // CHECK:STDOUT: assign %b.var, %.loc8_17.3 -// CHECK:STDOUT: %c.var: ref i32 = var "c" -// CHECK:STDOUT: %c: ref i32 = bind_name "c", %c.var -// CHECK:STDOUT: %b.ref: ref (i32,) = name_reference "b", %b +// CHECK:STDOUT: %c.var: ref i32 = var c +// CHECK:STDOUT: %c: ref i32 = bind_name c, %c.var +// CHECK:STDOUT: %b.ref: ref (i32,) = name_reference b, %b // CHECK:STDOUT: %.loc9_16: i32 = int_literal 0 // CHECK:STDOUT: %.loc9_17.1: ref i32 = tuple_index %b.ref, %.loc9_16 // CHECK:STDOUT: %.loc9_17.2: i32 = bind_value %.loc9_17.1 diff --git a/toolchain/check/testdata/index/tuple_return_value_access.carbon b/toolchain/check/testdata/index/tuple_return_value_access.carbon index 5b7eadecdbfb..99c94559897c 100644 --- a/toolchain/check/testdata/index/tuple_return_value_access.carbon +++ b/toolchain/check/testdata/index/tuple_return_value_access.carbon @@ -30,7 +30,7 @@ fn Run() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: = name_reference "F", file.%F +// CHECK:STDOUT: %F.ref: = name_reference F, file.%F // CHECK:STDOUT: %.loc10_11.1: init (i32,) = call %F.ref() // CHECK:STDOUT: %.loc10_14: i32 = int_literal 0 // CHECK:STDOUT: %.loc10_11.2: ref (i32,) = temporary_storage diff --git a/toolchain/check/testdata/ir/duplicate_name_same_line.carbon b/toolchain/check/testdata/ir/duplicate_name_same_line.carbon index 8351e2aa0fd8..71a37a844655 100644 --- a/toolchain/check/testdata/ir/duplicate_name_same_line.carbon +++ b/toolchain/check/testdata/ir/duplicate_name_same_line.carbon @@ -16,8 +16,8 @@ fn A() { if (true) { var n: i32 = 1; } if (true) { var n: i32 = 2; } } // CHECK:STDOUT: if %.loc7_14 br !if.then.loc7_18 else br !if.else.loc7_18 // CHECK:STDOUT: // CHECK:STDOUT: !if.then.loc7_18: -// CHECK:STDOUT: %n.var.loc7_26: ref i32 = var "n" -// CHECK:STDOUT: %n.loc7_26: ref i32 = bind_name "n", %n.var.loc7_26 +// CHECK:STDOUT: %n.var.loc7_26: ref i32 = var n +// CHECK:STDOUT: %n.loc7_26: ref i32 = bind_name n, %n.var.loc7_26 // CHECK:STDOUT: %.loc7_35: i32 = int_literal 1 // CHECK:STDOUT: assign %n.var.loc7_26, %.loc7_35 // CHECK:STDOUT: br !if.else.loc7_18 @@ -27,8 +27,8 @@ fn A() { if (true) { var n: i32 = 1; } if (true) { var n: i32 = 2; } } // CHECK:STDOUT: if %.loc7_44 br !if.then.loc7_48 else br !if.else.loc7_48 // CHECK:STDOUT: // CHECK:STDOUT: !if.then.loc7_48: -// CHECK:STDOUT: %n.var.loc7_56: ref i32 = var "n" -// CHECK:STDOUT: %n.loc7_56: ref i32 = bind_name "n", %n.var.loc7_56 +// CHECK:STDOUT: %n.var.loc7_56: ref i32 = var n +// CHECK:STDOUT: %n.loc7_56: ref i32 = bind_name n, %n.var.loc7_56 // CHECK:STDOUT: %.loc7_65: i32 = int_literal 2 // CHECK:STDOUT: assign %n.var.loc7_56, %.loc7_65 // CHECK:STDOUT: br !if.else.loc7_48 diff --git a/toolchain/check/testdata/let/convert.carbon b/toolchain/check/testdata/let/convert.carbon index f76411f25258..f4d7d07a0eb0 100644 --- a/toolchain/check/testdata/let/convert.carbon +++ b/toolchain/check/testdata/let/convert.carbon @@ -24,8 +24,8 @@ fn F() -> i32 { // CHECK:STDOUT: fn @F() -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc8_24: (type, type, type) = tuple_literal (i32, i32, i32) -// CHECK:STDOUT: %v.var: ref (i32, i32, i32) = var "v" -// CHECK:STDOUT: %v: ref (i32, i32, i32) = bind_name "v", %v.var +// CHECK:STDOUT: %v.var: ref (i32, i32, i32) = var v +// CHECK:STDOUT: %v: ref (i32, i32, i32) = bind_name v, %v.var // CHECK:STDOUT: %.loc8_29: i32 = int_literal 1 // CHECK:STDOUT: %.loc8_32: i32 = int_literal 2 // CHECK:STDOUT: %.loc8_35: i32 = int_literal 3 @@ -39,7 +39,7 @@ fn F() -> i32 { // CHECK:STDOUT: %.loc8_36.8: init (i32, i32, i32) = tuple_init %.loc8_36.1, (%.loc8_36.3, %.loc8_36.5, %.loc8_36.7) // CHECK:STDOUT: assign %v.var, %.loc8_36.8 // CHECK:STDOUT: %.loc10_24: (type, type, type) = tuple_literal (i32, i32, i32) -// CHECK:STDOUT: %v.ref: ref (i32, i32, i32) = name_reference "v", %v +// CHECK:STDOUT: %v.ref: ref (i32, i32, i32) = name_reference v, %v // CHECK:STDOUT: %.loc10_28.1: ref i32 = tuple_access %v.ref, member0 // CHECK:STDOUT: %.loc10_28.2: i32 = bind_value %.loc10_28.1 // CHECK:STDOUT: %.loc10_28.3: ref i32 = tuple_access %v.ref, member1 @@ -47,8 +47,8 @@ fn F() -> i32 { // CHECK:STDOUT: %.loc10_28.5: ref i32 = tuple_access %v.ref, member2 // CHECK:STDOUT: %.loc10_28.6: i32 = bind_value %.loc10_28.5 // CHECK:STDOUT: %.loc10_28.7: (i32, i32, i32) = tuple_value %v.ref, (%.loc10_28.2, %.loc10_28.4, %.loc10_28.6) -// CHECK:STDOUT: %w: (i32, i32, i32) = bind_name "w", %.loc10_28.7 -// CHECK:STDOUT: %w.ref: (i32, i32, i32) = name_reference "w", %w +// CHECK:STDOUT: %w: (i32, i32, i32) = bind_name w, %.loc10_28.7 +// CHECK:STDOUT: %w.ref: (i32, i32, i32) = name_reference w, %w // CHECK:STDOUT: %.loc11_12: i32 = int_literal 1 // CHECK:STDOUT: %.loc11_13: i32 = tuple_index %w.ref, %.loc11_12 // CHECK:STDOUT: return %.loc11_13 diff --git a/toolchain/check/testdata/let/fail_duplicate_decl.carbon b/toolchain/check/testdata/let/fail_duplicate_decl.carbon index 52fd4ae1eaf6..9c9fecfe7571 100644 --- a/toolchain/check/testdata/let/fail_duplicate_decl.carbon +++ b/toolchain/check/testdata/let/fail_duplicate_decl.carbon @@ -21,6 +21,6 @@ fn F(a: i32) { // CHECK:STDOUT: fn @F(%a.loc7: i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc14: i32 = int_literal 1 -// CHECK:STDOUT: %a.loc14: i32 = bind_name "a", %.loc14 +// CHECK:STDOUT: %a.loc14: i32 = bind_name a, %.loc14 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/let/fail_use_in_init.carbon b/toolchain/check/testdata/let/fail_use_in_init.carbon index ecb68dba4388..f7ae4344aeca 100644 --- a/toolchain/check/testdata/let/fail_use_in_init.carbon +++ b/toolchain/check/testdata/let/fail_use_in_init.carbon @@ -17,7 +17,7 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a.ref: = name_reference "a", -// CHECK:STDOUT: %a: i32 = bind_name "a", +// CHECK:STDOUT: %a.ref: = name_reference a, +// CHECK:STDOUT: %a: i32 = bind_name a, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/let/global.carbon b/toolchain/check/testdata/let/global.carbon index 417b66156264..dc2efc8899ba 100644 --- a/toolchain/check/testdata/let/global.carbon +++ b/toolchain/check/testdata/let/global.carbon @@ -10,12 +10,12 @@ fn F() -> i32 { return n; } // CHECK:STDOUT: file "global.carbon" { // CHECK:STDOUT: %.loc7: i32 = int_literal 1 -// CHECK:STDOUT: %n: i32 = bind_name "n", %.loc7 +// CHECK:STDOUT: %n: i32 = bind_name n, %.loc7 // CHECK:STDOUT: %F: = fn_decl @F // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.ref: i32 = name_reference "n", file.%n +// CHECK:STDOUT: %n.ref: i32 = name_reference n, file.%n // CHECK:STDOUT: return %n.ref // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/let/local.carbon b/toolchain/check/testdata/let/local.carbon index be21e3a399ce..bad428e5463f 100644 --- a/toolchain/check/testdata/let/local.carbon +++ b/toolchain/check/testdata/let/local.carbon @@ -15,8 +15,8 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%a: i32) -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a.ref: i32 = name_reference "a", %a -// CHECK:STDOUT: %b: i32 = bind_name "b", %a.ref -// CHECK:STDOUT: %b.ref: i32 = name_reference "b", %b +// CHECK:STDOUT: %a.ref: i32 = name_reference a, %a +// CHECK:STDOUT: %b: i32 = bind_name b, %a.ref +// CHECK:STDOUT: %b.ref: i32 = name_reference b, %b // CHECK:STDOUT: return %b.ref // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/namespace/function.carbon b/toolchain/check/testdata/namespace/function.carbon index 41a7550f0879..87873b0e6162 100644 --- a/toolchain/check/testdata/namespace/function.carbon +++ b/toolchain/check/testdata/namespace/function.carbon @@ -40,8 +40,8 @@ fn Bar() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Bar() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Foo.ref: = name_reference "Foo", file.%.loc7 -// CHECK:STDOUT: %Baz.ref: = name_reference "Baz", file.%Baz.loc13 +// CHECK:STDOUT: %Foo.ref: = name_reference Foo, file.%.loc7 +// CHECK:STDOUT: %Baz.ref: = name_reference Baz, file.%Baz.loc13 // CHECK:STDOUT: %.loc17: init () = call %Baz.ref() // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/namespace/nested.carbon b/toolchain/check/testdata/namespace/nested.carbon index e01afce3b9c0..085048db395e 100644 --- a/toolchain/check/testdata/namespace/nested.carbon +++ b/toolchain/check/testdata/namespace/nested.carbon @@ -32,9 +32,9 @@ fn Foo.Bar.Baz() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Baz() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Foo.ref: = name_reference "Foo", file.%.loc7 -// CHECK:STDOUT: %Bar.ref: = name_reference "Bar", file.%.loc8 -// CHECK:STDOUT: %Wiz.ref: = name_reference "Wiz", file.%Wiz +// CHECK:STDOUT: %Foo.ref: = name_reference Foo, file.%.loc7 +// CHECK:STDOUT: %Bar.ref: = name_reference Bar, file.%.loc8 +// CHECK:STDOUT: %Wiz.ref: = name_reference Wiz, file.%Wiz // CHECK:STDOUT: %.loc14: init () = call %Wiz.ref() // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/namespace/shadow.carbon b/toolchain/check/testdata/namespace/shadow.carbon index 540d0a184b62..fc878b10ea51 100644 --- a/toolchain/check/testdata/namespace/shadow.carbon +++ b/toolchain/check/testdata/namespace/shadow.carbon @@ -41,17 +41,17 @@ fn N.M.B() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @B() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %A.ref.loc16: = name_reference "A", file.%A.loc10 +// CHECK:STDOUT: %A.ref.loc16: = name_reference A, file.%A.loc10 // CHECK:STDOUT: %.loc16: init () = call %A.ref.loc16() // CHECK:STDOUT: %.loc17: bool = bool_literal true // CHECK:STDOUT: if %.loc17 br !if.then else br !if.else // CHECK:STDOUT: // CHECK:STDOUT: !if.then: -// CHECK:STDOUT: %A.var: ref i32 = var "A" -// CHECK:STDOUT: %A: ref i32 = bind_name "A", %A.var +// CHECK:STDOUT: %A.var: ref i32 = var A +// CHECK:STDOUT: %A: ref i32 = bind_name A, %A.var // CHECK:STDOUT: %.loc18: i32 = int_literal 0 // CHECK:STDOUT: assign %A.var, %.loc18 -// CHECK:STDOUT: %A.ref.loc21: ref i32 = name_reference "A", %A +// CHECK:STDOUT: %A.ref.loc21: ref i32 = name_reference A, %A // CHECK:STDOUT: %.loc21: i32 = bind_value %A.ref.loc21 // CHECK:STDOUT: return %.loc21 // CHECK:STDOUT: diff --git a/toolchain/check/testdata/namespace/unqualified_lookup.carbon b/toolchain/check/testdata/namespace/unqualified_lookup.carbon index b9b07a70b396..1ab873098630 100644 --- a/toolchain/check/testdata/namespace/unqualified_lookup.carbon +++ b/toolchain/check/testdata/namespace/unqualified_lookup.carbon @@ -49,27 +49,27 @@ fn OuterN.InnerN.CallABC() { // CHECK:STDOUT: // CHECK:STDOUT: fn @CallA() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %A.ref: = name_reference "A", file.%A +// CHECK:STDOUT: %A.ref: = name_reference A, file.%A // CHECK:STDOUT: %.loc15: init () = call %A.ref() // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @CallAB() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %A.ref: = name_reference "A", file.%A +// CHECK:STDOUT: %A.ref: = name_reference A, file.%A // CHECK:STDOUT: %.loc19: init () = call %A.ref() -// CHECK:STDOUT: %B.ref: = name_reference "B", file.%B +// CHECK:STDOUT: %B.ref: = name_reference B, file.%B // CHECK:STDOUT: %.loc20: init () = call %B.ref() // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @CallABC() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %A.ref: = name_reference "A", file.%A +// CHECK:STDOUT: %A.ref: = name_reference A, file.%A // CHECK:STDOUT: %.loc24: init () = call %A.ref() -// CHECK:STDOUT: %B.ref: = name_reference "B", file.%B +// CHECK:STDOUT: %B.ref: = name_reference B, file.%B // CHECK:STDOUT: %.loc25: init () = call %B.ref() -// CHECK:STDOUT: %C.ref: = name_reference "C", file.%C +// CHECK:STDOUT: %C.ref: = name_reference C, file.%C // CHECK:STDOUT: %.loc26: init () = call %C.ref() // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/operators/and.carbon b/toolchain/check/testdata/operators/and.carbon index 31a00c384774..d480b8d8a3a5 100644 --- a/toolchain/check/testdata/operators/and.carbon +++ b/toolchain/check/testdata/operators/and.carbon @@ -31,14 +31,14 @@ fn And() -> bool { // CHECK:STDOUT: // CHECK:STDOUT: fn @And() -> bool { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: = name_reference "F", file.%F +// CHECK:STDOUT: %F.ref: = name_reference F, file.%F // CHECK:STDOUT: %.loc11_11: init bool = call %F.ref() // CHECK:STDOUT: %.loc11_14.1: bool = value_of_initializer %.loc11_11 // CHECK:STDOUT: %.loc11_14.2: bool = bool_literal false // CHECK:STDOUT: if %.loc11_14.1 br !and.rhs else br !and.result(%.loc11_14.2) // CHECK:STDOUT: // CHECK:STDOUT: !and.rhs: -// CHECK:STDOUT: %G.ref: = name_reference "G", file.%G +// CHECK:STDOUT: %G.ref: = name_reference G, file.%G // CHECK:STDOUT: %.loc11_19: init bool = call %G.ref() // CHECK:STDOUT: %.loc11_14.3: bool = value_of_initializer %.loc11_19 // CHECK:STDOUT: br !and.result(%.loc11_14.3) diff --git a/toolchain/check/testdata/operators/assignment.carbon b/toolchain/check/testdata/operators/assignment.carbon index b563cd96c61d..f4daf25a7c39 100644 --- a/toolchain/check/testdata/operators/assignment.carbon +++ b/toolchain/check/testdata/operators/assignment.carbon @@ -35,16 +35,16 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a.var: ref i32 = var "a" -// CHECK:STDOUT: %a: ref i32 = bind_name "a", %a.var +// CHECK:STDOUT: %a.var: ref i32 = var a +// CHECK:STDOUT: %a: ref i32 = bind_name a, %a.var // CHECK:STDOUT: %.loc8: i32 = int_literal 12 // CHECK:STDOUT: assign %a.var, %.loc8 -// CHECK:STDOUT: %a.ref.loc9: ref i32 = name_reference "a", %a +// CHECK:STDOUT: %a.ref.loc9: ref i32 = name_reference a, %a // CHECK:STDOUT: %.loc9: i32 = int_literal 9 // CHECK:STDOUT: assign %a.ref.loc9, %.loc9 // CHECK:STDOUT: %.loc11_19: (type, type) = tuple_literal (i32, i32) -// CHECK:STDOUT: %b.var: ref (i32, i32) = var "b" -// CHECK:STDOUT: %b: ref (i32, i32) = bind_name "b", %b.var +// CHECK:STDOUT: %b.var: ref (i32, i32) = var b +// CHECK:STDOUT: %b: ref (i32, i32) = bind_name b, %b.var // CHECK:STDOUT: %.loc11_24: i32 = int_literal 1 // CHECK:STDOUT: %.loc11_27: i32 = int_literal 2 // CHECK:STDOUT: %.loc11_28.1: (i32, i32) = tuple_literal (%.loc11_24, %.loc11_27) @@ -54,19 +54,19 @@ fn Main() { // CHECK:STDOUT: %.loc11_28.5: init i32 = initialize_from %.loc11_27 to %.loc11_28.4 // CHECK:STDOUT: %.loc11_28.6: init (i32, i32) = tuple_init %.loc11_28.1, (%.loc11_28.3, %.loc11_28.5) // CHECK:STDOUT: assign %b.var, %.loc11_28.6 -// CHECK:STDOUT: %b.ref.loc12: ref (i32, i32) = name_reference "b", %b +// CHECK:STDOUT: %b.ref.loc12: ref (i32, i32) = name_reference b, %b // CHECK:STDOUT: %.loc12_5: i32 = int_literal 0 // CHECK:STDOUT: %.loc12_6: ref i32 = tuple_index %b.ref.loc12, %.loc12_5 // CHECK:STDOUT: %.loc12_10: i32 = int_literal 3 // CHECK:STDOUT: assign %.loc12_6, %.loc12_10 -// CHECK:STDOUT: %b.ref.loc13: ref (i32, i32) = name_reference "b", %b +// CHECK:STDOUT: %b.ref.loc13: ref (i32, i32) = name_reference b, %b // CHECK:STDOUT: %.loc13_5: i32 = int_literal 1 // CHECK:STDOUT: %.loc13_6: ref i32 = tuple_index %b.ref.loc13, %.loc13_5 // CHECK:STDOUT: %.loc13_10: i32 = int_literal 4 // CHECK:STDOUT: assign %.loc13_6, %.loc13_10 // CHECK:STDOUT: %.loc15_27: type = struct_type {.a: i32, .b: i32} -// CHECK:STDOUT: %c.var: ref {.a: i32, .b: i32} = var "c" -// CHECK:STDOUT: %c: ref {.a: i32, .b: i32} = bind_name "c", %c.var +// CHECK:STDOUT: %c.var: ref {.a: i32, .b: i32} = var c +// CHECK:STDOUT: %c: ref {.a: i32, .b: i32} = bind_name c, %c.var // CHECK:STDOUT: %.loc15_37: i32 = int_literal 1 // CHECK:STDOUT: %.loc15_45: i32 = int_literal 2 // CHECK:STDOUT: %.loc15_46.1: {.a: i32, .b: i32} = struct_literal (%.loc15_37, %.loc15_45) @@ -76,21 +76,21 @@ fn Main() { // CHECK:STDOUT: %.loc15_46.5: init i32 = initialize_from %.loc15_45 to %.loc15_46.4 // CHECK:STDOUT: %.loc15_46.6: init {.a: i32, .b: i32} = struct_init %.loc15_46.1, (%.loc15_46.3, %.loc15_46.5) // CHECK:STDOUT: assign %c.var, %.loc15_46.6 -// CHECK:STDOUT: %c.ref.loc16: ref {.a: i32, .b: i32} = name_reference "c", %c +// CHECK:STDOUT: %c.ref.loc16: ref {.a: i32, .b: i32} = name_reference c, %c // CHECK:STDOUT: %.loc16_4: ref i32 = struct_access %c.ref.loc16, member0 // CHECK:STDOUT: %.loc16_9: i32 = int_literal 3 // CHECK:STDOUT: assign %.loc16_4, %.loc16_9 -// CHECK:STDOUT: %c.ref.loc17: ref {.a: i32, .b: i32} = name_reference "c", %c +// CHECK:STDOUT: %c.ref.loc17: ref {.a: i32, .b: i32} = name_reference c, %c // CHECK:STDOUT: %.loc17_4: ref i32 = struct_access %c.ref.loc17, member1 // CHECK:STDOUT: %.loc17_9: i32 = int_literal 4 // CHECK:STDOUT: assign %.loc17_4, %.loc17_9 // CHECK:STDOUT: %.loc19_13: type = ptr_type i32 -// CHECK:STDOUT: %p.var: ref i32* = var "p" -// CHECK:STDOUT: %p: ref i32* = bind_name "p", %p.var -// CHECK:STDOUT: %a.ref.loc19: ref i32 = name_reference "a", %a +// CHECK:STDOUT: %p.var: ref i32* = var p +// CHECK:STDOUT: %p: ref i32* = bind_name p, %p.var +// CHECK:STDOUT: %a.ref.loc19: ref i32 = name_reference a, %a // CHECK:STDOUT: %.loc19_17: i32* = address_of %a.ref.loc19 // CHECK:STDOUT: assign %p.var, %.loc19_17 -// CHECK:STDOUT: %p.ref.loc20: ref i32* = name_reference "p", %p +// CHECK:STDOUT: %p.ref.loc20: ref i32* = name_reference p, %p // CHECK:STDOUT: %.loc20_4: i32* = bind_value %p.ref.loc20 // CHECK:STDOUT: %.loc20_3: ref i32 = dereference %.loc20_4 // CHECK:STDOUT: %.loc20_8: i32 = int_literal 5 @@ -99,12 +99,12 @@ fn Main() { // CHECK:STDOUT: if %.loc22_8 br !if.expr.then else br !if.expr.else // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then: -// CHECK:STDOUT: %p.ref.loc22: ref i32* = name_reference "p", %p +// CHECK:STDOUT: %p.ref.loc22: ref i32* = name_reference p, %p // CHECK:STDOUT: %.loc22_18: i32* = bind_value %p.ref.loc22 // CHECK:STDOUT: br !if.expr.result(%.loc22_18) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else: -// CHECK:STDOUT: %a.ref.loc22: ref i32 = name_reference "a", %a +// CHECK:STDOUT: %a.ref.loc22: ref i32 = name_reference a, %a // CHECK:STDOUT: %.loc22_25: i32* = address_of %a.ref.loc22 // CHECK:STDOUT: br !if.expr.result(%.loc22_25) // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/fail_assignment_to_error.carbon b/toolchain/check/testdata/operators/fail_assignment_to_error.carbon index fb05c86f66d5..640eff739221 100644 --- a/toolchain/check/testdata/operators/fail_assignment_to_error.carbon +++ b/toolchain/check/testdata/operators/fail_assignment_to_error.carbon @@ -21,10 +21,10 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %undeclared.ref: = name_reference "undeclared", +// CHECK:STDOUT: %undeclared.ref: = name_reference undeclared, // CHECK:STDOUT: %.loc11: i32 = int_literal 42 // CHECK:STDOUT: assign %undeclared.ref, -// CHECK:STDOUT: %also_undeclared.ref: = name_reference "also_undeclared", +// CHECK:STDOUT: %also_undeclared.ref: = name_reference also_undeclared, // CHECK:STDOUT: %.loc15_3: ref = dereference // CHECK:STDOUT: %.loc15_22: i32 = int_literal 42 // CHECK:STDOUT: assign %.loc15_3, diff --git a/toolchain/check/testdata/operators/fail_assignment_to_non_assignable.carbon b/toolchain/check/testdata/operators/fail_assignment_to_non_assignable.carbon index 87e02bff08a4..61c12be689e5 100644 --- a/toolchain/check/testdata/operators/fail_assignment_to_non_assignable.carbon +++ b/toolchain/check/testdata/operators/fail_assignment_to_non_assignable.carbon @@ -64,7 +64,7 @@ fn Main() { // CHECK:STDOUT: %.loc13_3: i32 = int_literal 1 // CHECK:STDOUT: %.loc13_7: i32 = int_literal 2 // CHECK:STDOUT: assign %.loc13_3, %.loc13_7 -// CHECK:STDOUT: %F.ref: = name_reference "F", file.%F +// CHECK:STDOUT: %F.ref: = name_reference F, file.%F // CHECK:STDOUT: %.loc17_4: init i32 = call %F.ref() // CHECK:STDOUT: %.loc17_9: i32 = int_literal 1 // CHECK:STDOUT: assign %.loc17_4, %.loc17_9 @@ -81,12 +81,12 @@ fn Main() { // CHECK:STDOUT: %.loc21_17.6: init (i32, i32) = tuple_init %.loc21_17.1, (%.loc21_17.3, %.loc21_17.5) // CHECK:STDOUT: assign %.loc21_8.1, %.loc21_17.6 // CHECK:STDOUT: %.loc21_8.2: (i32, i32) = tuple_value %.loc21_8.1, (%.loc21_4, %.loc21_7) -// CHECK:STDOUT: %n.var: ref i32 = var "n" -// CHECK:STDOUT: %n: ref i32 = bind_name "n", %n.var +// CHECK:STDOUT: %n.var: ref i32 = var n +// CHECK:STDOUT: %n: ref i32 = bind_name n, %n.var // CHECK:STDOUT: %.loc22: i32 = int_literal 0 // CHECK:STDOUT: assign %n.var, %.loc22 -// CHECK:STDOUT: %n.ref.loc26_4: ref i32 = name_reference "n", %n -// CHECK:STDOUT: %n.ref.loc26_7: ref i32 = name_reference "n", %n +// CHECK:STDOUT: %n.ref.loc26_4: ref i32 = name_reference n, %n +// CHECK:STDOUT: %n.ref.loc26_7: ref i32 = name_reference n, %n // CHECK:STDOUT: %.loc26_8.1: (i32, i32) = tuple_literal (%n.ref.loc26_4, %n.ref.loc26_7) // CHECK:STDOUT: %.loc26_13: i32 = int_literal 1 // CHECK:STDOUT: %.loc26_16: i32 = int_literal 2 @@ -130,18 +130,18 @@ fn Main() { // CHECK:STDOUT: %.loc38_4: i32 = block_arg !if.expr.result.loc38 // CHECK:STDOUT: %.loc38_29: i32 = int_literal 3 // CHECK:STDOUT: assign %.loc38_4, %.loc38_29 -// CHECK:STDOUT: %a.var: ref i32 = var "a" -// CHECK:STDOUT: %a: ref i32 = bind_name "a", %a.var +// CHECK:STDOUT: %a.var: ref i32 = var a +// CHECK:STDOUT: %a: ref i32 = bind_name a, %a.var // CHECK:STDOUT: %.loc45_7: bool = bool_literal true // CHECK:STDOUT: if %.loc45_7 br !if.expr.then.loc45 else br !if.expr.else.loc45 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc45: -// CHECK:STDOUT: %a.ref.loc45_17: ref i32 = name_reference "a", %a +// CHECK:STDOUT: %a.ref.loc45_17: ref i32 = name_reference a, %a // CHECK:STDOUT: %.loc45_17: i32 = bind_value %a.ref.loc45_17 // CHECK:STDOUT: br !if.expr.result.loc45(%.loc45_17) // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.else.loc45: -// CHECK:STDOUT: %a.ref.loc45_24: ref i32 = name_reference "a", %a +// CHECK:STDOUT: %a.ref.loc45_24: ref i32 = name_reference a, %a // CHECK:STDOUT: %.loc45_24: i32 = bind_value %a.ref.loc45_24 // CHECK:STDOUT: br !if.expr.result.loc45(%.loc45_24) // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/fail_type_mismatch_assignment.carbon b/toolchain/check/testdata/operators/fail_type_mismatch_assignment.carbon index ebf2cf74c757..cf993edc9ac3 100644 --- a/toolchain/check/testdata/operators/fail_type_mismatch_assignment.carbon +++ b/toolchain/check/testdata/operators/fail_type_mismatch_assignment.carbon @@ -18,11 +18,11 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a.var: ref i32 = var "a" -// CHECK:STDOUT: %a: ref i32 = bind_name "a", %a.var +// CHECK:STDOUT: %a.var: ref i32 = var a +// CHECK:STDOUT: %a: ref i32 = bind_name a, %a.var // CHECK:STDOUT: %.loc8: i32 = int_literal 3 // CHECK:STDOUT: assign %a.var, %.loc8 -// CHECK:STDOUT: %a.ref: ref i32 = name_reference "a", %a +// CHECK:STDOUT: %a.ref: ref i32 = name_reference a, %a // CHECK:STDOUT: %.loc12: f64 = real_literal 56e-1 // CHECK:STDOUT: assign %a.ref, // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/operators/or.carbon b/toolchain/check/testdata/operators/or.carbon index a497846a711d..62ab2ab5bfc1 100644 --- a/toolchain/check/testdata/operators/or.carbon +++ b/toolchain/check/testdata/operators/or.carbon @@ -31,7 +31,7 @@ fn Or() -> bool { // CHECK:STDOUT: // CHECK:STDOUT: fn @Or() -> bool { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: = name_reference "F", file.%F +// CHECK:STDOUT: %F.ref: = name_reference F, file.%F // CHECK:STDOUT: %.loc11_11: init bool = call %F.ref() // CHECK:STDOUT: %.loc11_14.1: bool = value_of_initializer %.loc11_11 // CHECK:STDOUT: %.loc11_14.2: bool = not %.loc11_14.1 @@ -39,7 +39,7 @@ fn Or() -> bool { // CHECK:STDOUT: if %.loc11_14.2 br !or.rhs else br !or.result(%.loc11_14.3) // CHECK:STDOUT: // CHECK:STDOUT: !or.rhs: -// CHECK:STDOUT: %G.ref: = name_reference "G", file.%G +// CHECK:STDOUT: %G.ref: = name_reference G, file.%G // CHECK:STDOUT: %.loc11_18: init bool = call %G.ref() // CHECK:STDOUT: %.loc11_14.4: bool = value_of_initializer %.loc11_18 // CHECK:STDOUT: br !or.result(%.loc11_14.4) diff --git a/toolchain/check/testdata/operators/unary_op.carbon b/toolchain/check/testdata/operators/unary_op.carbon index 8c56bd4e995d..296dc713a0c8 100644 --- a/toolchain/check/testdata/operators/unary_op.carbon +++ b/toolchain/check/testdata/operators/unary_op.carbon @@ -14,7 +14,7 @@ fn Not(b: bool) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: fn @Not(%b: bool) -> bool { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %b.ref: bool = name_reference "b", %b +// CHECK:STDOUT: %b.ref: bool = name_reference b, %b // CHECK:STDOUT: %.loc8: bool = not %b.ref // CHECK:STDOUT: return %.loc8 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/pointer/address_of_deref.carbon b/toolchain/check/testdata/pointer/address_of_deref.carbon index a02257808405..70180303a90b 100644 --- a/toolchain/check/testdata/pointer/address_of_deref.carbon +++ b/toolchain/check/testdata/pointer/address_of_deref.carbon @@ -19,11 +19,11 @@ fn F() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.var: ref i32 = var "n" -// CHECK:STDOUT: %n: ref i32 = bind_name "n", %n.var +// CHECK:STDOUT: %n.var: ref i32 = var n +// CHECK:STDOUT: %n: ref i32 = bind_name n, %n.var // CHECK:STDOUT: %.loc8: i32 = int_literal 0 // CHECK:STDOUT: assign %n.var, %.loc8 -// CHECK:STDOUT: %n.ref: ref i32 = name_reference "n", %n +// CHECK:STDOUT: %n.ref: ref i32 = name_reference n, %n // CHECK:STDOUT: %.loc9_13: i32* = address_of %n.ref // CHECK:STDOUT: %.loc9_12: ref i32 = dereference %.loc9_13 // CHECK:STDOUT: %.loc9_11: i32* = address_of %.loc9_12 diff --git a/toolchain/check/testdata/pointer/address_of_lvalue.carbon b/toolchain/check/testdata/pointer/address_of_lvalue.carbon index c33f73cdf0c7..421852bab457 100644 --- a/toolchain/check/testdata/pointer/address_of_lvalue.carbon +++ b/toolchain/check/testdata/pointer/address_of_lvalue.carbon @@ -30,8 +30,8 @@ fn F() { // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc8_27: type = struct_type {.a: i32, .b: i32} -// CHECK:STDOUT: %s.var: ref {.a: i32, .b: i32} = var "s" -// CHECK:STDOUT: %s: ref {.a: i32, .b: i32} = bind_name "s", %s.var +// CHECK:STDOUT: %s.var: ref {.a: i32, .b: i32} = var s +// CHECK:STDOUT: %s: ref {.a: i32, .b: i32} = bind_name s, %s.var // CHECK:STDOUT: %.loc8_37: i32 = int_literal 1 // CHECK:STDOUT: %.loc8_45: i32 = int_literal 2 // CHECK:STDOUT: %.loc8_46.1: {.a: i32, .b: i32} = struct_literal (%.loc8_37, %.loc8_45) @@ -43,28 +43,28 @@ fn F() { // CHECK:STDOUT: assign %s.var, %.loc8_46.6 // CHECK:STDOUT: %.loc10_27: type = struct_type {.a: i32, .b: i32} // CHECK:STDOUT: %.loc10_28: type = ptr_type {.a: i32, .b: i32} -// CHECK:STDOUT: %p.var: ref {.a: i32, .b: i32}* = var "p" -// CHECK:STDOUT: %p: ref {.a: i32, .b: i32}* = bind_name "p", %p.var -// CHECK:STDOUT: %s.ref.loc10: ref {.a: i32, .b: i32} = name_reference "s", %s +// CHECK:STDOUT: %p.var: ref {.a: i32, .b: i32}* = var p +// CHECK:STDOUT: %p: ref {.a: i32, .b: i32}* = bind_name p, %p.var +// CHECK:STDOUT: %s.ref.loc10: ref {.a: i32, .b: i32} = name_reference s, %s // CHECK:STDOUT: %.loc10_32: {.a: i32, .b: i32}* = address_of %s.ref.loc10 // CHECK:STDOUT: assign %p.var, %.loc10_32 // CHECK:STDOUT: %.loc11_13: type = ptr_type i32 -// CHECK:STDOUT: %q.var: ref i32* = var "q" -// CHECK:STDOUT: %q: ref i32* = bind_name "q", %q.var -// CHECK:STDOUT: %s.ref.loc11: ref {.a: i32, .b: i32} = name_reference "s", %s +// CHECK:STDOUT: %q.var: ref i32* = var q +// CHECK:STDOUT: %q: ref i32* = bind_name q, %q.var +// CHECK:STDOUT: %s.ref.loc11: ref {.a: i32, .b: i32} = name_reference s, %s // CHECK:STDOUT: %.loc11_19: ref i32 = struct_access %s.ref.loc11, member0 // CHECK:STDOUT: %.loc11_17: i32* = address_of %.loc11_19 // CHECK:STDOUT: assign %q.var, %.loc11_17 // CHECK:STDOUT: %.loc12_13: type = ptr_type i32 -// CHECK:STDOUT: %r.var: ref i32* = var "r" -// CHECK:STDOUT: %r: ref i32* = bind_name "r", %r.var -// CHECK:STDOUT: %s.ref.loc12: ref {.a: i32, .b: i32} = name_reference "s", %s +// CHECK:STDOUT: %r.var: ref i32* = var r +// CHECK:STDOUT: %r: ref i32* = bind_name r, %r.var +// CHECK:STDOUT: %s.ref.loc12: ref {.a: i32, .b: i32} = name_reference s, %s // CHECK:STDOUT: %.loc12_19: ref i32 = struct_access %s.ref.loc12, member1 // CHECK:STDOUT: %.loc12_17: i32* = address_of %.loc12_19 // CHECK:STDOUT: assign %r.var, %.loc12_17 // CHECK:STDOUT: %.loc14_19: (type, type) = tuple_literal (i32, i32) -// CHECK:STDOUT: %t.var: ref (i32, i32) = var "t" -// CHECK:STDOUT: %t: ref (i32, i32) = bind_name "t", %t.var +// CHECK:STDOUT: %t.var: ref (i32, i32) = var t +// CHECK:STDOUT: %t: ref (i32, i32) = bind_name t, %t.var // CHECK:STDOUT: %.loc14_24: i32 = int_literal 1 // CHECK:STDOUT: %.loc14_27: i32 = int_literal 2 // CHECK:STDOUT: %.loc14_28.1: (i32, i32) = tuple_literal (%.loc14_24, %.loc14_27) @@ -75,17 +75,17 @@ fn F() { // CHECK:STDOUT: %.loc14_28.6: init (i32, i32) = tuple_init %.loc14_28.1, (%.loc14_28.3, %.loc14_28.5) // CHECK:STDOUT: assign %t.var, %.loc14_28.6 // CHECK:STDOUT: %.loc15_14: type = ptr_type i32 -// CHECK:STDOUT: %t0.var: ref i32* = var "t0" -// CHECK:STDOUT: %t0: ref i32* = bind_name "t0", %t0.var -// CHECK:STDOUT: %t.ref.loc15: ref (i32, i32) = name_reference "t", %t +// CHECK:STDOUT: %t0.var: ref i32* = var t0 +// CHECK:STDOUT: %t0: ref i32* = bind_name t0, %t0.var +// CHECK:STDOUT: %t.ref.loc15: ref (i32, i32) = name_reference t, %t // CHECK:STDOUT: %.loc15_21: i32 = int_literal 0 // CHECK:STDOUT: %.loc15_22: ref i32 = tuple_index %t.ref.loc15, %.loc15_21 // CHECK:STDOUT: %.loc15_18: i32* = address_of %.loc15_22 // CHECK:STDOUT: assign %t0.var, %.loc15_18 // CHECK:STDOUT: %.loc16_14: type = ptr_type i32 -// CHECK:STDOUT: %t1.var: ref i32* = var "t1" -// CHECK:STDOUT: %t1: ref i32* = bind_name "t1", %t1.var -// CHECK:STDOUT: %t.ref.loc16: ref (i32, i32) = name_reference "t", %t +// CHECK:STDOUT: %t1.var: ref i32* = var t1 +// CHECK:STDOUT: %t1: ref i32* = bind_name t1, %t1.var +// CHECK:STDOUT: %t.ref.loc16: ref (i32, i32) = name_reference t, %t // CHECK:STDOUT: %.loc16_21: i32 = int_literal 1 // CHECK:STDOUT: %.loc16_22: ref i32 = tuple_index %t.ref.loc16, %.loc16_21 // CHECK:STDOUT: %.loc16_18: i32* = address_of %.loc16_22 diff --git a/toolchain/check/testdata/pointer/basic.carbon b/toolchain/check/testdata/pointer/basic.carbon index df1315c1e1c3..54b51f2a9b17 100644 --- a/toolchain/check/testdata/pointer/basic.carbon +++ b/toolchain/check/testdata/pointer/basic.carbon @@ -17,17 +17,17 @@ fn F() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.var: ref i32 = var "n" -// CHECK:STDOUT: %n: ref i32 = bind_name "n", %n.var +// CHECK:STDOUT: %n.var: ref i32 = var n +// CHECK:STDOUT: %n: ref i32 = bind_name n, %n.var // CHECK:STDOUT: %.loc8: i32 = int_literal 0 // CHECK:STDOUT: assign %n.var, %.loc8 // CHECK:STDOUT: %.loc9_13: type = ptr_type i32 -// CHECK:STDOUT: %p.var: ref i32* = var "p" -// CHECK:STDOUT: %p: ref i32* = bind_name "p", %p.var -// CHECK:STDOUT: %n.ref: ref i32 = name_reference "n", %n +// CHECK:STDOUT: %p.var: ref i32* = var p +// CHECK:STDOUT: %p: ref i32* = bind_name p, %p.var +// CHECK:STDOUT: %n.ref: ref i32 = name_reference n, %n // CHECK:STDOUT: %.loc9_17: i32* = address_of %n.ref // CHECK:STDOUT: assign %p.var, %.loc9_17 -// CHECK:STDOUT: %p.ref: ref i32* = name_reference "p", %p +// CHECK:STDOUT: %p.ref: ref i32* = name_reference p, %p // CHECK:STDOUT: %.loc11_11: i32* = bind_value %p.ref // CHECK:STDOUT: %.loc11_10.1: ref i32 = dereference %.loc11_11 // CHECK:STDOUT: %.loc11_10.2: i32 = bind_value %.loc11_10.1 diff --git a/toolchain/check/testdata/pointer/fail_address_of_error.carbon b/toolchain/check/testdata/pointer/fail_address_of_error.carbon index 14e52545b838..75cceb010797 100644 --- a/toolchain/check/testdata/pointer/fail_address_of_error.carbon +++ b/toolchain/check/testdata/pointer/fail_address_of_error.carbon @@ -29,9 +29,9 @@ fn Test() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Test() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %undeclared.ref.loc11: = name_reference "undeclared", +// CHECK:STDOUT: %undeclared.ref.loc11: = name_reference undeclared, // CHECK:STDOUT: %.loc11: * = address_of %undeclared.ref.loc11 -// CHECK:STDOUT: %undeclared.ref.loc18: = name_reference "undeclared", +// CHECK:STDOUT: %undeclared.ref.loc18: = name_reference undeclared, // CHECK:STDOUT: %.loc18_5: * = address_of %undeclared.ref.loc18 // CHECK:STDOUT: %.loc18_3: ** = address_of %.loc18_5 // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/pointer/fail_address_of_value.carbon b/toolchain/check/testdata/pointer/fail_address_of_value.carbon index f42017897197..5dac20ce964b 100644 --- a/toolchain/check/testdata/pointer/fail_address_of_value.carbon +++ b/toolchain/check/testdata/pointer/fail_address_of_value.carbon @@ -134,7 +134,7 @@ fn AddressOfParameter(param: i32) { // CHECK:STDOUT: %.loc42_9: i32 = int_literal 1 // CHECK:STDOUT: %.loc42_7: i32 = add %.loc42_5, %.loc42_9 // CHECK:STDOUT: %.loc42_3: i32* = address_of %.loc42_7 -// CHECK:STDOUT: %H.ref: = name_reference "H", file.%H +// CHECK:STDOUT: %H.ref: = name_reference H, file.%H // CHECK:STDOUT: %.loc46_5.1: init {.a: i32} = call %H.ref() // CHECK:STDOUT: %.loc46_5.2: ref {.a: i32} = temporary_storage // CHECK:STDOUT: %.loc46_5.3: ref {.a: i32} = temporary %.loc46_5.2, %.loc46_5.1 @@ -148,7 +148,7 @@ fn AddressOfParameter(param: i32) { // CHECK:STDOUT: // CHECK:STDOUT: fn @AddressOfCall() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %G.ref: = name_reference "G", file.%G +// CHECK:STDOUT: %G.ref: = name_reference G, file.%G // CHECK:STDOUT: %.loc57_5: init i32 = call %G.ref() // CHECK:STDOUT: %.loc57_3: i32* = address_of %.loc57_5 // CHECK:STDOUT: return @@ -178,9 +178,9 @@ fn AddressOfParameter(param: i32) { // CHECK:STDOUT: fn @AddressOfParameter(%param: i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc82_22: type = ptr_type i32 -// CHECK:STDOUT: %param_addr.var: ref i32* = var "param_addr" -// CHECK:STDOUT: %param_addr: ref i32* = bind_name "param_addr", %param_addr.var -// CHECK:STDOUT: %param.ref: i32 = name_reference "param", %param +// CHECK:STDOUT: %param_addr.var: ref i32* = var param_addr +// CHECK:STDOUT: %param_addr: ref i32* = bind_name param_addr, %param_addr.var +// CHECK:STDOUT: %param.ref: i32 = name_reference param, %param // CHECK:STDOUT: %.loc82_26: i32* = address_of %param.ref // CHECK:STDOUT: assign %param_addr.var, %.loc82_26 // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/pointer/fail_dereference_error.carbon b/toolchain/check/testdata/pointer/fail_dereference_error.carbon index 8edc61a58572..5d95dce10a7c 100644 --- a/toolchain/check/testdata/pointer/fail_dereference_error.carbon +++ b/toolchain/check/testdata/pointer/fail_dereference_error.carbon @@ -10,7 +10,7 @@ let n: i32 = *undeclared; // CHECK:STDOUT: file "fail_dereference_error.carbon" { -// CHECK:STDOUT: %undeclared.ref: = name_reference "undeclared", +// CHECK:STDOUT: %undeclared.ref: = name_reference undeclared, // CHECK:STDOUT: %.loc10: ref = dereference -// CHECK:STDOUT: %n: i32 = bind_name "n", +// CHECK:STDOUT: %n: i32 = bind_name n, // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/pointer/fail_dereference_function.carbon b/toolchain/check/testdata/pointer/fail_dereference_function.carbon index ca04927cbc66..b1899e650a8a 100644 --- a/toolchain/check/testdata/pointer/fail_dereference_function.carbon +++ b/toolchain/check/testdata/pointer/fail_dereference_function.carbon @@ -17,7 +17,7 @@ fn A() { // CHECK:STDOUT: // CHECK:STDOUT: fn @A() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %A.ref: = name_reference "A", file.%A +// CHECK:STDOUT: %A.ref: = name_reference A, file.%A // CHECK:STDOUT: %.loc11: ref = dereference // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/pointer/fail_dereference_namespace.carbon b/toolchain/check/testdata/pointer/fail_dereference_namespace.carbon index c4940d519f97..2670c7d212fe 100644 --- a/toolchain/check/testdata/pointer/fail_dereference_namespace.carbon +++ b/toolchain/check/testdata/pointer/fail_dereference_namespace.carbon @@ -20,7 +20,7 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %A.ref: = name_reference "A", file.%.loc7 +// CHECK:STDOUT: %A.ref: = name_reference A, file.%.loc7 // CHECK:STDOUT: %.loc13: ref = dereference // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/pointer/fail_dereference_not_pointer.carbon b/toolchain/check/testdata/pointer/fail_dereference_not_pointer.carbon index d8339145ba8d..b1bdaed1b063 100644 --- a/toolchain/check/testdata/pointer/fail_dereference_not_pointer.carbon +++ b/toolchain/check/testdata/pointer/fail_dereference_not_pointer.carbon @@ -30,7 +30,7 @@ fn Deref(n: i32) { // CHECK:STDOUT: // CHECK:STDOUT: fn @Deref(%n: i32) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.ref: i32 = name_reference "n", %n +// CHECK:STDOUT: %n.ref: i32 = name_reference n, %n // CHECK:STDOUT: %.loc11: ref = dereference %n.ref // CHECK:STDOUT: %.loc15_5.1: () = tuple_literal () // CHECK:STDOUT: %.loc15_5.2: () = tuple_value %.loc15_5.1, () diff --git a/toolchain/check/testdata/pointer/fail_dereference_type.carbon b/toolchain/check/testdata/pointer/fail_dereference_type.carbon index 16164d0f269b..21ee5c5c6272 100644 --- a/toolchain/check/testdata/pointer/fail_dereference_type.carbon +++ b/toolchain/check/testdata/pointer/fail_dereference_type.carbon @@ -14,6 +14,6 @@ var p: *i32; // CHECK:STDOUT: file "fail_dereference_type.carbon" { // CHECK:STDOUT: %.loc13: ref = dereference i32 -// CHECK:STDOUT: %p.var: ref = var "p" -// CHECK:STDOUT: %p: ref = bind_name "p", %p.var +// CHECK:STDOUT: %p.var: ref = var p +// CHECK:STDOUT: %p: ref = bind_name p, %p.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/pointer/fail_type_mismatch.carbon b/toolchain/check/testdata/pointer/fail_type_mismatch.carbon index c95b4b79d985..1c6bce491ade 100644 --- a/toolchain/check/testdata/pointer/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/pointer/fail_type_mismatch.carbon @@ -21,6 +21,6 @@ fn ConstMismatch(p: const {}*) -> const ({}*) { // CHECK:STDOUT: // CHECK:STDOUT: fn @ConstMismatch(%p: const {}*) -> const ({}*) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: const {}* = name_reference "p", %p +// CHECK:STDOUT: %p.ref: const {}* = name_reference p, %p // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/pointer/nested_const.carbon b/toolchain/check/testdata/pointer/nested_const.carbon index 7514238ca204..2d570d587c12 100644 --- a/toolchain/check/testdata/pointer/nested_const.carbon +++ b/toolchain/check/testdata/pointer/nested_const.carbon @@ -15,7 +15,7 @@ fn F(p: const (const (const i32*)*)) -> const i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%p: const (const (const i32*)*)) -> const i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: const (const (const i32*)*) = name_reference "p", %p +// CHECK:STDOUT: %p.ref: const (const (const i32*)*) = name_reference p, %p // CHECK:STDOUT: %.loc9_11.1: ref const (const i32*) = dereference %p.ref // CHECK:STDOUT: %.loc9_11.2: const (const i32*) = bind_value %.loc9_11.1 // CHECK:STDOUT: %.loc9_10.1: ref const i32 = dereference %.loc9_11.2 diff --git a/toolchain/check/testdata/pointer/types.carbon b/toolchain/check/testdata/pointer/types.carbon index 149b486aba44..1d99185f89e0 100644 --- a/toolchain/check/testdata/pointer/types.carbon +++ b/toolchain/check/testdata/pointer/types.carbon @@ -19,12 +19,12 @@ fn ConstPtr(p: const i32*) -> (const i32)* { // CHECK:STDOUT: // CHECK:STDOUT: fn @Ptr(%p: i32*) -> i32* { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: i32* = name_reference "p", %p +// CHECK:STDOUT: %p.ref: i32* = name_reference p, %p // CHECK:STDOUT: return %p.ref // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @ConstPtr(%p: const i32*) -> const i32* { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: const i32* = name_reference "p", %p +// CHECK:STDOUT: %p.ref: const i32* = name_reference p, %p // CHECK:STDOUT: return %p.ref // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/return/fail_let_in_type.carbon b/toolchain/check/testdata/return/fail_let_in_type.carbon index dd05abf77c7b..e8e55b12cf52 100644 --- a/toolchain/check/testdata/return/fail_let_in_type.carbon +++ b/toolchain/check/testdata/return/fail_let_in_type.carbon @@ -12,7 +12,7 @@ let x: type = i32; fn Six() -> x { return 6; } // CHECK:STDOUT: file "fail_let_in_type.carbon" { -// CHECK:STDOUT: %x: type = bind_name "x", i32 +// CHECK:STDOUT: %x: type = bind_name x, i32 // CHECK:STDOUT: %Six: = fn_decl @Six // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/fail_var_in_type.carbon b/toolchain/check/testdata/return/fail_var_in_type.carbon index 64395cc29805..8d14969fd430 100644 --- a/toolchain/check/testdata/return/fail_var_in_type.carbon +++ b/toolchain/check/testdata/return/fail_var_in_type.carbon @@ -11,8 +11,8 @@ var x: type = i32; fn Six() -> x { return 6; } // CHECK:STDOUT: file "fail_var_in_type.carbon" { -// CHECK:STDOUT: %x.var: ref type = var "x" -// CHECK:STDOUT: %x: ref type = bind_name "x", %x.var +// CHECK:STDOUT: %x.var: ref type = var x +// CHECK:STDOUT: %x: ref type = bind_name x, %x.var // CHECK:STDOUT: assign %x.var, i32 // CHECK:STDOUT: %Six: = fn_decl @Six // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/empty.carbon b/toolchain/check/testdata/struct/empty.carbon index df26b8cf620c..b153d479d770 100644 --- a/toolchain/check/testdata/struct/empty.carbon +++ b/toolchain/check/testdata/struct/empty.carbon @@ -14,15 +14,15 @@ var y: {} = x; // CHECK:STDOUT: // CHECK:STDOUT: file "empty.carbon" { // CHECK:STDOUT: %.loc7_9: {} = struct_literal () -// CHECK:STDOUT: %x.var: ref {} = var "x" -// CHECK:STDOUT: %x: ref {} = bind_name "x", %x.var +// CHECK:STDOUT: %x.var: ref {} = var x +// CHECK:STDOUT: %x: ref {} = bind_name x, %x.var // CHECK:STDOUT: %.loc7_14.1: {} = struct_literal () // CHECK:STDOUT: %.loc7_14.2: init {} = struct_init %.loc7_14.1, () // CHECK:STDOUT: assign %x.var, %.loc7_14.2 // CHECK:STDOUT: %.loc8_9: {} = struct_literal () -// CHECK:STDOUT: %y.var: ref {} = var "y" -// CHECK:STDOUT: %y: ref {} = bind_name "y", %y.var -// CHECK:STDOUT: %x.ref: ref {} = name_reference "x", %x +// CHECK:STDOUT: %y.var: ref {} = var y +// CHECK:STDOUT: %y: ref {} = bind_name y, %y.var +// CHECK:STDOUT: %x.ref: ref {} = name_reference x, %x // CHECK:STDOUT: %.loc8_13: init {} = struct_init %x.ref, () // CHECK:STDOUT: assign %y.var, %.loc8_13 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/fail_access_into_invalid.carbon b/toolchain/check/testdata/struct/fail_access_into_invalid.carbon index 37460a93c12d..75f8c50fc7df 100644 --- a/toolchain/check/testdata/struct/fail_access_into_invalid.carbon +++ b/toolchain/check/testdata/struct/fail_access_into_invalid.carbon @@ -16,6 +16,6 @@ fn F() { a.b; } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a.ref: = name_reference "a", +// CHECK:STDOUT: %a.ref: = name_reference a, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/fail_assign_empty.carbon b/toolchain/check/testdata/struct/fail_assign_empty.carbon index b1cf7c01e9ed..374976008cad 100644 --- a/toolchain/check/testdata/struct/fail_assign_empty.carbon +++ b/toolchain/check/testdata/struct/fail_assign_empty.carbon @@ -15,8 +15,8 @@ var x: {.a: i32} = {}; // CHECK:STDOUT: // CHECK:STDOUT: file "fail_assign_empty.carbon" { // CHECK:STDOUT: %.loc10_16: type = struct_type {.a: i32} -// CHECK:STDOUT: %x.var: ref {.a: i32} = var "x" -// CHECK:STDOUT: %x: ref {.a: i32} = bind_name "x", %x.var +// CHECK:STDOUT: %x.var: ref {.a: i32} = var x +// CHECK:STDOUT: %x: ref {.a: i32} = bind_name x, %x.var // CHECK:STDOUT: %.loc10_21: {} = struct_literal () // CHECK:STDOUT: assign %x.var, // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/fail_assign_nested.carbon b/toolchain/check/testdata/struct/fail_assign_nested.carbon index c360032449cc..6cf979a29c10 100644 --- a/toolchain/check/testdata/struct/fail_assign_nested.carbon +++ b/toolchain/check/testdata/struct/fail_assign_nested.carbon @@ -19,8 +19,8 @@ var x: {.a: {}} = {.b = {}}; // CHECK:STDOUT: file "fail_assign_nested.carbon" { // CHECK:STDOUT: %.loc10_14: {} = struct_literal () // CHECK:STDOUT: %.loc10_15: type = struct_type {.a: {}} -// CHECK:STDOUT: %x.var: ref {.a: {}} = var "x" -// CHECK:STDOUT: %x: ref {.a: {}} = bind_name "x", %x.var +// CHECK:STDOUT: %x.var: ref {.a: {}} = var x +// CHECK:STDOUT: %x: ref {.a: {}} = bind_name x, %x.var // CHECK:STDOUT: %.loc10_26: {} = struct_literal () // CHECK:STDOUT: %.loc10_27: {.b: {}} = struct_literal (%.loc10_26) // CHECK:STDOUT: assign %x.var, diff --git a/toolchain/check/testdata/struct/fail_assign_to_empty.carbon b/toolchain/check/testdata/struct/fail_assign_to_empty.carbon index e4d6ed6bd674..46b678b21038 100644 --- a/toolchain/check/testdata/struct/fail_assign_to_empty.carbon +++ b/toolchain/check/testdata/struct/fail_assign_to_empty.carbon @@ -17,8 +17,8 @@ var x: {} = {.a = 1}; // CHECK:STDOUT: // CHECK:STDOUT: file "fail_assign_to_empty.carbon" { // CHECK:STDOUT: %.loc10_9: {} = struct_literal () -// CHECK:STDOUT: %x.var: ref {} = var "x" -// CHECK:STDOUT: %x: ref {} = bind_name "x", %x.var +// CHECK:STDOUT: %x.var: ref {} = var x +// CHECK:STDOUT: %x: ref {} = bind_name x, %x.var // CHECK:STDOUT: %.loc10_19: i32 = int_literal 1 // CHECK:STDOUT: %.loc10_20: {.a: i32} = struct_literal (%.loc10_19) // CHECK:STDOUT: assign %x.var, diff --git a/toolchain/check/testdata/struct/fail_field_name_mismatch.carbon b/toolchain/check/testdata/struct/fail_field_name_mismatch.carbon index feb768f5e879..f4447f9ebc96 100644 --- a/toolchain/check/testdata/struct/fail_field_name_mismatch.carbon +++ b/toolchain/check/testdata/struct/fail_field_name_mismatch.carbon @@ -20,14 +20,14 @@ var y: {.b: i32} = x; // CHECK:STDOUT: // CHECK:STDOUT: file "fail_field_name_mismatch.carbon" { // CHECK:STDOUT: %.loc10_16: type = struct_type {.a: i32} -// CHECK:STDOUT: %x.var: ref {.a: i32} = var "x" -// CHECK:STDOUT: %x: ref {.a: i32} = bind_name "x", %x.var +// CHECK:STDOUT: %x.var: ref {.a: i32} = var x +// CHECK:STDOUT: %x: ref {.a: i32} = bind_name x, %x.var // CHECK:STDOUT: %.loc10_26: i32 = int_literal 1 // CHECK:STDOUT: %.loc10_27: {.b: i32} = struct_literal (%.loc10_26) // CHECK:STDOUT: assign %x.var, // CHECK:STDOUT: %.loc15: type = struct_type {.b: i32} -// CHECK:STDOUT: %y.var: ref {.b: i32} = var "y" -// CHECK:STDOUT: %y: ref {.b: i32} = bind_name "y", %y.var -// CHECK:STDOUT: %x.ref: ref {.a: i32} = name_reference "x", %x +// CHECK:STDOUT: %y.var: ref {.b: i32} = var y +// CHECK:STDOUT: %y: ref {.b: i32} = bind_name y, %y.var +// CHECK:STDOUT: %x.ref: ref {.a: i32} = name_reference x, %x // CHECK:STDOUT: assign %y.var, // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/fail_field_type_mismatch.carbon b/toolchain/check/testdata/struct/fail_field_type_mismatch.carbon index c06072db719b..100081621ce6 100644 --- a/toolchain/check/testdata/struct/fail_field_type_mismatch.carbon +++ b/toolchain/check/testdata/struct/fail_field_type_mismatch.carbon @@ -15,8 +15,8 @@ var x: {.a: i32} = {.b = 1.0}; // CHECK:STDOUT: // CHECK:STDOUT: file "fail_field_type_mismatch.carbon" { // CHECK:STDOUT: %.loc10_16: type = struct_type {.a: i32} -// CHECK:STDOUT: %x.var: ref {.a: i32} = var "x" -// CHECK:STDOUT: %x: ref {.a: i32} = bind_name "x", %x.var +// CHECK:STDOUT: %x.var: ref {.a: i32} = var x +// CHECK:STDOUT: %x: ref {.a: i32} = bind_name x, %x.var // CHECK:STDOUT: %.loc10_26: f64 = real_literal 10e-1 // CHECK:STDOUT: %.loc10_29: {.b: f64} = struct_literal (%.loc10_26) // CHECK:STDOUT: assign %x.var, diff --git a/toolchain/check/testdata/struct/fail_member_access_type.carbon b/toolchain/check/testdata/struct/fail_member_access_type.carbon index ec0738c3e3b0..5b849eb2bfef 100644 --- a/toolchain/check/testdata/struct/fail_member_access_type.carbon +++ b/toolchain/check/testdata/struct/fail_member_access_type.carbon @@ -12,14 +12,14 @@ var y: i32 = x.b; // CHECK:STDOUT: file "fail_member_access_type.carbon" { // CHECK:STDOUT: %.loc7_16: type = struct_type {.a: f64} -// CHECK:STDOUT: %x.var: ref {.a: f64} = var "x" -// CHECK:STDOUT: %x: ref {.a: f64} = bind_name "x", %x.var +// CHECK:STDOUT: %x.var: ref {.a: f64} = var x +// CHECK:STDOUT: %x: ref {.a: f64} = bind_name x, %x.var // CHECK:STDOUT: %.loc7_26: f64 = real_literal 40e-1 // CHECK:STDOUT: %.loc7_29.1: {.a: f64} = struct_literal (%.loc7_26) // CHECK:STDOUT: %.loc7_29.2: init {.a: f64} = struct_init %.loc7_29.1, (%.loc7_26) // CHECK:STDOUT: assign %x.var, %.loc7_29.2 -// CHECK:STDOUT: %y.var: ref i32 = var "y" -// CHECK:STDOUT: %y: ref i32 = bind_name "y", %y.var -// CHECK:STDOUT: %x.ref: ref {.a: f64} = name_reference "x", %x +// CHECK:STDOUT: %y.var: ref i32 = var y +// CHECK:STDOUT: %y: ref i32 = bind_name y, %y.var +// CHECK:STDOUT: %x.ref: ref {.a: f64} = name_reference x, %x // CHECK:STDOUT: assign %y.var, // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/fail_member_of_function.carbon b/toolchain/check/testdata/struct/fail_member_of_function.carbon index 26e46192dcb0..bff39c457311 100644 --- a/toolchain/check/testdata/struct/fail_member_of_function.carbon +++ b/toolchain/check/testdata/struct/fail_member_of_function.carbon @@ -17,6 +17,6 @@ fn A() { // CHECK:STDOUT: // CHECK:STDOUT: fn @A() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %A.ref: = name_reference "A", file.%A +// CHECK:STDOUT: %A.ref: = name_reference A, file.%A // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/fail_nested_incomplete.carbon b/toolchain/check/testdata/struct/fail_nested_incomplete.carbon index d2ef5a423310..50ff99f22c4c 100644 --- a/toolchain/check/testdata/struct/fail_nested_incomplete.carbon +++ b/toolchain/check/testdata/struct/fail_nested_incomplete.carbon @@ -26,15 +26,15 @@ var p: Incomplete* = &s.a; // CHECK:STDOUT: file "fail_nested_incomplete.carbon" { // CHECK:STDOUT: class_declaration @Incomplete, () // CHECK:STDOUT: %Incomplete: type = class_type @Incomplete -// CHECK:STDOUT: %Incomplete.ref.loc15: type = name_reference "Incomplete", %Incomplete +// CHECK:STDOUT: %Incomplete.ref.loc15: type = name_reference Incomplete, %Incomplete // CHECK:STDOUT: %.loc15: type = struct_type {.a: Incomplete} -// CHECK:STDOUT: %s.var: ref = var "s" -// CHECK:STDOUT: %s: ref = bind_name "s", %s.var -// CHECK:STDOUT: %Incomplete.ref.loc20: type = name_reference "Incomplete", %Incomplete +// CHECK:STDOUT: %s.var: ref = var s +// CHECK:STDOUT: %s: ref = bind_name s, %s.var +// CHECK:STDOUT: %Incomplete.ref.loc20: type = name_reference Incomplete, %Incomplete // CHECK:STDOUT: %.loc20_18: type = ptr_type Incomplete -// CHECK:STDOUT: %p.var: ref Incomplete* = var "p" -// CHECK:STDOUT: %p: ref Incomplete* = bind_name "p", %p.var -// CHECK:STDOUT: %s.ref: ref = name_reference "s", %s +// CHECK:STDOUT: %p.var: ref Incomplete* = var p +// CHECK:STDOUT: %p: ref Incomplete* = bind_name p, %p.var +// CHECK:STDOUT: %s.ref: ref = name_reference s, %s // CHECK:STDOUT: %.loc20_22: * = address_of // CHECK:STDOUT: assign %p.var, // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/fail_non_member_access.carbon b/toolchain/check/testdata/struct/fail_non_member_access.carbon index 715ea50bb21b..d61f49eae4ab 100644 --- a/toolchain/check/testdata/struct/fail_non_member_access.carbon +++ b/toolchain/check/testdata/struct/fail_non_member_access.carbon @@ -12,14 +12,14 @@ var y: i32 = x.b; // CHECK:STDOUT: file "fail_non_member_access.carbon" { // CHECK:STDOUT: %.loc7_16: type = struct_type {.a: i32} -// CHECK:STDOUT: %x.var: ref {.a: i32} = var "x" -// CHECK:STDOUT: %x: ref {.a: i32} = bind_name "x", %x.var +// CHECK:STDOUT: %x.var: ref {.a: i32} = var x +// CHECK:STDOUT: %x: ref {.a: i32} = bind_name x, %x.var // CHECK:STDOUT: %.loc7_26: i32 = int_literal 4 // CHECK:STDOUT: %.loc7_27.1: {.a: i32} = struct_literal (%.loc7_26) // CHECK:STDOUT: %.loc7_27.2: init {.a: i32} = struct_init %.loc7_27.1, (%.loc7_26) // CHECK:STDOUT: assign %x.var, %.loc7_27.2 -// CHECK:STDOUT: %y.var: ref i32 = var "y" -// CHECK:STDOUT: %y: ref i32 = bind_name "y", %y.var -// CHECK:STDOUT: %x.ref: ref {.a: i32} = name_reference "x", %x +// CHECK:STDOUT: %y.var: ref i32 = var y +// CHECK:STDOUT: %y: ref i32 = bind_name y, %y.var +// CHECK:STDOUT: %x.ref: ref {.a: i32} = name_reference x, %x // CHECK:STDOUT: assign %y.var, // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/fail_too_few_values.carbon b/toolchain/check/testdata/struct/fail_too_few_values.carbon index 712b7cf4a7b0..a545b19789a7 100644 --- a/toolchain/check/testdata/struct/fail_too_few_values.carbon +++ b/toolchain/check/testdata/struct/fail_too_few_values.carbon @@ -16,8 +16,8 @@ var x: {.a: i32, .b: i32} = {.a = 1}; // CHECK:STDOUT: // CHECK:STDOUT: file "fail_too_few_values.carbon" { // CHECK:STDOUT: %.loc10_25: type = struct_type {.a: i32, .b: i32} -// CHECK:STDOUT: %x.var: ref {.a: i32, .b: i32} = var "x" -// CHECK:STDOUT: %x: ref {.a: i32, .b: i32} = bind_name "x", %x.var +// CHECK:STDOUT: %x.var: ref {.a: i32, .b: i32} = var x +// CHECK:STDOUT: %x: ref {.a: i32, .b: i32} = bind_name x, %x.var // CHECK:STDOUT: %.loc10_35: i32 = int_literal 1 // CHECK:STDOUT: %.loc10_36: {.a: i32} = struct_literal (%.loc10_35) // CHECK:STDOUT: assign %x.var, diff --git a/toolchain/check/testdata/struct/fail_type_assign.carbon b/toolchain/check/testdata/struct/fail_type_assign.carbon index 880b8d361a85..dd822a5d93d5 100644 --- a/toolchain/check/testdata/struct/fail_type_assign.carbon +++ b/toolchain/check/testdata/struct/fail_type_assign.carbon @@ -11,8 +11,8 @@ var x: {.a: i32} = {.a: i32}; // CHECK:STDOUT: file "fail_type_assign.carbon" { // CHECK:STDOUT: %.loc10_16: type = struct_type {.a: i32} -// CHECK:STDOUT: %x.var: ref {.a: i32} = var "x" -// CHECK:STDOUT: %x: ref {.a: i32} = bind_name "x", %x.var +// CHECK:STDOUT: %x.var: ref {.a: i32} = var x +// CHECK:STDOUT: %x: ref {.a: i32} = bind_name x, %x.var // CHECK:STDOUT: %.loc10_28: type = struct_type {.a: i32} // CHECK:STDOUT: assign %x.var, // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/fail_value_as_type.carbon b/toolchain/check/testdata/struct/fail_value_as_type.carbon index a527c93b81df..e49925d835da 100644 --- a/toolchain/check/testdata/struct/fail_value_as_type.carbon +++ b/toolchain/check/testdata/struct/fail_value_as_type.carbon @@ -16,6 +16,6 @@ var x: {.a = 1}; // CHECK:STDOUT: file "fail_value_as_type.carbon" { // CHECK:STDOUT: %.loc10_14: i32 = int_literal 1 // CHECK:STDOUT: %.loc10_15: {.a: i32} = struct_literal (%.loc10_14) -// CHECK:STDOUT: %x.var: ref = var "x" -// CHECK:STDOUT: %x: ref = bind_name "x", %x.var +// CHECK:STDOUT: %x.var: ref = var x +// CHECK:STDOUT: %x: ref = bind_name x, %x.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/literal_member_access.carbon b/toolchain/check/testdata/struct/literal_member_access.carbon index e7267e48aac0..b846e127dff4 100644 --- a/toolchain/check/testdata/struct/literal_member_access.carbon +++ b/toolchain/check/testdata/struct/literal_member_access.carbon @@ -27,7 +27,7 @@ fn F() -> i32 { // CHECK:STDOUT: fn @F() -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc10_16: i32 = int_literal 1 -// CHECK:STDOUT: %G.ref: = name_reference "G", file.%G +// CHECK:STDOUT: %G.ref: = name_reference G, file.%G // CHECK:STDOUT: %.loc10_25.1: ref {.x: i32, .y: i32, .z: i32} = temporary_storage // CHECK:STDOUT: %.loc10_25.2: init {.x: i32, .y: i32, .z: i32} = call %G.ref() to %.loc10_25.1 // CHECK:STDOUT: %.loc10_34: i32 = int_literal 3 diff --git a/toolchain/check/testdata/struct/member_access.carbon b/toolchain/check/testdata/struct/member_access.carbon index 32d523d9b521..faa1221c82dc 100644 --- a/toolchain/check/testdata/struct/member_access.carbon +++ b/toolchain/check/testdata/struct/member_access.carbon @@ -14,8 +14,8 @@ var z: i32 = y; // CHECK:STDOUT: // CHECK:STDOUT: file "member_access.carbon" { // CHECK:STDOUT: %.loc7_25: type = struct_type {.a: f64, .b: i32} -// CHECK:STDOUT: %x.var: ref {.a: f64, .b: i32} = var "x" -// CHECK:STDOUT: %x: ref {.a: f64, .b: i32} = bind_name "x", %x.var +// CHECK:STDOUT: %x.var: ref {.a: f64, .b: i32} = var x +// CHECK:STDOUT: %x: ref {.a: f64, .b: i32} = bind_name x, %x.var // CHECK:STDOUT: %.loc7_35: f64 = real_literal 0e-1 // CHECK:STDOUT: %.loc7_45: i32 = int_literal 1 // CHECK:STDOUT: %.loc7_46.1: {.a: f64, .b: i32} = struct_literal (%.loc7_35, %.loc7_45) @@ -25,15 +25,15 @@ var z: i32 = y; // CHECK:STDOUT: %.loc7_46.5: init i32 = initialize_from %.loc7_45 to %.loc7_46.4 // CHECK:STDOUT: %.loc7_46.6: init {.a: f64, .b: i32} = struct_init %.loc7_46.1, (%.loc7_46.3, %.loc7_46.5) // CHECK:STDOUT: assign %x.var, %.loc7_46.6 -// CHECK:STDOUT: %y.var: ref i32 = var "y" -// CHECK:STDOUT: %y: ref i32 = bind_name "y", %y.var -// CHECK:STDOUT: %x.ref: ref {.a: f64, .b: i32} = name_reference "x", %x +// CHECK:STDOUT: %y.var: ref i32 = var y +// CHECK:STDOUT: %y: ref i32 = bind_name y, %y.var +// CHECK:STDOUT: %x.ref: ref {.a: f64, .b: i32} = name_reference x, %x // CHECK:STDOUT: %.loc8_15.1: ref i32 = struct_access %x.ref, member1 // CHECK:STDOUT: %.loc8_15.2: i32 = bind_value %.loc8_15.1 // CHECK:STDOUT: assign %y.var, %.loc8_15.2 -// CHECK:STDOUT: %z.var: ref i32 = var "z" -// CHECK:STDOUT: %z: ref i32 = bind_name "z", %z.var -// CHECK:STDOUT: %y.ref: ref i32 = name_reference "y", %y +// CHECK:STDOUT: %z.var: ref i32 = var z +// CHECK:STDOUT: %z: ref i32 = bind_name z, %z.var +// CHECK:STDOUT: %y.ref: ref i32 = name_reference y, %y // CHECK:STDOUT: %.loc9: i32 = bind_value %y.ref // CHECK:STDOUT: assign %z.var, %.loc9 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/nested_struct_in_place.carbon b/toolchain/check/testdata/struct/nested_struct_in_place.carbon index 504f076028d4..5f4992cd3629 100644 --- a/toolchain/check/testdata/struct/nested_struct_in_place.carbon +++ b/toolchain/check/testdata/struct/nested_struct_in_place.carbon @@ -30,12 +30,12 @@ fn G() { // CHECK:STDOUT: %.loc10_29: (type, type, type) = tuple_literal (i32, i32, i32) // CHECK:STDOUT: %.loc10_50: (type, type, type) = tuple_literal (i32, i32, i32) // CHECK:STDOUT: %.loc10_51: type = struct_type {.a: (i32, i32, i32), .b: (i32, i32, i32)} -// CHECK:STDOUT: %v.var: ref {.a: (i32, i32, i32), .b: (i32, i32, i32)} = var "v" -// CHECK:STDOUT: %v: ref {.a: (i32, i32, i32), .b: (i32, i32, i32)} = bind_name "v", %v.var -// CHECK:STDOUT: %F.ref.loc10_61: = name_reference "F", file.%F +// CHECK:STDOUT: %v.var: ref {.a: (i32, i32, i32), .b: (i32, i32, i32)} = var v +// CHECK:STDOUT: %v: ref {.a: (i32, i32, i32), .b: (i32, i32, i32)} = bind_name v, %v.var +// CHECK:STDOUT: %F.ref.loc10_61: = name_reference F, file.%F // CHECK:STDOUT: %.loc10_74.1: ref (i32, i32, i32) = struct_access %v.var, member0 // CHECK:STDOUT: %.loc10_62: init (i32, i32, i32) = call %F.ref.loc10_61() to %.loc10_74.1 -// CHECK:STDOUT: %F.ref.loc10_71: = name_reference "F", file.%F +// CHECK:STDOUT: %F.ref.loc10_71: = name_reference F, file.%F // CHECK:STDOUT: %.loc10_74.2: ref (i32, i32, i32) = struct_access %v.var, member1 // CHECK:STDOUT: %.loc10_72: init (i32, i32, i32) = call %F.ref.loc10_71() to %.loc10_74.2 // CHECK:STDOUT: %.loc10_74.3: {.a: (i32, i32, i32), .b: (i32, i32, i32)} = struct_literal (%.loc10_62, %.loc10_72) diff --git a/toolchain/check/testdata/struct/one_entry.carbon b/toolchain/check/testdata/struct/one_entry.carbon index 16d88d97d3d3..7d3c5e0455b8 100644 --- a/toolchain/check/testdata/struct/one_entry.carbon +++ b/toolchain/check/testdata/struct/one_entry.carbon @@ -9,16 +9,16 @@ var y: {.a: i32} = x; // CHECK:STDOUT: file "one_entry.carbon" { // CHECK:STDOUT: %.loc7_16: type = struct_type {.a: i32} -// CHECK:STDOUT: %x.var: ref {.a: i32} = var "x" -// CHECK:STDOUT: %x: ref {.a: i32} = bind_name "x", %x.var +// CHECK:STDOUT: %x.var: ref {.a: i32} = var x +// CHECK:STDOUT: %x: ref {.a: i32} = bind_name x, %x.var // CHECK:STDOUT: %.loc7_26: i32 = int_literal 4 // CHECK:STDOUT: %.loc7_27.1: {.a: i32} = struct_literal (%.loc7_26) // CHECK:STDOUT: %.loc7_27.2: init {.a: i32} = struct_init %.loc7_27.1, (%.loc7_26) // CHECK:STDOUT: assign %x.var, %.loc7_27.2 // CHECK:STDOUT: %.loc8_16: type = struct_type {.a: i32} -// CHECK:STDOUT: %y.var: ref {.a: i32} = var "y" -// CHECK:STDOUT: %y: ref {.a: i32} = bind_name "y", %y.var -// CHECK:STDOUT: %x.ref: ref {.a: i32} = name_reference "x", %x +// CHECK:STDOUT: %y.var: ref {.a: i32} = var y +// CHECK:STDOUT: %y: ref {.a: i32} = bind_name y, %y.var +// CHECK:STDOUT: %x.ref: ref {.a: i32} = name_reference x, %x // CHECK:STDOUT: %.loc8_20.1: ref i32 = struct_access %x.ref, member0 // CHECK:STDOUT: %.loc8_20.2: i32 = bind_value %.loc8_20.1 // CHECK:STDOUT: %.loc8_20.3: init {.a: i32} = struct_init %x.ref, (%.loc8_20.2) diff --git a/toolchain/check/testdata/struct/reorder_fields.carbon b/toolchain/check/testdata/struct/reorder_fields.carbon index 9132ab2d67a7..0519e39bab12 100644 --- a/toolchain/check/testdata/struct/reorder_fields.carbon +++ b/toolchain/check/testdata/struct/reorder_fields.carbon @@ -32,22 +32,22 @@ fn F() -> {.a: i32, .b: f64} { // CHECK:STDOUT: fn @F() -> %return: {.a: i32, .b: f64} { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc11_27: type = struct_type {.a: i32, .b: f64} -// CHECK:STDOUT: %MakeF64.ref: = name_reference "MakeF64", file.%MakeF64 +// CHECK:STDOUT: %MakeF64.ref: = name_reference MakeF64, file.%MakeF64 // CHECK:STDOUT: %.loc11_44: init f64 = call %MakeF64.ref() -// CHECK:STDOUT: %MakeI32.ref: = name_reference "MakeI32", file.%MakeI32 +// CHECK:STDOUT: %MakeI32.ref: = name_reference MakeI32, file.%MakeI32 // CHECK:STDOUT: %.loc11_60: init i32 = call %MakeI32.ref() // CHECK:STDOUT: %.loc11_62.1: {.b: f64, .a: i32} = struct_literal (%.loc11_44, %.loc11_60) // CHECK:STDOUT: %.loc11_62.2: i32 = value_of_initializer %.loc11_60 // CHECK:STDOUT: %.loc11_62.3: f64 = value_of_initializer %.loc11_44 // CHECK:STDOUT: %.loc11_62.4: {.a: i32, .b: f64} = struct_value %.loc11_62.1, (%.loc11_62.2, %.loc11_62.3) -// CHECK:STDOUT: %x: {.a: i32, .b: f64} = bind_name "x", %.loc11_62.4 +// CHECK:STDOUT: %x: {.a: i32, .b: f64} = bind_name x, %.loc11_62.4 // CHECK:STDOUT: %.loc12_27: type = struct_type {.b: f64, .a: i32} -// CHECK:STDOUT: %x.ref: {.a: i32, .b: f64} = name_reference "x", %x +// CHECK:STDOUT: %x.ref: {.a: i32, .b: f64} = name_reference x, %x // CHECK:STDOUT: %.loc12_31.1: f64 = struct_access %x.ref, member1 // CHECK:STDOUT: %.loc12_31.2: i32 = struct_access %x.ref, member0 // CHECK:STDOUT: %.loc12_31.3: {.b: f64, .a: i32} = struct_value %x.ref, (%.loc12_31.1, %.loc12_31.2) -// CHECK:STDOUT: %y: {.b: f64, .a: i32} = bind_name "y", %.loc12_31.3 -// CHECK:STDOUT: %y.ref: {.b: f64, .a: i32} = name_reference "y", %y +// CHECK:STDOUT: %y: {.b: f64, .a: i32} = bind_name y, %.loc12_31.3 +// CHECK:STDOUT: %y.ref: {.b: f64, .a: i32} = name_reference y, %y // CHECK:STDOUT: %.loc13_10.1: i32 = struct_access %y.ref, member1 // CHECK:STDOUT: %.loc13_10.2: ref i32 = struct_access %return, member1 // CHECK:STDOUT: %.loc13_10.3: init i32 = initialize_from %.loc13_10.1 to %.loc13_10.2 diff --git a/toolchain/check/testdata/struct/tuple_as_element.carbon b/toolchain/check/testdata/struct/tuple_as_element.carbon index 5263430675b8..f210d55f8102 100644 --- a/toolchain/check/testdata/struct/tuple_as_element.carbon +++ b/toolchain/check/testdata/struct/tuple_as_element.carbon @@ -16,8 +16,8 @@ var y: {.a: i32, .b: (i32,)} = x; // CHECK:STDOUT: file "tuple_as_element.carbon" { // CHECK:STDOUT: %.loc7_27: (type,) = tuple_literal (i32) // CHECK:STDOUT: %.loc7_28: type = struct_type {.a: i32, .b: (i32,)} -// CHECK:STDOUT: %x.var: ref {.a: i32, .b: (i32,)} = var "x" -// CHECK:STDOUT: %x: ref {.a: i32, .b: (i32,)} = bind_name "x", %x.var +// CHECK:STDOUT: %x.var: ref {.a: i32, .b: (i32,)} = var x +// CHECK:STDOUT: %x: ref {.a: i32, .b: (i32,)} = bind_name x, %x.var // CHECK:STDOUT: %.loc7_38: i32 = int_literal 1 // CHECK:STDOUT: %.loc7_47: i32 = int_literal 2 // CHECK:STDOUT: %.loc7_49.1: (i32,) = tuple_literal (%.loc7_47) @@ -31,9 +31,9 @@ var y: {.a: i32, .b: (i32,)} = x; // CHECK:STDOUT: assign %x.var, %.loc7_50.6 // CHECK:STDOUT: %.loc8_27: (type,) = tuple_literal (i32) // CHECK:STDOUT: %.loc8_28: type = struct_type {.a: i32, .b: (i32,)} -// CHECK:STDOUT: %y.var: ref {.a: i32, .b: (i32,)} = var "y" -// CHECK:STDOUT: %y: ref {.a: i32, .b: (i32,)} = bind_name "y", %y.var -// CHECK:STDOUT: %x.ref: ref {.a: i32, .b: (i32,)} = name_reference "x", %x +// CHECK:STDOUT: %y.var: ref {.a: i32, .b: (i32,)} = var y +// CHECK:STDOUT: %y: ref {.a: i32, .b: (i32,)} = bind_name y, %y.var +// CHECK:STDOUT: %x.ref: ref {.a: i32, .b: (i32,)} = name_reference x, %x // CHECK:STDOUT: %.loc8_32.1: ref i32 = struct_access %x.ref, member0 // CHECK:STDOUT: %.loc8_32.2: i32 = bind_value %.loc8_32.1 // CHECK:STDOUT: %.loc8_32.3: ref i32 = struct_access %y.var, member0 diff --git a/toolchain/check/testdata/struct/two_entries.carbon b/toolchain/check/testdata/struct/two_entries.carbon index 5742a9f86ed8..e4f482ae946b 100644 --- a/toolchain/check/testdata/struct/two_entries.carbon +++ b/toolchain/check/testdata/struct/two_entries.carbon @@ -13,8 +13,8 @@ var y: {.a: i32, .b: i32} = x; // CHECK:STDOUT: // CHECK:STDOUT: file "two_entries.carbon" { // CHECK:STDOUT: %.loc7_25: type = struct_type {.a: i32, .b: i32} -// CHECK:STDOUT: %x.var: ref {.a: i32, .b: i32} = var "x" -// CHECK:STDOUT: %x: ref {.a: i32, .b: i32} = bind_name "x", %x.var +// CHECK:STDOUT: %x.var: ref {.a: i32, .b: i32} = var x +// CHECK:STDOUT: %x: ref {.a: i32, .b: i32} = bind_name x, %x.var // CHECK:STDOUT: %.loc7_35: i32 = int_literal 1 // CHECK:STDOUT: %.loc7_43: i32 = int_literal 2 // CHECK:STDOUT: %.loc7_44.1: {.a: i32, .b: i32} = struct_literal (%.loc7_35, %.loc7_43) @@ -25,9 +25,9 @@ var y: {.a: i32, .b: i32} = x; // CHECK:STDOUT: %.loc7_44.6: init {.a: i32, .b: i32} = struct_init %.loc7_44.1, (%.loc7_44.3, %.loc7_44.5) // CHECK:STDOUT: assign %x.var, %.loc7_44.6 // CHECK:STDOUT: %.loc8_25: type = struct_type {.a: i32, .b: i32} -// CHECK:STDOUT: %y.var: ref {.a: i32, .b: i32} = var "y" -// CHECK:STDOUT: %y: ref {.a: i32, .b: i32} = bind_name "y", %y.var -// CHECK:STDOUT: %x.ref: ref {.a: i32, .b: i32} = name_reference "x", %x +// CHECK:STDOUT: %y.var: ref {.a: i32, .b: i32} = var y +// CHECK:STDOUT: %y: ref {.a: i32, .b: i32} = bind_name y, %y.var +// CHECK:STDOUT: %x.ref: ref {.a: i32, .b: i32} = name_reference x, %x // CHECK:STDOUT: %.loc8_29.1: ref i32 = struct_access %x.ref, member0 // CHECK:STDOUT: %.loc8_29.2: i32 = bind_value %.loc8_29.1 // CHECK:STDOUT: %.loc8_29.3: ref i32 = struct_access %y.var, member0 diff --git a/toolchain/check/testdata/tuples/empty.carbon b/toolchain/check/testdata/tuples/empty.carbon index 385fdb92cdfb..5cc3666cf40e 100644 --- a/toolchain/check/testdata/tuples/empty.carbon +++ b/toolchain/check/testdata/tuples/empty.carbon @@ -13,15 +13,15 @@ var y: () = x; // CHECK:STDOUT: // CHECK:STDOUT: file "empty.carbon" { // CHECK:STDOUT: %.loc7_9: () = tuple_literal () -// CHECK:STDOUT: %x.var: ref () = var "x" -// CHECK:STDOUT: %x: ref () = bind_name "x", %x.var +// CHECK:STDOUT: %x.var: ref () = var x +// CHECK:STDOUT: %x: ref () = bind_name x, %x.var // CHECK:STDOUT: %.loc7_14.1: () = tuple_literal () // CHECK:STDOUT: %.loc7_14.2: init () = tuple_init %.loc7_14.1, () // CHECK:STDOUT: assign %x.var, %.loc7_14.2 // CHECK:STDOUT: %.loc8_9: () = tuple_literal () -// CHECK:STDOUT: %y.var: ref () = var "y" -// CHECK:STDOUT: %y: ref () = bind_name "y", %y.var -// CHECK:STDOUT: %x.ref: ref () = name_reference "x", %x +// CHECK:STDOUT: %y.var: ref () = var y +// CHECK:STDOUT: %y: ref () = bind_name y, %y.var +// CHECK:STDOUT: %x.ref: ref () = name_reference x, %x // CHECK:STDOUT: %.loc8_13: init () = tuple_init %x.ref, () // CHECK:STDOUT: assign %y.var, %.loc8_13 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuples/fail_assign_empty.carbon b/toolchain/check/testdata/tuples/fail_assign_empty.carbon index f6313efb3866..07160068a6fc 100644 --- a/toolchain/check/testdata/tuples/fail_assign_empty.carbon +++ b/toolchain/check/testdata/tuples/fail_assign_empty.carbon @@ -17,8 +17,8 @@ var x: (i32,) = (); // CHECK:STDOUT: // CHECK:STDOUT: file "fail_assign_empty.carbon" { // CHECK:STDOUT: %.loc10_13: (type,) = tuple_literal (i32) -// CHECK:STDOUT: %x.var: ref (i32,) = var "x" -// CHECK:STDOUT: %x: ref (i32,) = bind_name "x", %x.var +// CHECK:STDOUT: %x.var: ref (i32,) = var x +// CHECK:STDOUT: %x: ref (i32,) = bind_name x, %x.var // CHECK:STDOUT: %.loc10_18: () = tuple_literal () // CHECK:STDOUT: assign %x.var, // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuples/fail_assign_nested.carbon b/toolchain/check/testdata/tuples/fail_assign_nested.carbon index 8dea88f42c7a..d85702db9213 100644 --- a/toolchain/check/testdata/tuples/fail_assign_nested.carbon +++ b/toolchain/check/testdata/tuples/fail_assign_nested.carbon @@ -25,8 +25,8 @@ var x: ((i32, i32), (i32, i32)) = ((1, 2, 3), (4, 5, 6)); // CHECK:STDOUT: %.loc10_18: (type, type) = tuple_literal (i32, i32) // CHECK:STDOUT: %.loc10_30: (type, type) = tuple_literal (i32, i32) // CHECK:STDOUT: %.loc10_31: ((type, type), (type, type)) = tuple_literal (%.loc10_18, %.loc10_30) -// CHECK:STDOUT: %x.var: ref ((i32, i32), (i32, i32)) = var "x" -// CHECK:STDOUT: %x: ref ((i32, i32), (i32, i32)) = bind_name "x", %x.var +// CHECK:STDOUT: %x.var: ref ((i32, i32), (i32, i32)) = var x +// CHECK:STDOUT: %x: ref ((i32, i32), (i32, i32)) = bind_name x, %x.var // CHECK:STDOUT: %.loc10_37: i32 = int_literal 1 // CHECK:STDOUT: %.loc10_40: i32 = int_literal 2 // CHECK:STDOUT: %.loc10_43: i32 = int_literal 3 diff --git a/toolchain/check/testdata/tuples/fail_assign_to_empty.carbon b/toolchain/check/testdata/tuples/fail_assign_to_empty.carbon index 5d882021d3f5..44ef1a467130 100644 --- a/toolchain/check/testdata/tuples/fail_assign_to_empty.carbon +++ b/toolchain/check/testdata/tuples/fail_assign_to_empty.carbon @@ -15,8 +15,8 @@ var x: () = (66); // CHECK:STDOUT: // CHECK:STDOUT: file "fail_assign_to_empty.carbon" { // CHECK:STDOUT: %.loc10_9: () = tuple_literal () -// CHECK:STDOUT: %x.var: ref () = var "x" -// CHECK:STDOUT: %x: ref () = bind_name "x", %x.var +// CHECK:STDOUT: %x.var: ref () = var x +// CHECK:STDOUT: %x: ref () = bind_name x, %x.var // CHECK:STDOUT: %.loc10_14: i32 = int_literal 66 // CHECK:STDOUT: assign %x.var, // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuples/fail_element_type_mismatch.carbon b/toolchain/check/testdata/tuples/fail_element_type_mismatch.carbon index 5c783aee140b..a99a1681765a 100644 --- a/toolchain/check/testdata/tuples/fail_element_type_mismatch.carbon +++ b/toolchain/check/testdata/tuples/fail_element_type_mismatch.carbon @@ -18,8 +18,8 @@ var x: (i32, i32) = (2, 65.89); // CHECK:STDOUT: // CHECK:STDOUT: file "fail_element_type_mismatch.carbon" { // CHECK:STDOUT: %.loc10_17: (type, type) = tuple_literal (i32, i32) -// CHECK:STDOUT: %x.var: ref (i32, i32) = var "x" -// CHECK:STDOUT: %x: ref (i32, i32) = bind_name "x", %x.var +// CHECK:STDOUT: %x.var: ref (i32, i32) = var x +// CHECK:STDOUT: %x: ref (i32, i32) = bind_name x, %x.var // CHECK:STDOUT: %.loc10_22: i32 = int_literal 2 // CHECK:STDOUT: %.loc10_25: f64 = real_literal 6589e-2 // CHECK:STDOUT: %.loc10_30.1: (i32, f64) = tuple_literal (%.loc10_22, %.loc10_25) diff --git a/toolchain/check/testdata/tuples/fail_nested_incomplete.carbon b/toolchain/check/testdata/tuples/fail_nested_incomplete.carbon index ee55f1f279ac..261625680676 100644 --- a/toolchain/check/testdata/tuples/fail_nested_incomplete.carbon +++ b/toolchain/check/testdata/tuples/fail_nested_incomplete.carbon @@ -28,15 +28,15 @@ var p: Incomplete* = &t[1]; // CHECK:STDOUT: file "fail_nested_incomplete.carbon" { // CHECK:STDOUT: class_declaration @Incomplete, () // CHECK:STDOUT: %Incomplete: type = class_type @Incomplete -// CHECK:STDOUT: %Incomplete.ref.loc15: type = name_reference "Incomplete", %Incomplete +// CHECK:STDOUT: %Incomplete.ref.loc15: type = name_reference Incomplete, %Incomplete // CHECK:STDOUT: %.loc15: (type, type) = tuple_literal (i32, %Incomplete.ref.loc15) -// CHECK:STDOUT: %t.var: ref = var "t" -// CHECK:STDOUT: %t: ref = bind_name "t", %t.var -// CHECK:STDOUT: %Incomplete.ref.loc20: type = name_reference "Incomplete", %Incomplete +// CHECK:STDOUT: %t.var: ref = var t +// CHECK:STDOUT: %t: ref = bind_name t, %t.var +// CHECK:STDOUT: %Incomplete.ref.loc20: type = name_reference Incomplete, %Incomplete // CHECK:STDOUT: %.loc20_18: type = ptr_type Incomplete -// CHECK:STDOUT: %p.var: ref Incomplete* = var "p" -// CHECK:STDOUT: %p: ref Incomplete* = bind_name "p", %p.var -// CHECK:STDOUT: %t.ref: ref = name_reference "t", %t +// CHECK:STDOUT: %p.var: ref Incomplete* = var p +// CHECK:STDOUT: %p: ref Incomplete* = bind_name p, %p.var +// CHECK:STDOUT: %t.ref: ref = name_reference t, %t // CHECK:STDOUT: %.loc20_25: i32 = int_literal 1 // CHECK:STDOUT: %.loc20_22: * = address_of // CHECK:STDOUT: assign %p.var, diff --git a/toolchain/check/testdata/tuples/fail_too_few_element.carbon b/toolchain/check/testdata/tuples/fail_too_few_element.carbon index 51023099039e..9f0175e013f8 100644 --- a/toolchain/check/testdata/tuples/fail_too_few_element.carbon +++ b/toolchain/check/testdata/tuples/fail_too_few_element.carbon @@ -18,8 +18,8 @@ var x: (i32, i32) = (2, ); // CHECK:STDOUT: // CHECK:STDOUT: file "fail_too_few_element.carbon" { // CHECK:STDOUT: %.loc10_17: (type, type) = tuple_literal (i32, i32) -// CHECK:STDOUT: %x.var: ref (i32, i32) = var "x" -// CHECK:STDOUT: %x: ref (i32, i32) = bind_name "x", %x.var +// CHECK:STDOUT: %x.var: ref (i32, i32) = var x +// CHECK:STDOUT: %x: ref (i32, i32) = bind_name x, %x.var // CHECK:STDOUT: %.loc10_22: i32 = int_literal 2 // CHECK:STDOUT: %.loc10_25: (i32,) = tuple_literal (%.loc10_22) // CHECK:STDOUT: assign %x.var, diff --git a/toolchain/check/testdata/tuples/fail_type_assign.carbon b/toolchain/check/testdata/tuples/fail_type_assign.carbon index 2f579373e997..9e3f206a7f8b 100644 --- a/toolchain/check/testdata/tuples/fail_type_assign.carbon +++ b/toolchain/check/testdata/tuples/fail_type_assign.carbon @@ -16,8 +16,8 @@ var x: (i32, ) = (i32, ); // CHECK:STDOUT: // CHECK:STDOUT: file "fail_type_assign.carbon" { // CHECK:STDOUT: %.loc10_14: (type,) = tuple_literal (i32) -// CHECK:STDOUT: %x.var: ref (i32,) = var "x" -// CHECK:STDOUT: %x: ref (i32,) = bind_name "x", %x.var +// CHECK:STDOUT: %x.var: ref (i32,) = var x +// CHECK:STDOUT: %x: ref (i32,) = bind_name x, %x.var // CHECK:STDOUT: %.loc10_24: (type,) = tuple_literal (i32) // CHECK:STDOUT: assign %x.var, // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuples/fail_value_as_type.carbon b/toolchain/check/testdata/tuples/fail_value_as_type.carbon index f5e7d564da51..b4d1805c32a7 100644 --- a/toolchain/check/testdata/tuples/fail_value_as_type.carbon +++ b/toolchain/check/testdata/tuples/fail_value_as_type.carbon @@ -17,6 +17,6 @@ var x: (1, ); // CHECK:STDOUT: file "fail_value_as_type.carbon" { // CHECK:STDOUT: %.loc10_9: i32 = int_literal 1 // CHECK:STDOUT: %.loc10_12: (i32,) = tuple_literal (%.loc10_9) -// CHECK:STDOUT: %x.var: ref (,) = var "x" -// CHECK:STDOUT: %x: ref (,) = bind_name "x", %x.var +// CHECK:STDOUT: %x.var: ref (,) = var x +// CHECK:STDOUT: %x: ref (,) = bind_name x, %x.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuples/nested_tuple.carbon b/toolchain/check/testdata/tuples/nested_tuple.carbon index a42e10e65976..5732adc2dfd9 100644 --- a/toolchain/check/testdata/tuples/nested_tuple.carbon +++ b/toolchain/check/testdata/tuples/nested_tuple.carbon @@ -19,8 +19,8 @@ var x: ((i32, i32), i32) = ((12, 76), 6); // CHECK:STDOUT: file "nested_tuple.carbon" { // CHECK:STDOUT: %.loc7_18: (type, type) = tuple_literal (i32, i32) // CHECK:STDOUT: %.loc7_24: ((type, type), type) = tuple_literal (%.loc7_18, i32) -// CHECK:STDOUT: %x.var: ref ((i32, i32), i32) = var "x" -// CHECK:STDOUT: %x: ref ((i32, i32), i32) = bind_name "x", %x.var +// CHECK:STDOUT: %x.var: ref ((i32, i32), i32) = var x +// CHECK:STDOUT: %x: ref ((i32, i32), i32) = bind_name x, %x.var // CHECK:STDOUT: %.loc7_30: i32 = int_literal 12 // CHECK:STDOUT: %.loc7_34: i32 = int_literal 76 // CHECK:STDOUT: %.loc7_36.1: (i32, i32) = tuple_literal (%.loc7_30, %.loc7_34) diff --git a/toolchain/check/testdata/tuples/nested_tuple_in_place.carbon b/toolchain/check/testdata/tuples/nested_tuple_in_place.carbon index 6cb257553ef5..9e315d4179ce 100644 --- a/toolchain/check/testdata/tuples/nested_tuple_in_place.carbon +++ b/toolchain/check/testdata/tuples/nested_tuple_in_place.carbon @@ -41,12 +41,12 @@ fn H() { // CHECK:STDOUT: %.loc10_25: (type, type, type) = tuple_literal (i32, i32, i32) // CHECK:STDOUT: %.loc10_42: (type, type, type) = tuple_literal (i32, i32, i32) // CHECK:STDOUT: %.loc10_43: ((type, type, type), (type, type, type)) = tuple_literal (%.loc10_25, %.loc10_42) -// CHECK:STDOUT: %v.var: ref ((i32, i32, i32), (i32, i32, i32)) = var "v" -// CHECK:STDOUT: %v: ref ((i32, i32, i32), (i32, i32, i32)) = bind_name "v", %v.var -// CHECK:STDOUT: %F.ref.loc10_48: = name_reference "F", file.%F +// CHECK:STDOUT: %v.var: ref ((i32, i32, i32), (i32, i32, i32)) = var v +// CHECK:STDOUT: %v: ref ((i32, i32, i32), (i32, i32, i32)) = bind_name v, %v.var +// CHECK:STDOUT: %F.ref.loc10_48: = name_reference F, file.%F // CHECK:STDOUT: %.loc10_56.1: ref (i32, i32, i32) = tuple_access %v.var, member0 // CHECK:STDOUT: %.loc10_49: init (i32, i32, i32) = call %F.ref.loc10_48() to %.loc10_56.1 -// CHECK:STDOUT: %F.ref.loc10_53: = name_reference "F", file.%F +// CHECK:STDOUT: %F.ref.loc10_53: = name_reference F, file.%F // CHECK:STDOUT: %.loc10_56.2: ref (i32, i32, i32) = tuple_access %v.var, member1 // CHECK:STDOUT: %.loc10_54: init (i32, i32, i32) = call %F.ref.loc10_53() to %.loc10_56.2 // CHECK:STDOUT: %.loc10_56.3: ((i32, i32, i32), (i32, i32, i32)) = tuple_literal (%.loc10_49, %.loc10_54) @@ -59,10 +59,10 @@ fn H() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc14_30: (type, type, type) = tuple_literal (i32, i32, i32) // CHECK:STDOUT: %.loc14_36: (type, (type, type, type), type) = tuple_literal (i32, %.loc14_30, i32) -// CHECK:STDOUT: %v.var: ref (i32, (i32, i32, i32), i32) = var "v" -// CHECK:STDOUT: %v: ref (i32, (i32, i32, i32), i32) = bind_name "v", %v.var +// CHECK:STDOUT: %v.var: ref (i32, (i32, i32, i32), i32) = var v +// CHECK:STDOUT: %v: ref (i32, (i32, i32, i32), i32) = bind_name v, %v.var // CHECK:STDOUT: %.loc14_41: i32 = int_literal 1 -// CHECK:STDOUT: %F.ref: = name_reference "F", file.%F +// CHECK:STDOUT: %F.ref: = name_reference F, file.%F // CHECK:STDOUT: %.loc14_50.1: ref (i32, i32, i32) = tuple_access %v.var, member1 // CHECK:STDOUT: %.loc14_45: init (i32, i32, i32) = call %F.ref() to %.loc14_50.1 // CHECK:STDOUT: %.loc14_49: i32 = int_literal 2 diff --git a/toolchain/check/testdata/tuples/one_element.carbon b/toolchain/check/testdata/tuples/one_element.carbon index 73c77237ef50..151876404a83 100644 --- a/toolchain/check/testdata/tuples/one_element.carbon +++ b/toolchain/check/testdata/tuples/one_element.carbon @@ -14,16 +14,16 @@ var y: (i32,) = x; // CHECK:STDOUT: // CHECK:STDOUT: file "one_element.carbon" { // CHECK:STDOUT: %.loc7_13: (type,) = tuple_literal (i32) -// CHECK:STDOUT: %x.var: ref (i32,) = var "x" -// CHECK:STDOUT: %x: ref (i32,) = bind_name "x", %x.var +// CHECK:STDOUT: %x.var: ref (i32,) = var x +// CHECK:STDOUT: %x: ref (i32,) = bind_name x, %x.var // CHECK:STDOUT: %.loc7_18: i32 = int_literal 4 // CHECK:STDOUT: %.loc7_20.1: (i32,) = tuple_literal (%.loc7_18) // CHECK:STDOUT: %.loc7_20.2: init (i32,) = tuple_init %.loc7_20.1, (%.loc7_18) // CHECK:STDOUT: assign %x.var, %.loc7_20.2 // CHECK:STDOUT: %.loc8_13: (type,) = tuple_literal (i32) -// CHECK:STDOUT: %y.var: ref (i32,) = var "y" -// CHECK:STDOUT: %y: ref (i32,) = bind_name "y", %y.var -// CHECK:STDOUT: %x.ref: ref (i32,) = name_reference "x", %x +// CHECK:STDOUT: %y.var: ref (i32,) = var y +// CHECK:STDOUT: %y: ref (i32,) = bind_name y, %y.var +// CHECK:STDOUT: %x.ref: ref (i32,) = name_reference x, %x // CHECK:STDOUT: %.loc8_17.1: ref i32 = tuple_access %x.ref, member0 // CHECK:STDOUT: %.loc8_17.2: i32 = bind_value %.loc8_17.1 // CHECK:STDOUT: %.loc8_17.3: init (i32,) = tuple_init %x.ref, (%.loc8_17.2) diff --git a/toolchain/check/testdata/tuples/two_elements.carbon b/toolchain/check/testdata/tuples/two_elements.carbon index 858e7a03a9ba..ac746e54d959 100644 --- a/toolchain/check/testdata/tuples/two_elements.carbon +++ b/toolchain/check/testdata/tuples/two_elements.carbon @@ -15,8 +15,8 @@ var y: (i32, i32) = x; // CHECK:STDOUT: // CHECK:STDOUT: file "two_elements.carbon" { // CHECK:STDOUT: %.loc7_17: (type, type) = tuple_literal (i32, i32) -// CHECK:STDOUT: %x.var: ref (i32, i32) = var "x" -// CHECK:STDOUT: %x: ref (i32, i32) = bind_name "x", %x.var +// CHECK:STDOUT: %x.var: ref (i32, i32) = var x +// CHECK:STDOUT: %x: ref (i32, i32) = bind_name x, %x.var // CHECK:STDOUT: %.loc7_22: i32 = int_literal 4 // CHECK:STDOUT: %.loc7_25: i32 = int_literal 102 // CHECK:STDOUT: %.loc7_28.1: (i32, i32) = tuple_literal (%.loc7_22, %.loc7_25) @@ -27,9 +27,9 @@ var y: (i32, i32) = x; // CHECK:STDOUT: %.loc7_28.6: init (i32, i32) = tuple_init %.loc7_28.1, (%.loc7_28.3, %.loc7_28.5) // CHECK:STDOUT: assign %x.var, %.loc7_28.6 // CHECK:STDOUT: %.loc8_17: (type, type) = tuple_literal (i32, i32) -// CHECK:STDOUT: %y.var: ref (i32, i32) = var "y" -// CHECK:STDOUT: %y: ref (i32, i32) = bind_name "y", %y.var -// CHECK:STDOUT: %x.ref: ref (i32, i32) = name_reference "x", %x +// CHECK:STDOUT: %y.var: ref (i32, i32) = var y +// CHECK:STDOUT: %y: ref (i32, i32) = bind_name y, %y.var +// CHECK:STDOUT: %x.ref: ref (i32, i32) = name_reference x, %x // CHECK:STDOUT: %.loc8_21.1: ref i32 = tuple_access %x.ref, member0 // CHECK:STDOUT: %.loc8_21.2: i32 = bind_value %.loc8_21.1 // CHECK:STDOUT: %.loc8_21.3: ref i32 = tuple_access %y.var, member0 diff --git a/toolchain/check/testdata/var/decl.carbon b/toolchain/check/testdata/var/decl.carbon index 235826d36397..834dddadab2c 100644 --- a/toolchain/check/testdata/var/decl.carbon +++ b/toolchain/check/testdata/var/decl.carbon @@ -14,7 +14,7 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %x.var: ref i32 = var "x" -// CHECK:STDOUT: %x: ref i32 = bind_name "x", %x.var +// CHECK:STDOUT: %x.var: ref i32 = var x +// CHECK:STDOUT: %x: ref i32 = bind_name x, %x.var // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/var/decl_with_init.carbon b/toolchain/check/testdata/var/decl_with_init.carbon index e8ca5c96f35e..782acf58fd05 100644 --- a/toolchain/check/testdata/var/decl_with_init.carbon +++ b/toolchain/check/testdata/var/decl_with_init.carbon @@ -14,8 +14,8 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %x.var: ref i32 = var "x" -// CHECK:STDOUT: %x: ref i32 = bind_name "x", %x.var +// CHECK:STDOUT: %x.var: ref i32 = var x +// CHECK:STDOUT: %x: ref i32 = bind_name x, %x.var // CHECK:STDOUT: %.loc8: i32 = int_literal 0 // CHECK:STDOUT: assign %x.var, %.loc8 // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/var/fail_duplicate_decl.carbon b/toolchain/check/testdata/var/fail_duplicate_decl.carbon index 1e82080a43ec..6b7d4f56d071 100644 --- a/toolchain/check/testdata/var/fail_duplicate_decl.carbon +++ b/toolchain/check/testdata/var/fail_duplicate_decl.carbon @@ -22,12 +22,12 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %x.var.loc9: ref i32 = var "x" -// CHECK:STDOUT: %x.loc9: ref i32 = bind_name "x", %x.var.loc9 +// CHECK:STDOUT: %x.var.loc9: ref i32 = var x +// CHECK:STDOUT: %x.loc9: ref i32 = bind_name x, %x.var.loc9 // CHECK:STDOUT: %.loc9: i32 = int_literal 0 // CHECK:STDOUT: assign %x.var.loc9, %.loc9 -// CHECK:STDOUT: %x.var.loc16: ref i32 = var "x" -// CHECK:STDOUT: %x.loc16: ref i32 = bind_name "x", %x.var.loc16 +// CHECK:STDOUT: %x.var.loc16: ref i32 = var x +// CHECK:STDOUT: %x.loc16: ref i32 = bind_name x, %x.var.loc16 // CHECK:STDOUT: %.loc16: i32 = int_literal 0 // CHECK:STDOUT: assign %x.var.loc16, %.loc16 // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/var/fail_init_type_mismatch.carbon b/toolchain/check/testdata/var/fail_init_type_mismatch.carbon index 4c09e84296ce..4c0d7766232a 100644 --- a/toolchain/check/testdata/var/fail_init_type_mismatch.carbon +++ b/toolchain/check/testdata/var/fail_init_type_mismatch.carbon @@ -17,8 +17,8 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %x.var: ref i32 = var "x" -// CHECK:STDOUT: %x: ref i32 = bind_name "x", %x.var +// CHECK:STDOUT: %x.var: ref i32 = var x +// CHECK:STDOUT: %x: ref i32 = bind_name x, %x.var // CHECK:STDOUT: %.loc11: f64 = real_literal 10e-1 // CHECK:STDOUT: assign %x.var, // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/var/fail_init_with_self.carbon b/toolchain/check/testdata/var/fail_init_with_self.carbon index f511f0315614..5a22ad481756 100644 --- a/toolchain/check/testdata/var/fail_init_with_self.carbon +++ b/toolchain/check/testdata/var/fail_init_with_self.carbon @@ -17,9 +17,9 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %x.var: ref i32 = var "x" -// CHECK:STDOUT: %x: ref i32 = bind_name "x", %x.var -// CHECK:STDOUT: %x.ref: = name_reference "x", +// CHECK:STDOUT: %x.var: ref i32 = var x +// CHECK:STDOUT: %x: ref i32 = bind_name x, %x.var +// CHECK:STDOUT: %x.ref: = name_reference x, // CHECK:STDOUT: assign %x.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/var/fail_lookup_outside_scope.carbon b/toolchain/check/testdata/var/fail_lookup_outside_scope.carbon index afa7f379fae8..c8cf2c0e1c99 100644 --- a/toolchain/check/testdata/var/fail_lookup_outside_scope.carbon +++ b/toolchain/check/testdata/var/fail_lookup_outside_scope.carbon @@ -15,15 +15,15 @@ var y: i32 = x; // CHECK:STDOUT: file "fail_lookup_outside_scope.carbon" { // CHECK:STDOUT: %Main: = fn_decl @Main -// CHECK:STDOUT: %y.var: ref i32 = var "y" -// CHECK:STDOUT: %y: ref i32 = bind_name "y", %y.var -// CHECK:STDOUT: %x.ref: = name_reference "x", +// CHECK:STDOUT: %y.var: ref i32 = var y +// CHECK:STDOUT: %y: ref i32 = bind_name y, %y.var +// CHECK:STDOUT: %x.ref: = name_reference x, // CHECK:STDOUT: assign %y.var, // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %x.var: ref i32 = var "x" -// CHECK:STDOUT: %x: ref i32 = bind_name "x", %x.var +// CHECK:STDOUT: %x.var: ref i32 = var x +// CHECK:STDOUT: %x: ref i32 = bind_name x, %x.var // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/var/fail_not_copyable.carbon b/toolchain/check/testdata/var/fail_not_copyable.carbon index 8bfaa95451b9..0b5233afffa5 100644 --- a/toolchain/check/testdata/var/fail_not_copyable.carbon +++ b/toolchain/check/testdata/var/fail_not_copyable.carbon @@ -42,14 +42,14 @@ fn F(x: X) { // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%x: X) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %s.var: ref String = var "s" -// CHECK:STDOUT: %s: ref String = bind_name "s", %s.var +// CHECK:STDOUT: %s.var: ref String = var s +// CHECK:STDOUT: %s: ref String = bind_name s, %s.var // CHECK:STDOUT: %.loc16: String = string_literal "hello" // CHECK:STDOUT: assign %s.var, -// CHECK:STDOUT: %X.ref: type = name_reference "X", file.%X -// CHECK:STDOUT: %y.var: ref X = var "y" -// CHECK:STDOUT: %y: ref X = bind_name "y", %y.var -// CHECK:STDOUT: %x.ref: X = name_reference "x", %x +// CHECK:STDOUT: %X.ref: type = name_reference X, file.%X +// CHECK:STDOUT: %y.var: ref X = var y +// CHECK:STDOUT: %y: ref X = bind_name y, %y.var +// CHECK:STDOUT: %x.ref: X = name_reference x, %x // CHECK:STDOUT: assign %y.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/var/fail_storage_is_literal.carbon b/toolchain/check/testdata/var/fail_storage_is_literal.carbon index 7291b49ea305..b931b8501aa7 100644 --- a/toolchain/check/testdata/var/fail_storage_is_literal.carbon +++ b/toolchain/check/testdata/var/fail_storage_is_literal.carbon @@ -18,8 +18,8 @@ fn Main() { // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc11_10: i32 = int_literal 1 -// CHECK:STDOUT: %x.var: ref = var "x" -// CHECK:STDOUT: %x: ref = bind_name "x", %x.var +// CHECK:STDOUT: %x.var: ref = var x +// CHECK:STDOUT: %x: ref = bind_name x, %x.var // CHECK:STDOUT: %.loc11_14: i32 = int_literal 1 // CHECK:STDOUT: assign %x.var, // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/var/global_decl.carbon b/toolchain/check/testdata/var/global_decl.carbon index aa481ec563fc..b98832938a46 100644 --- a/toolchain/check/testdata/var/global_decl.carbon +++ b/toolchain/check/testdata/var/global_decl.carbon @@ -7,6 +7,6 @@ var x: i32; // CHECK:STDOUT: file "global_decl.carbon" { -// CHECK:STDOUT: %x.var: ref i32 = var "x" -// CHECK:STDOUT: %x: ref i32 = bind_name "x", %x.var +// CHECK:STDOUT: %x.var: ref i32 = var x +// CHECK:STDOUT: %x: ref i32 = bind_name x, %x.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/var/global_decl_with_init.carbon b/toolchain/check/testdata/var/global_decl_with_init.carbon index 99e55c922aca..91c4b6dd7492 100644 --- a/toolchain/check/testdata/var/global_decl_with_init.carbon +++ b/toolchain/check/testdata/var/global_decl_with_init.carbon @@ -7,8 +7,8 @@ var x: i32 = 0; // CHECK:STDOUT: file "global_decl_with_init.carbon" { -// CHECK:STDOUT: %x.var: ref i32 = var "x" -// CHECK:STDOUT: %x: ref i32 = bind_name "x", %x.var +// CHECK:STDOUT: %x.var: ref i32 = var x +// CHECK:STDOUT: %x: ref i32 = bind_name x, %x.var // CHECK:STDOUT: %.loc7: i32 = int_literal 0 // CHECK:STDOUT: assign %x.var, %.loc7 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/var/global_lookup.carbon b/toolchain/check/testdata/var/global_lookup.carbon index 7ec8907a6127..d04fcf94d8bf 100644 --- a/toolchain/check/testdata/var/global_lookup.carbon +++ b/toolchain/check/testdata/var/global_lookup.carbon @@ -8,13 +8,13 @@ var x: i32 = 0; var y: i32 = x; // CHECK:STDOUT: file "global_lookup.carbon" { -// CHECK:STDOUT: %x.var: ref i32 = var "x" -// CHECK:STDOUT: %x: ref i32 = bind_name "x", %x.var +// CHECK:STDOUT: %x.var: ref i32 = var x +// CHECK:STDOUT: %x: ref i32 = bind_name x, %x.var // CHECK:STDOUT: %.loc7: i32 = int_literal 0 // CHECK:STDOUT: assign %x.var, %.loc7 -// CHECK:STDOUT: %y.var: ref i32 = var "y" -// CHECK:STDOUT: %y: ref i32 = bind_name "y", %y.var -// CHECK:STDOUT: %x.ref: ref i32 = name_reference "x", %x +// CHECK:STDOUT: %y.var: ref i32 = var y +// CHECK:STDOUT: %y: ref i32 = bind_name y, %y.var +// CHECK:STDOUT: %x.ref: ref i32 = name_reference x, %x // CHECK:STDOUT: %.loc8: i32 = bind_value %x.ref // CHECK:STDOUT: assign %y.var, %.loc8 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/var/global_lookup_in_scope.carbon b/toolchain/check/testdata/var/global_lookup_in_scope.carbon index dd8272085d8d..6cd8282e8a58 100644 --- a/toolchain/check/testdata/var/global_lookup_in_scope.carbon +++ b/toolchain/check/testdata/var/global_lookup_in_scope.carbon @@ -11,8 +11,8 @@ fn Main() { } // CHECK:STDOUT: file "global_lookup_in_scope.carbon" { -// CHECK:STDOUT: %x.var: ref i32 = var "x" -// CHECK:STDOUT: %x: ref i32 = bind_name "x", %x.var +// CHECK:STDOUT: %x.var: ref i32 = var x +// CHECK:STDOUT: %x: ref i32 = bind_name x, %x.var // CHECK:STDOUT: %.loc7: i32 = int_literal 0 // CHECK:STDOUT: assign %x.var, %.loc7 // CHECK:STDOUT: %Main: = fn_decl @Main @@ -20,9 +20,9 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %y.var: ref i32 = var "y" -// CHECK:STDOUT: %y: ref i32 = bind_name "y", %y.var -// CHECK:STDOUT: %x.ref: ref i32 = name_reference "x", file.%x +// CHECK:STDOUT: %y.var: ref i32 = var y +// CHECK:STDOUT: %y: ref i32 = bind_name y, %y.var +// CHECK:STDOUT: %x.ref: ref i32 = name_reference x, file.%x // CHECK:STDOUT: %.loc10: i32 = bind_value %x.ref // CHECK:STDOUT: assign %y.var, %.loc10 // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/var/lookup.carbon b/toolchain/check/testdata/var/lookup.carbon index e4f1af04baa6..df8e3dc76023 100644 --- a/toolchain/check/testdata/var/lookup.carbon +++ b/toolchain/check/testdata/var/lookup.carbon @@ -15,10 +15,10 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %x.var: ref i32 = var "x" -// CHECK:STDOUT: %x: ref i32 = bind_name "x", %x.var +// CHECK:STDOUT: %x.var: ref i32 = var x +// CHECK:STDOUT: %x: ref i32 = bind_name x, %x.var // CHECK:STDOUT: %.loc8: i32 = int_literal 0 // CHECK:STDOUT: assign %x.var, %.loc8 -// CHECK:STDOUT: %x.ref: ref i32 = name_reference "x", %x +// CHECK:STDOUT: %x.ref: ref i32 = name_reference x, %x // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/var/shadowing.carbon b/toolchain/check/testdata/var/shadowing.carbon index 95cafdb24254..52bbbf704a93 100644 --- a/toolchain/check/testdata/var/shadowing.carbon +++ b/toolchain/check/testdata/var/shadowing.carbon @@ -20,19 +20,19 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %x.var.loc8: ref i32 = var "x" -// CHECK:STDOUT: %x.loc8: ref i32 = bind_name "x", %x.var.loc8 +// CHECK:STDOUT: %x.var.loc8: ref i32 = var x +// CHECK:STDOUT: %x.loc8: ref i32 = bind_name x, %x.var.loc8 // CHECK:STDOUT: %.loc8: i32 = int_literal 0 // CHECK:STDOUT: assign %x.var.loc8, %.loc8 // CHECK:STDOUT: %.loc9: bool = bool_literal true // CHECK:STDOUT: if %.loc9 br !if.then else br !if.else // CHECK:STDOUT: // CHECK:STDOUT: !if.then: -// CHECK:STDOUT: %x.var.loc10: ref i32 = var "x" -// CHECK:STDOUT: %x.loc10: ref i32 = bind_name "x", %x.var.loc10 +// CHECK:STDOUT: %x.var.loc10: ref i32 = var x +// CHECK:STDOUT: %x.loc10: ref i32 = bind_name x, %x.var.loc10 // CHECK:STDOUT: %.loc10: i32 = int_literal 0 // CHECK:STDOUT: assign %x.var.loc10, %.loc10 -// CHECK:STDOUT: %x.ref: ref i32 = name_reference "x", %x.loc10 +// CHECK:STDOUT: %x.ref: ref i32 = name_reference x, %x.loc10 // CHECK:STDOUT: %.loc13: i32 = int_literal 1 // CHECK:STDOUT: assign %x.ref, %.loc13 // CHECK:STDOUT: br !if.else diff --git a/toolchain/check/testdata/while/break_continue.carbon b/toolchain/check/testdata/while/break_continue.carbon index c84f8a31e344..816bb015ed8f 100644 --- a/toolchain/check/testdata/while/break_continue.carbon +++ b/toolchain/check/testdata/while/break_continue.carbon @@ -59,13 +59,13 @@ fn While() { // CHECK:STDOUT: br !while.cond.loc17 // CHECK:STDOUT: // CHECK:STDOUT: !while.cond.loc17: -// CHECK:STDOUT: %A.ref: = name_reference "A", file.%A +// CHECK:STDOUT: %A.ref: = name_reference A, file.%A // CHECK:STDOUT: %.loc17_11: init bool = call %A.ref() // CHECK:STDOUT: %.loc17_13: bool = value_of_initializer %.loc17_11 // CHECK:STDOUT: if %.loc17_13 br !while.body.loc17 else br !while.done.loc17 // CHECK:STDOUT: // CHECK:STDOUT: !while.body.loc17: -// CHECK:STDOUT: %B.ref: = name_reference "B", file.%B +// CHECK:STDOUT: %B.ref: = name_reference B, file.%B // CHECK:STDOUT: %.loc18_10: init bool = call %B.ref() // CHECK:STDOUT: %.loc18_12: bool = value_of_initializer %.loc18_10 // CHECK:STDOUT: if %.loc18_12 br !if.then.loc18 else br !if.else.loc18 @@ -74,7 +74,7 @@ fn While() { // CHECK:STDOUT: br !while.cond.loc17 // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc18: -// CHECK:STDOUT: %C.ref: = name_reference "C", file.%C +// CHECK:STDOUT: %C.ref: = name_reference C, file.%C // CHECK:STDOUT: %.loc19_10: init bool = call %C.ref() // CHECK:STDOUT: %.loc19_12: bool = value_of_initializer %.loc19_10 // CHECK:STDOUT: if %.loc19_12 br !if.then.loc19 else br !if.else.loc19 @@ -86,13 +86,13 @@ fn While() { // CHECK:STDOUT: br !while.cond.loc20 // CHECK:STDOUT: // CHECK:STDOUT: !while.cond.loc20: -// CHECK:STDOUT: %D.ref: = name_reference "D", file.%D +// CHECK:STDOUT: %D.ref: = name_reference D, file.%D // CHECK:STDOUT: %.loc20_13: init bool = call %D.ref() // CHECK:STDOUT: %.loc20_15: bool = value_of_initializer %.loc20_13 // CHECK:STDOUT: if %.loc20_15 br !while.body.loc20 else br !while.done.loc20 // CHECK:STDOUT: // CHECK:STDOUT: !while.body.loc20: -// CHECK:STDOUT: %E.ref: = name_reference "E", file.%E +// CHECK:STDOUT: %E.ref: = name_reference E, file.%E // CHECK:STDOUT: %.loc21_12: init bool = call %E.ref() // CHECK:STDOUT: %.loc21_14: bool = value_of_initializer %.loc21_12 // CHECK:STDOUT: if %.loc21_14 br !if.then.loc21 else br !if.else.loc21 @@ -101,7 +101,7 @@ fn While() { // CHECK:STDOUT: br !while.cond.loc20 // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc21: -// CHECK:STDOUT: %F.ref: = name_reference "F", file.%F +// CHECK:STDOUT: %F.ref: = name_reference F, file.%F // CHECK:STDOUT: %.loc22_12: init bool = call %F.ref() // CHECK:STDOUT: %.loc22_14: bool = value_of_initializer %.loc22_12 // CHECK:STDOUT: if %.loc22_14 br !if.then.loc22 else br !if.else.loc22 @@ -113,7 +113,7 @@ fn While() { // CHECK:STDOUT: br !while.cond.loc20 // CHECK:STDOUT: // CHECK:STDOUT: !while.done.loc20: -// CHECK:STDOUT: %G.ref: = name_reference "G", file.%G +// CHECK:STDOUT: %G.ref: = name_reference G, file.%G // CHECK:STDOUT: %.loc24_10: init bool = call %G.ref() // CHECK:STDOUT: %.loc24_12: bool = value_of_initializer %.loc24_10 // CHECK:STDOUT: if %.loc24_12 br !if.then.loc24 else br !if.else.loc24 @@ -122,7 +122,7 @@ fn While() { // CHECK:STDOUT: br !while.cond.loc17 // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc24: -// CHECK:STDOUT: %H.ref: = name_reference "H", file.%H +// CHECK:STDOUT: %H.ref: = name_reference H, file.%H // CHECK:STDOUT: %.loc25_10: init bool = call %H.ref() // CHECK:STDOUT: %.loc25_12: bool = value_of_initializer %.loc25_10 // CHECK:STDOUT: if %.loc25_12 br !if.then.loc25 else br !if.else.loc25 diff --git a/toolchain/check/testdata/while/unreachable_end.carbon b/toolchain/check/testdata/while/unreachable_end.carbon index 5b3c9a4aca71..4137bf0b5bfe 100644 --- a/toolchain/check/testdata/while/unreachable_end.carbon +++ b/toolchain/check/testdata/while/unreachable_end.carbon @@ -41,23 +41,23 @@ fn While() { // CHECK:STDOUT: // CHECK:STDOUT: fn @While() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: = name_reference "F", file.%F +// CHECK:STDOUT: %F.ref: = name_reference F, file.%F // CHECK:STDOUT: %.loc14: init () = call %F.ref() // CHECK:STDOUT: br !while.cond // CHECK:STDOUT: // CHECK:STDOUT: !while.cond: -// CHECK:STDOUT: %Cond.ref: = name_reference "Cond", file.%Cond +// CHECK:STDOUT: %Cond.ref: = name_reference Cond, file.%Cond // CHECK:STDOUT: %.loc15_14: init bool = call %Cond.ref() // CHECK:STDOUT: %.loc15_16: bool = value_of_initializer %.loc15_14 // CHECK:STDOUT: if %.loc15_16 br !while.body else br !while.done // CHECK:STDOUT: // CHECK:STDOUT: !while.body: -// CHECK:STDOUT: %G.ref: = name_reference "G", file.%G +// CHECK:STDOUT: %G.ref: = name_reference G, file.%G // CHECK:STDOUT: %.loc16: init () = call %G.ref() // CHECK:STDOUT: return // CHECK:STDOUT: // CHECK:STDOUT: !while.done: -// CHECK:STDOUT: %H.ref: = name_reference "H", file.%H +// CHECK:STDOUT: %H.ref: = name_reference H, file.%H // CHECK:STDOUT: %.loc19: init () = call %H.ref() // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/while/while.carbon b/toolchain/check/testdata/while/while.carbon index d50369066ea4..002d4c337b7f 100644 --- a/toolchain/check/testdata/while/while.carbon +++ b/toolchain/check/testdata/while/while.carbon @@ -40,23 +40,23 @@ fn While() { // CHECK:STDOUT: // CHECK:STDOUT: fn @While() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: = name_reference "F", file.%F +// CHECK:STDOUT: %F.ref: = name_reference F, file.%F // CHECK:STDOUT: %.loc14: init () = call %F.ref() // CHECK:STDOUT: br !while.cond // CHECK:STDOUT: // CHECK:STDOUT: !while.cond: -// CHECK:STDOUT: %Cond.ref: = name_reference "Cond", file.%Cond +// CHECK:STDOUT: %Cond.ref: = name_reference Cond, file.%Cond // CHECK:STDOUT: %.loc15_14: init bool = call %Cond.ref() // CHECK:STDOUT: %.loc15_16: bool = value_of_initializer %.loc15_14 // CHECK:STDOUT: if %.loc15_16 br !while.body else br !while.done // CHECK:STDOUT: // CHECK:STDOUT: !while.body: -// CHECK:STDOUT: %G.ref: = name_reference "G", file.%G +// CHECK:STDOUT: %G.ref: = name_reference G, file.%G // CHECK:STDOUT: %.loc16: init () = call %G.ref() // CHECK:STDOUT: br !while.cond // CHECK:STDOUT: // CHECK:STDOUT: !while.done: -// CHECK:STDOUT: %H.ref: = name_reference "H", file.%H +// CHECK:STDOUT: %H.ref: = name_reference H, file.%H // CHECK:STDOUT: %.loc18: init () = call %H.ref() // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/lower/file_context.cpp b/toolchain/lower/file_context.cpp index 36a44aa8597e..16d97da8e22f 100644 --- a/toolchain/lower/file_context.cpp +++ b/toolchain/lower/file_context.cpp @@ -117,9 +117,13 @@ auto FileContext::BuildFunctionDeclaration(SemIR::FunctionId function_id) if (SemIR::IsEntryPoint(sem_ir(), function_id)) { // TODO: Add an implicit `return 0` if `Run` doesn't return `i32`. mangled_name = "main"; - } else { + } else if (auto name = + sem_ir().names().GetAsStringIfIdentifier(function.name_id)) { // TODO: Decide on a name mangling scheme. - mangled_name = sem_ir().identifiers().Get(function.name_id); + mangled_name = *name; + } else { + CARBON_FATAL() << "Unexpected special name for function: " + << function.name_id; } llvm::FunctionType* function_type = @@ -132,16 +136,17 @@ auto FileContext::BuildFunctionDeclaration(SemIR::FunctionId function_id) for (auto [inst_id, arg] : llvm::zip_equal(param_inst_ids, llvm_function->args())) { auto inst = sem_ir().insts().Get(inst_id); + auto name_id = SemIR::NameId::Invalid; if (inst_id == function.return_slot_id) { - arg.setName("return"); + name_id = SemIR::NameId::ReturnSlot; arg.addAttr(llvm::Attribute::getWithStructRetType( llvm_context(), GetType(function.return_type_id))); } else if (inst.Is()) { - arg.setName("self"); + name_id = SemIR::NameId::SelfValue; } else { - arg.setName( - sem_ir().identifiers().Get(inst.As().name_id)); + name_id = inst.As().name_id; } + arg.setName(sem_ir().names().GetIRBaseName(name_id)); } return llvm_function; diff --git a/toolchain/lower/handle.cpp b/toolchain/lower/handle.cpp index be59dac15bca..e5a59a313844 100644 --- a/toolchain/lower/handle.cpp +++ b/toolchain/lower/handle.cpp @@ -294,7 +294,7 @@ auto HandleVarStorage(FunctionContext& context, SemIR::InstId inst_id, // TODO: Eventually this name will be optional, and we'll want to provide // something like `var` as a default. However, that's not possible right now // so cannot be tested. - auto name = context.sem_ir().identifiers().Get(inst.name_id); + auto name = context.sem_ir().names().GetIRBaseName(inst.name_id); auto* alloca = context.builder().CreateAlloca(context.GetType(inst.type_id), /*ArraySize=*/nullptr, name); context.SetLocal(inst_id, alloca); diff --git a/toolchain/lower/handle_aggregates.cpp b/toolchain/lower/handle_aggregates.cpp index 78e64cb088a3..7b0a61ae4ab8 100644 --- a/toolchain/lower/handle_aggregates.cpp +++ b/toolchain/lower/handle_aggregates.cpp @@ -101,7 +101,7 @@ static auto GetStructFieldName(FunctionContext& context, .fields_id); auto field = context.sem_ir().insts().GetAs( fields[index.index]); - return context.sem_ir().identifiers().Get(field.name_id); + return context.sem_ir().names().GetIRBaseName(field.name_id); } auto HandleClassFieldAccess(FunctionContext& context, SemIR::InstId inst_id, diff --git a/toolchain/sem_ir/BUILD b/toolchain/sem_ir/BUILD index 2a499ce1d5cb..ed05b300de8d 100644 --- a/toolchain/sem_ir/BUILD +++ b/toolchain/sem_ir/BUILD @@ -100,11 +100,13 @@ cc_library( cc_library( name = "value_stores", + srcs = ["value_stores.cpp"], hdrs = ["value_stores.h"], deps = [ ":inst", "//toolchain/base:value_store", "//toolchain/base:yaml", + "//toolchain/lex:token_kind", "@llvm-project//llvm:Support", ], ) diff --git a/toolchain/sem_ir/entry_point.cpp b/toolchain/sem_ir/entry_point.cpp index d9021fbfd56b..e44af7f2c03d 100644 --- a/toolchain/sem_ir/entry_point.cpp +++ b/toolchain/sem_ir/entry_point.cpp @@ -16,7 +16,8 @@ auto IsEntryPoint(const SemIR::File& file, SemIR::FunctionId function_id) const auto& function = file.functions().Get(function_id); // TODO: Check if `function` is in a namespace. return function.name_id.is_valid() && - file.identifiers().Get(function.name_id) == EntryPointFunction; + file.names().GetAsStringIfIdentifier(function.name_id) == + EntryPointFunction; } } // namespace Carbon::SemIR diff --git a/toolchain/sem_ir/file.cpp b/toolchain/sem_ir/file.cpp index 60058501227c..4fdc5eaf04be 100644 --- a/toolchain/sem_ir/file.cpp +++ b/toolchain/sem_ir/file.cpp @@ -288,7 +288,7 @@ auto File::StringifyTypeExpression(InstId outer_inst_id, case ClassType::Kind: { auto class_name_id = classes().Get(inst.As().class_id).name_id; - out << identifiers().Get(class_name_id); + out << names().GetFormatted(class_name_id); break; } case ConstType::Kind: { @@ -311,7 +311,7 @@ auto File::StringifyTypeExpression(InstId outer_inst_id, break; } case NameReference::Kind: { - out << identifiers().Get(inst.As().name_id); + out << names().GetFormatted(inst.As().name_id); break; } case PointerType::Kind: { @@ -344,7 +344,7 @@ auto File::StringifyTypeExpression(InstId outer_inst_id, } case StructTypeField::Kind: { auto field = inst.As(); - out << "." << identifiers().Get(field.name_id) << ": "; + out << "." << names().GetFormatted(field.name_id) << ": "; steps.push_back( {.inst_id = GetTypeAllowBuiltinTypes(field.field_type_id)}); break; diff --git a/toolchain/sem_ir/file.h b/toolchain/sem_ir/file.h index 58be76bb6b13..bc81c1f0c968 100644 --- a/toolchain/sem_ir/file.h +++ b/toolchain/sem_ir/file.h @@ -36,7 +36,7 @@ struct Function : public Printable { } // The function name. - IdentifierId name_id; + NameId name_id; // The definition, if the function has been defined or is currently being // defined. This is a FunctionDeclaration. InstId definition_id = InstId::Invalid; @@ -73,7 +73,7 @@ struct Class : public Printable { // lifetime of the class. // The class name. - IdentifierId name_id; + NameId name_id; // The class type, which is the type of `Self` in the class definition. TypeId self_type_id; // The first declaration of the class. This is a ClassDeclaration. @@ -287,6 +287,9 @@ class File : public Printable { } auto classes() -> ValueStore& { return classes_; } auto classes() const -> const ValueStore& { return classes_; } + auto names() const -> NameStoreWrapper { + return NameStoreWrapper(&identifiers()); + } auto name_scopes() -> NameScopeStore& { return name_scopes_; } auto name_scopes() const -> const NameScopeStore& { return name_scopes_; } auto types() -> ValueStore& { return types_; } diff --git a/toolchain/sem_ir/formatter.cpp b/toolchain/sem_ir/formatter.cpp index 41d787d3be3a..4b0b921deb8f 100644 --- a/toolchain/sem_ir/formatter.cpp +++ b/toolchain/sem_ir/formatter.cpp @@ -61,9 +61,7 @@ class InstNamer { // disambiguator. auto fn_loc = Parse::Node::Invalid; GetScopeInfo(fn_scope).name = globals.AllocateName( - *this, fn_loc, - fn.name_id.is_valid() ? sem_ir.identifiers().Get(fn.name_id).str() - : ""); + *this, fn_loc, sem_ir.names().GetIRBaseName(fn.name_id).str()); CollectNamesInBlock(fn_scope, fn.implicit_param_refs_id); CollectNamesInBlock(fn_scope, fn.param_refs_id); if (fn.return_slot_id.is_valid()) { @@ -93,9 +91,7 @@ class InstNamer { auto class_loc = Parse::Node::Invalid; GetScopeInfo(class_scope).name = globals.AllocateName( *this, class_loc, - class_info.name_id.is_valid() - ? sem_ir.identifiers().Get(class_info.name_id).str() - : ""); + sem_ir.names().GetIRBaseName(class_info.name_id).str()); AddBlockLabel(class_scope, class_info.body_block_id, "class", class_loc); CollectNamesInBlock(class_scope, class_info.body_block_id); } @@ -402,14 +398,9 @@ class InstNamer { insts[inst_id.index] = {scope_idx, scope.insts.AllocateName( *this, inst.parse_node(), name)}; }; - auto add_inst_name_id = [&](IdentifierId name_id, - llvm::StringRef suffix = "") { - if (name_id.is_valid()) { - add_inst_name( - (sem_ir_.identifiers().Get(name_id).str() + suffix).str()); - } else { - add_inst_name(suffix.str()); - } + auto add_inst_name_id = [&](NameId name_id, llvm::StringRef suffix = "") { + add_inst_name( + (sem_ir_.names().GetIRBaseName(name_id).str() + suffix).str()); }; switch (inst.kind()) { @@ -625,7 +616,7 @@ class Formatter { llvm::StringRef prefix) -> void { // Name scopes aren't kept in any particular order. Sort the entries before // we print them for stability and consistency. - llvm::SmallVector> entries; + llvm::SmallVector> entries; for (auto [name_id, inst_id] : sem_ir_.name_scopes().Get(id)) { entries.push_back({inst_id, name_id}); } @@ -635,7 +626,7 @@ class Formatter { llvm::ListSeparator sep(separator); for (auto [inst_id, name_id] : entries) { out_ << sep << prefix; - FormatString(name_id); + FormatName(name_id); out_ << " = "; FormatInstName(inst_id); } @@ -838,7 +829,7 @@ class Formatter { for (auto field_id : sem_ir_.inst_blocks().Get(inst.fields_id)) { out_ << sep << "."; auto field = sem_ir_.insts().GetAs(field_id); - FormatString(field.name_id); + FormatName(field.name_id); out_ << ": "; FormatType(field.field_type_id); } @@ -862,12 +853,6 @@ class Formatter { auto FormatArg(ClassId id) -> void { FormatClassName(id); } - auto FormatArg(IdentifierId id) -> void { - out_ << '"'; - out_.write_escaped(sem_ir_.identifiers().Get(id), /*UseHexEscapes=*/true); - out_ << '"'; - } - auto FormatArg(IntegerId id) -> void { sem_ir_.integers().Get(id).print(out_, /*isSigned=*/false); } @@ -906,6 +891,8 @@ class Formatter { out_ << '"'; } + auto FormatArg(NameId id) -> void { FormatName(id); } + auto FormatArg(TypeId id) -> void { FormatType(id); } auto FormatArg(TypeBlockId id) -> void { @@ -923,6 +910,10 @@ class Formatter { FormatArg(dest_id); } + auto FormatName(NameId id) -> void { + out_ << sem_ir_.names().GetFormatted(id); + } + auto FormatInstName(InstId id) -> void { out_ << inst_namer_.GetNameFor(scope_, id); } @@ -931,10 +922,6 @@ class Formatter { out_ << inst_namer_.GetLabelFor(scope_, id); } - auto FormatString(IdentifierId id) -> void { - out_ << sem_ir_.identifiers().Get(id); - } - auto FormatFunctionName(FunctionId id) -> void { out_ << inst_namer_.GetNameFor(id); } diff --git a/toolchain/sem_ir/ids.h b/toolchain/sem_ir/ids.h index 046be5c0c578..59f811c5f19e 100644 --- a/toolchain/sem_ir/ids.h +++ b/toolchain/sem_ir/ids.h @@ -112,6 +112,54 @@ struct BoolValue : public IndexBase, public Printable { constexpr BoolValue BoolValue::False = BoolValue(0); constexpr BoolValue BoolValue::True = BoolValue(1); +// The ID of a name. A name is either a string or a special name such as +// `self`, or eventually `Self` or `base`. +struct NameId : public IndexBase, public Printable { + // An explicitly invalid ID. + static const NameId Invalid; + // The name of `self`. + static const NameId SelfValue; + // The name of `Self`. + static const NameId SelfType; + // The name of the return slot in a function. + static const NameId ReturnSlot; + + // Returns the NameId corresponding to a particular IdentifierId. + static auto ForIdentifier(IdentifierId id) -> NameId { + static_assert(NameId::InvalidIndex == IdentifierId::InvalidIndex); + CARBON_CHECK(id.index >= 0 || id.index == InvalidIndex) + << "Unexpected identifier ID"; + return NameId(id.index); + } + + using IndexBase::IndexBase; + + // Returns the IdentifierId corresponding to this NameId, or an invalid + // IdentifierId if this is a special name. + auto AsIdentifierId() -> IdentifierId { + return index >= 0 ? IdentifierId(index) : IdentifierId::Invalid; + } + + auto Print(llvm::raw_ostream& out) const -> void { + out << "name"; + if (*this == SelfValue) { + out << "SelfValue"; + } else if (*this == SelfType) { + out << "SelfType"; + } else if (*this == ReturnSlot) { + out << "ReturnSlot"; + } else { + CARBON_CHECK(index >= 0) << "Unknown index"; + IndexBase::Print(out); + } + } +}; + +constexpr NameId NameId::Invalid = NameId(NameId::InvalidIndex); +constexpr NameId NameId::SelfValue = NameId(NameId::InvalidIndex - 1); +constexpr NameId NameId::SelfType = NameId(NameId::InvalidIndex - 2); +constexpr NameId NameId::ReturnSlot = NameId(NameId::InvalidIndex - 3); + // The ID of a name scope. struct NameScopeId : public IndexBase, public Printable { // An explicitly invalid ID. diff --git a/toolchain/sem_ir/typed_insts.h b/toolchain/sem_ir/typed_insts.h index 774bdae3c217..2aa6205d09d5 100644 --- a/toolchain/sem_ir/typed_insts.h +++ b/toolchain/sem_ir/typed_insts.h @@ -101,7 +101,7 @@ struct BindName { Parse::Node parse_node; TypeId type_id; - IdentifierId name_id; + NameId name_id; InstId value_id; }; @@ -271,7 +271,7 @@ struct Field { Parse::Node parse_node; TypeId type_id; - IdentifierId name_id; + NameId name_id; MemberIndex index; }; @@ -309,7 +309,7 @@ struct NameReference { Parse::Node parse_node; TypeId type_id; - IdentifierId name_id; + NameId name_id; InstId value_id; }; @@ -333,7 +333,7 @@ struct Parameter { Parse::Node parse_node; TypeId type_id; - IdentifierId name_id; + NameId name_id; }; struct PointerType { @@ -437,7 +437,7 @@ struct StructTypeField { // This instruction is an implementation detail of `StructType`, and doesn't // produce a value, so has no type, even though it declares a field with a // type. - IdentifierId name_id; + NameId name_id; TypeId field_type_id; }; @@ -565,7 +565,7 @@ struct VarStorage { Parse::Node parse_node; TypeId type_id; - IdentifierId name_id; + NameId name_id; }; // HasParseNode is true if T has a `Parse::Node parse_node` field. diff --git a/toolchain/sem_ir/value_stores.cpp b/toolchain/sem_ir/value_stores.cpp new file mode 100644 index 000000000000..6731ce340e91 --- /dev/null +++ b/toolchain/sem_ir/value_stores.cpp @@ -0,0 +1,46 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#include "toolchain/sem_ir/value_stores.h" + +#include "llvm/ADT/StringSwitch.h" + +namespace Carbon::SemIR { + +// Get the spelling to use for a special name. +static auto GetSpecialName(NameId name_id, bool for_ir) -> llvm::StringRef { + switch (name_id.index) { + case NameId::Invalid.index: + return for_ir ? "" : ""; + case NameId::SelfValue.index: + return "self"; + case NameId::SelfType.index: + return "Self"; + case NameId::ReturnSlot.index: + return for_ir ? "return" : ""; + default: + CARBON_FATAL() << "Unknown special name"; + } +} + +auto NameStoreWrapper::GetFormatted(NameId name_id) const -> llvm::StringRef { + // If the name is an identifier name with a keyword spelling, format it with + // an `r#` prefix. Format any other identifier name as just the identifier. + if (auto string_name = GetAsStringIfIdentifier(name_id)) { + return llvm::StringSwitch(*string_name) +#define CARBON_KEYWORD_TOKEN(Name, Spelling) .Case(Spelling, "r#" Spelling) +#include "toolchain/lex/token_kind.def" + .Default(*string_name); + } + return GetSpecialName(name_id, /*for_ir=*/false); +} + +auto NameStoreWrapper::GetIRBaseName(NameId name_id) const -> llvm::StringRef { + if (auto string_name = GetAsStringIfIdentifier(name_id)) { + return *string_name; + } + return GetSpecialName(name_id, /*for_ir=*/true); +} + +} // namespace Carbon::SemIR diff --git a/toolchain/sem_ir/value_stores.h b/toolchain/sem_ir/value_stores.h index 71aaa7dae670..e42107217958 100644 --- a/toolchain/sem_ir/value_stores.h +++ b/toolchain/sem_ir/value_stores.h @@ -58,6 +58,49 @@ class ConstantStore { llvm::SmallVector values_; }; +// Provides a ValueStore-like interface for names. +// +// A name is either an identifier name or a special name such as `self` that +// does not correspond to an identifier token. Identifier names are represented +// as `NameId`s with the same non-negative index as the `IdentifierId` of the +// identifier. Special names are represented as `NameId`s with a negative +// index. +// +// `SemIR::NameId` values should be obtained by using `NameId::ForIdentifier` +// or the named constants such as `NameId::SelfValue`. +// +// As we do not require any additional explicit storage for names, this is +// currently a wrapper around an identifier store that has no state of its own. +class NameStoreWrapper { + public: + explicit NameStoreWrapper(const StringStoreWrapper* identifiers) + : identifiers_(identifiers) {} + + // Returns the requested name as a string, if it is an identifier name. This + // returns std::nullopt for special names. + auto GetAsStringIfIdentifier(NameId name_id) const + -> std::optional { + if (auto identifier_id = name_id.AsIdentifierId(); + identifier_id.is_valid()) { + return identifiers_->Get(identifier_id); + } + return std::nullopt; + } + + // Returns the requested name as a string for formatted output. This returns + // `"r#name"` if `name` is a keyword. + auto GetFormatted(NameId name_id) const -> llvm::StringRef; + + // Returns a best-effort name to use as the basis for SemIR and LLVM IR + // names. This is always identifier-shaped, but may be ambiguous, for example + // if there is both a `self` and an `r#self` in the same scope. Returns "" + // for an invalid name. + auto GetIRBaseName(NameId name_id) const -> llvm::StringRef; + + private: + const StringStoreWrapper* identifiers_; +}; + // Provides a ValueStore wrapper for an API specific to name scopes. class NameScopeStore { public: @@ -66,19 +109,19 @@ class NameScopeStore { // Adds an entry to a name scope. Returns true on success, false on // duplicates. - auto AddEntry(NameScopeId scope_id, IdentifierId name_id, InstId target_id) + auto AddEntry(NameScopeId scope_id, NameId name_id, InstId target_id) -> bool { return values_.Get(scope_id).insert({name_id, target_id}).second; } // Returns the requested name scope. auto Get(NameScopeId scope_id) const - -> const llvm::DenseMap& { + -> const llvm::DenseMap& { return values_.Get(scope_id); } private: - ValueStore> values_; + ValueStore> values_; }; // Provides a block-based ValueStore, which uses slab allocation of added @@ -179,4 +222,9 @@ class InstBlockStore : public BlockValueStore { } // namespace Carbon::SemIR +// Support use of NameId as DenseMap/DenseSet keys. +template <> +struct llvm::DenseMapInfo + : public Carbon::IndexMapInfo {}; + #endif // CARBON_TOOLCHAIN_SEM_IR_VALUE_STORES_H_