Просмотр исходного кода

Distinguish between name IDs and string IDs in the type system. (#3341)

Add a `NameId` that is effectively just a wrapper around a `StringId`,
with
some additional predefined values for names that don't correspond to
strings, such as the name of `self` or the function's return slot.
Richard Smith 2 лет назад
Родитель
Сommit
71aa4a45be
100 измененных файлов с 494 добавлено и 505 удалено
  1. 3 0
      toolchain/base/value_store.h
  2. 10 10
      toolchain/check/context.cpp
  3. 8 7
      toolchain/check/context.h
  4. 9 9
      toolchain/check/convert.cpp
  5. 3 3
      toolchain/check/declaration_name_stack.cpp
  6. 5 4
      toolchain/check/declaration_name_stack.h
  7. 3 8
      toolchain/check/handle_class.cpp
  8. 6 10
      toolchain/check/handle_function.cpp
  9. 8 15
      toolchain/check/handle_name.cpp
  10. 1 1
      toolchain/check/handle_struct.cpp
  11. 11 11
      toolchain/check/node_stack.h
  12. 4 4
      toolchain/check/testdata/array/array_in_place.carbon
  13. 3 3
      toolchain/check/testdata/array/assign_return_value.carbon
  14. 5 5
      toolchain/check/testdata/array/assign_var.carbon
  15. 6 6
      toolchain/check/testdata/array/base.carbon
  16. 2 2
      toolchain/check/testdata/array/fail_bound_overflow.carbon
  17. 7 7
      toolchain/check/testdata/array/fail_incomplete_element.carbon
  18. 2 2
      toolchain/check/testdata/array/fail_invalid_type.carbon
  19. 2 2
      toolchain/check/testdata/array/fail_out_of_bound.carbon
  20. 14 14
      toolchain/check/testdata/array/fail_type_mismatch.carbon
  21. 3 3
      toolchain/check/testdata/array/function_param.carbon
  22. 2 2
      toolchain/check/testdata/array/nine_elements.carbon
  23. 1 1
      toolchain/check/testdata/as/as_type.carbon
  24. 1 1
      toolchain/check/testdata/as/fail_no_conversion.carbon
  25. 1 1
      toolchain/check/testdata/as/fail_not_type.carbon
  26. 13 13
      toolchain/check/testdata/as/identity.carbon
  27. 15 15
      toolchain/check/testdata/as/tuple.carbon
  28. 7 7
      toolchain/check/testdata/basics/builtin_types.carbon
  29. 1 1
      toolchain/check/testdata/basics/fail_name_lookup.carbon
  30. 2 2
      toolchain/check/testdata/basics/fail_non_type_as_type.carbon
  31. 5 5
      toolchain/check/testdata/basics/fail_qualifier_unsupported.carbon
  32. 2 2
      toolchain/check/testdata/basics/multifile_raw_and_textual_ir.carbon
  33. 2 2
      toolchain/check/testdata/basics/multifile_raw_ir.carbon
  34. 4 4
      toolchain/check/testdata/basics/numeric_literals.carbon
  35. 2 2
      toolchain/check/testdata/basics/parens.carbon
  36. 5 5
      toolchain/check/testdata/basics/raw_and_textual_ir.carbon
  37. 3 3
      toolchain/check/testdata/basics/raw_identifier.carbon
  38. 4 4
      toolchain/check/testdata/basics/raw_ir.carbon
  39. 1 1
      toolchain/check/testdata/basics/textual_ir.carbon
  40. 6 6
      toolchain/check/testdata/class/basic.carbon
  41. 4 4
      toolchain/check/testdata/class/fail_addr_self.carbon
  42. 14 14
      toolchain/check/testdata/class/fail_incomplete.carbon
  43. 7 7
      toolchain/check/testdata/class/fail_init.carbon
  44. 10 10
      toolchain/check/testdata/class/fail_init_as_inplace.carbon
  45. 5 5
      toolchain/check/testdata/class/fail_memaccess_category.carbon
  46. 2 2
      toolchain/check/testdata/class/fail_member_of_let.carbon
  47. 10 10
      toolchain/check/testdata/class/fail_method.carbon
  48. 2 2
      toolchain/check/testdata/class/fail_reorder.carbon
  49. 1 1
      toolchain/check/testdata/class/fail_scope.carbon
  50. 3 3
      toolchain/check/testdata/class/fail_self.carbon
  51. 5 5
      toolchain/check/testdata/class/fail_unbound_field.carbon
  52. 4 4
      toolchain/check/testdata/class/fail_unknown_member.carbon
  53. 11 11
      toolchain/check/testdata/class/field_access.carbon
  54. 14 14
      toolchain/check/testdata/class/field_access_in_value.carbon
  55. 1 1
      toolchain/check/testdata/class/forward_declared.carbon
  56. 9 9
      toolchain/check/testdata/class/init.carbon
  57. 5 5
      toolchain/check/testdata/class/init_as.carbon
  58. 12 12
      toolchain/check/testdata/class/init_nested.carbon
  59. 12 12
      toolchain/check/testdata/class/method.carbon
  60. 30 30
      toolchain/check/testdata/class/nested.carbon
  61. 7 7
      toolchain/check/testdata/class/nested_name.carbon
  62. 1 1
      toolchain/check/testdata/class/reenter_scope.carbon
  63. 4 4
      toolchain/check/testdata/class/scope.carbon
  64. 4 4
      toolchain/check/testdata/class/self.carbon
  65. 4 4
      toolchain/check/testdata/class/self_type.carbon
  66. 5 5
      toolchain/check/testdata/class/static_method.carbon
  67. 1 1
      toolchain/check/testdata/const/collapse.carbon
  68. 1 1
      toolchain/check/testdata/const/fail_collapse.carbon
  69. 7 7
      toolchain/check/testdata/expression_category/in_place_tuple_initialization.carbon
  70. 2 2
      toolchain/check/testdata/function/call/empty_struct.carbon
  71. 2 2
      toolchain/check/testdata/function/call/empty_tuple.carbon
  72. 2 2
      toolchain/check/testdata/function/call/fail_not_callable.carbon
  73. 6 6
      toolchain/check/testdata/function/call/fail_param_count.carbon
  74. 1 1
      toolchain/check/testdata/function/call/fail_param_type.carbon
  75. 3 3
      toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon
  76. 4 4
      toolchain/check/testdata/function/call/i32.carbon
  77. 1 1
      toolchain/check/testdata/function/call/more_param_ir.carbon
  78. 1 1
      toolchain/check/testdata/function/call/params_one.carbon
  79. 2 2
      toolchain/check/testdata/function/call/params_one_comma.carbon
  80. 1 1
      toolchain/check/testdata/function/call/params_two.carbon
  81. 2 2
      toolchain/check/testdata/function/call/params_two_comma.carbon
  82. 1 1
      toolchain/check/testdata/function/call/params_zero.carbon
  83. 3 3
      toolchain/check/testdata/function/call/return_implicit.carbon
  84. 1 1
      toolchain/check/testdata/function/declaration/simple.carbon
  85. 4 4
      toolchain/check/testdata/if/else.carbon
  86. 3 3
      toolchain/check/testdata/if/fail_reachable_fallthrough.carbon
  87. 5 5
      toolchain/check/testdata/if/fail_scope.carbon
  88. 3 3
      toolchain/check/testdata/if/no_else.carbon
  89. 1 1
      toolchain/check/testdata/if/unreachable_fallthrough.carbon
  90. 5 5
      toolchain/check/testdata/if_expression/basic.carbon
  91. 4 4
      toolchain/check/testdata/if_expression/constant_condition.carbon
  92. 3 3
      toolchain/check/testdata/if_expression/control_flow.carbon
  93. 1 1
      toolchain/check/testdata/if_expression/fail_not_in_function.carbon
  94. 3 3
      toolchain/check/testdata/if_expression/nested.carbon
  95. 6 6
      toolchain/check/testdata/if_expression/struct.carbon
  96. 11 11
      toolchain/check/testdata/index/array_element_access.carbon
  97. 11 11
      toolchain/check/testdata/index/expression_category.carbon
  98. 5 5
      toolchain/check/testdata/index/fail_array_large_index.carbon
  99. 5 5
      toolchain/check/testdata/index/fail_array_non_int_indexing.carbon
  100. 5 5
      toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon

+ 3 - 0
toolchain/base/value_store.h

@@ -85,6 +85,9 @@ struct StringId : public IndexBase, public Printable<StringId> {
 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<IdentifierId> {
   static const IdentifierId Invalid;
   using IndexBase::IndexBase;

+ 10 - 10
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);

+ 8 - 7
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<SemIR::ClassId, SemIR::Class>& {
     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<IdentifierId> names;
+    llvm::DenseSet<SemIR::NameId> 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<IdentifierId, llvm::SmallVector<LexicalLookupResult>>
+  llvm::DenseMap<SemIR::NameId, llvm::SmallVector<LexicalLookupResult>>
       name_lookup_;
 
   // Cache of the mapping from instructions to types, to avoid recomputing the

+ 9 - 9
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<IdentifierId, int32_t> src_field_indexes;
+  llvm::SmallDenseMap<SemIR::NameId, int32_t> 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;
       }

+ 3 - 3
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(

+ 5 - 4
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.

+ 3 - 8
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();

+ 6 - 10
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<SemIR::SelfParameter>()) {
-      // 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;
 }
 

+ 8 - 15
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<Parse::NodeKind::Name>();
+  SemIR::NameId name_id = context.node_stack().Pop<Parse::NodeKind::Name>();
   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(

+ 1 - 1
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<Parse::NodeKind::Name>();
+  SemIR::NameId name_id = context.node_stack().Pop<Parse::NodeKind::Name>();
 
   // Store the name for the type.
   context.args_type_info_stack().AddInst(SemIR::StructTypeField{

+ 11 - 11
toolchain/check/node_stack.h

@@ -131,8 +131,8 @@ class NodeStack {
       RequireParseKind<RequiredParseKind>(back.first);
       return back;
     }
-    if constexpr (RequiredIdKind == IdKind::IdentifierId) {
-      auto back = PopWithParseNode<IdentifierId>();
+    if constexpr (RequiredIdKind == IdKind::NameId) {
+      auto back = PopWithParseNode<SemIR::NameId>();
       RequireParseKind<RequiredParseKind>(back.first);
       return back;
     }
@@ -190,8 +190,8 @@ class NodeStack {
     if constexpr (RequiredIdKind == IdKind::ClassId) {
       return back.id<SemIR::ClassId>();
     }
-    if constexpr (RequiredIdKind == IdKind::IdentifierId) {
-      return back.id<IdentifierId>();
+    if constexpr (RequiredIdKind == IdKind::NameId) {
+      return back.id<SemIR::NameId>();
     }
     if constexpr (RequiredIdKind == IdKind::TypeId) {
       return back.id<SemIR::TypeId>();
@@ -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<T, SemIR::ClassId>()) {
         return class_id;
       }
-      if constexpr (std::is_same<T, IdentifierId>()) {
+      if constexpr (std::is_same<T, SemIR::NameId>()) {
         return name_id;
       }
       if constexpr (std::is_same<T, SemIR::TypeId>()) {
@@ -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<IdT, SemIR::ClassId>) {
       return IdKind::ClassId;
     }
-    if constexpr (std::is_same_v<IdT, IdentifierId>) {
-      return IdKind::IdentifierId;
+    if constexpr (std::is_same_v<IdT, SemIR::NameId>) {
+      return IdKind::NameId;
     }
     if constexpr (std::is_same_v<IdT, SemIR::TypeId>) {
       return IdKind::TypeId;

+ 4 - 4
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: <function> = 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: <function> = 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: <function> = name_reference "F", file.%F
+// CHECK:STDOUT:   %F.ref.loc10_39: <function> = 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

+ 3 - 3
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: <function> = 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: <function> = 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

+ 5 - 5
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

+ 6 - 6
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 ()

+ 2 - 2
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 <error> = var "a"
-// CHECK:STDOUT:   %a: ref <error> = bind_name "a", %a.var
+// CHECK:STDOUT:   %a.var: ref <error> = var a
+// CHECK:STDOUT:   %a: ref <error> = bind_name a, %a.var
 // CHECK:STDOUT: }

+ 7 - 7
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 <error> = var "a"
-// CHECK:STDOUT:   %a: ref <error> = bind_name "a", %a.var
-// CHECK:STDOUT:   %Incomplete.ref.loc20: type = name_reference "Incomplete", %Incomplete
+// CHECK:STDOUT:   %a.var: ref <error> = var a
+// CHECK:STDOUT:   %a: ref <error> = 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 <error> = 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 <error> = name_reference a, %a
 // CHECK:STDOUT:   %.loc20_25: i32 = int_literal 0
 // CHECK:STDOUT:   %.loc20_22: <error>* = address_of <error>
 // CHECK:STDOUT:   assign %p.var, <error>

+ 2 - 2
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, <error>
-// CHECK:STDOUT:   %a.var: ref [<error>; 1] = var "a"
-// CHECK:STDOUT:   %a: ref [<error>; 1] = bind_name "a", %a.var
+// CHECK:STDOUT:   %a.var: ref [<error>; 1] = var a
+// CHECK:STDOUT:   %a: ref [<error>; 1] = bind_name a, %a.var
 // CHECK:STDOUT: }

+ 2 - 2
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

+ 14 - 14
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, <error>
 // 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, <error>
 // 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, <error>
 // 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, <error>
 // CHECK:STDOUT: }

+ 3 - 3
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: <function> = name_reference "F", file.%F
+// CHECK:STDOUT:   %F.ref: <function> = 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

+ 2 - 2
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

+ 1 - 1
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: }

+ 1 - 1
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", <error>
+// CHECK:STDOUT:   %n: (i32, i32) = bind_name n, <error>
 // CHECK:STDOUT: }

+ 1 - 1
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", <error>
+// CHECK:STDOUT:   %n: i32 = bind_name n, <error>
 // CHECK:STDOUT: }

+ 13 - 13
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: <function> = 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: <function> = 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: }

+ 15 - 15
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: <function> = name_reference "Make", file.%Make
+// CHECK:STDOUT:   %Make.ref.loc15_20: <function> = 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: <function> = name_reference "Make", file.%Make
+// CHECK:STDOUT:   %Make.ref.loc15_28: <function> = 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: <function> = 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: <function> = 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: <function> = name_reference "Make", file.%Make
+// CHECK:STDOUT:   %Make.ref.loc20_28: <function> = 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

+ 7 - 7
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: }

+ 1 - 1
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: <error> = name_reference "x", <error>
+// CHECK:STDOUT:   %x.ref: <error> = name_reference x, <error>
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 2 - 2
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, <error>
 // CHECK:STDOUT: }

+ 5 - 5
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, <error>
 // CHECK:STDOUT: }

+ 2 - 2
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}}

+ 2 - 2
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}}

+ 4 - 4
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

+ 2 - 2
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

+ 5 - 5
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

+ 3 - 3
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: }

+ 4 - 4
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}

+ 1 - 1
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

+ 6 - 6
toolchain/check/testdata/class/basic.carbon

@@ -37,8 +37,8 @@ fn Run() -> i32 {
 // CHECK:STDOUT:   %F: <function> = fn_decl @F
 // CHECK:STDOUT:   %G: <function> = fn_decl @G
 // CHECK:STDOUT:   %.loc14_8.1: type = unbound_field_type Class, i32
-// CHECK:STDOUT:   %.loc14_8.2: <unbound field of class Class> = field "k", member0
-// CHECK:STDOUT:   %k: <unbound field of class Class> = bind_name "k", %.loc14_8.2
+// CHECK:STDOUT:   %.loc14_8.2: <unbound field of class Class> = field k, member0
+// CHECK:STDOUT:   %k: <unbound field of class Class> = 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: <function> = name_reference "F", @Class.%F
+// CHECK:STDOUT:   %Class.ref: type = name_reference Class, file.%Class
+// CHECK:STDOUT:   %F.ref: <function> = 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

+ 4 - 4
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> = bound_method %c.ref.loc19, @Class.%F
 // CHECK:STDOUT:   %.loc19_6: init () = call %.loc19_4(<invalid>)
-// 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> = bound_method %c.ref.loc27, @Class.%G
 // CHECK:STDOUT:   %.loc27_6: init () = call %.loc27_4(<invalid>)
-// 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> = 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> = bound_method %.loc38_4.1, @Class.%G
 // CHECK:STDOUT:   %.loc38_4.2: Class* = address_of %.loc38_4.1

+ 14 - 14
toolchain/check/testdata/class/fail_incomplete.carbon

@@ -125,9 +125,9 @@ fn CallReturnIncomplete() {
 // CHECK:STDOUT:   %Class: type = class_type @Class
 // CHECK:STDOUT:   %.loc15: <function> = fn_decl @.1
 // CHECK:STDOUT:   %CallClassFunction: <function> = fn_decl @CallClassFunction
-// CHECK:STDOUT:   %Class.ref: type = name_reference "Class", %Class
-// CHECK:STDOUT:   %global_var.var: ref <error> = var "global_var"
-// CHECK:STDOUT:   %global_var: ref <error> = bind_name "global_var", %global_var.var
+// CHECK:STDOUT:   %Class.ref: type = name_reference Class, %Class
+// CHECK:STDOUT:   %global_var.var: ref <error> = var global_var
+// CHECK:STDOUT:   %global_var: ref <error> = bind_name global_var, %global_var.var
 // CHECK:STDOUT:   %ConvertFromStruct: <function> = fn_decl @ConvertFromStruct
 // CHECK:STDOUT:   %MemberAccess: <function> = fn_decl @MemberAccess
 // CHECK:STDOUT:   %Copy: <function> = 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: <error> = name_reference "Function", <error>
+// CHECK:STDOUT:   %Class.ref: type = name_reference Class, file.%Class
+// CHECK:STDOUT:   %Function.ref: <error> = name_reference Function, <error>
 // 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 <error>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @Copy(%p: Class*) -> <error> {
 // 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 <error>
 // 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: <error> = bind_name "c", <error>
+// CHECK:STDOUT:   %c: <error> = bind_name c, <error>
 // 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: <function> = name_reference "TakeIncomplete", file.%TakeIncomplete
-// CHECK:STDOUT:   %p.ref: Class* = name_reference "p", %p
+// CHECK:STDOUT:   %TakeIncomplete.ref.loc100: <function> = 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(<invalid>)
-// CHECK:STDOUT:   %TakeIncomplete.ref.loc111: <function> = name_reference "TakeIncomplete", file.%TakeIncomplete
+// CHECK:STDOUT:   %TakeIncomplete.ref.loc111: <function> = name_reference TakeIncomplete, file.%TakeIncomplete
 // CHECK:STDOUT:   %.loc111_19: {} = struct_literal ()
 // CHECK:STDOUT:   %.loc111_17: init () = call %TakeIncomplete.ref.loc111(<invalid>)
 // CHECK:STDOUT:   return
@@ -199,7 +199,7 @@ fn CallReturnIncomplete() {
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @CallReturnIncomplete() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %ReturnIncomplete.ref: <function> = name_reference "ReturnIncomplete", file.%ReturnIncomplete
+// CHECK:STDOUT:   %ReturnIncomplete.ref: <function> = name_reference ReturnIncomplete, file.%ReturnIncomplete
 // CHECK:STDOUT:   %.loc115: init <error> = call %ReturnIncomplete.ref()
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 7 - 7
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: <unbound field of class Class> = field "a", member0
-// CHECK:STDOUT:   %a: <unbound field of class Class> = bind_name "a", %.loc8_8.2
+// CHECK:STDOUT:   %.loc8_8.2: <unbound field of class Class> = field a, member0
+// CHECK:STDOUT:   %a: <unbound field of class Class> = bind_name a, %.loc8_8.2
 // CHECK:STDOUT:   %.loc9_8.1: type = unbound_field_type Class, i32
-// CHECK:STDOUT:   %.loc9_8.2: <unbound field of class Class> = field "b", member1
-// CHECK:STDOUT:   %b: <unbound field of class Class> = bind_name "b", %.loc9_8.2
+// CHECK:STDOUT:   %.loc9_8.2: <unbound field of class Class> = field b, member1
+// CHECK:STDOUT:   %b: <unbound field of class Class> = 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, <error>
 // 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, <error>
 // CHECK:STDOUT:   return

+ 10 - 10
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: <unbound field of class Class> = field "a", member0
-// CHECK:STDOUT:   %a: <unbound field of class Class> = bind_name "a", %.loc8_8.2
+// CHECK:STDOUT:   %.loc8_8.2: <unbound field of class Class> = field a, member0
+// CHECK:STDOUT:   %a: <unbound field of class Class> = bind_name a, %.loc8_8.2
 // CHECK:STDOUT:   %.loc9_8.1: type = unbound_field_type Class, i32
-// CHECK:STDOUT:   %.loc9_8.2: <unbound field of class Class> = field "b", member1
-// CHECK:STDOUT:   %b: <unbound field of class Class> = bind_name "b", %.loc9_8.2
+// CHECK:STDOUT:   %.loc9_8.2: <unbound field of class Class> = field b, member1
+// CHECK:STDOUT:   %b: <unbound field of class Class> = 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, <error>
-// CHECK:STDOUT:   %G.ref: <function> = name_reference "G", file.%G
-// CHECK:STDOUT:   %c.ref: ref Class = name_reference "c", %c
+// CHECK:STDOUT:   %G.ref: <function> = 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

+ 5 - 5
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: <unbound field of class B> = field "a", member0
-// CHECK:STDOUT:   %a: <unbound field of class B> = bind_name "a", %.loc12_8.2
+// CHECK:STDOUT:   %.loc12_8.2: <unbound field of class B> = field a, member0
+// CHECK:STDOUT:   %a: <unbound field of class B> = 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> = bound_method %.loc23_4, @A.%F
 // CHECK:STDOUT:   %.loc23_8: init () = call %.loc23_6(<invalid>)
-// 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> = bound_method %.loc33_4.2, @A.%F

+ 2 - 2
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: <function> = fn_decl @.1
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 10 - 10
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: <function> = name_reference "NoSelf", @Class.%NoSelf
+// CHECK:STDOUT:   %c.ref.loc13: Class = name_reference c, %c
+// CHECK:STDOUT:   %NoSelf.ref.loc13: <function> = 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> = 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: <function> = name_reference "NoSelf", @Class.%NoSelf
+// CHECK:STDOUT:   %Class.ref.loc16: type = name_reference Class, file.%Class
+// CHECK:STDOUT:   %NoSelf.ref.loc16: <function> = 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: <function> = name_reference "WithSelf", @Class.%WithSelf
+// CHECK:STDOUT:   %Class.ref.loc23: type = name_reference Class, file.%Class
+// CHECK:STDOUT:   %WithSelf.ref.loc23: <function> = name_reference WithSelf, @Class.%WithSelf
 // CHECK:STDOUT:   %.loc23: init () = call %WithSelf.ref.loc23(<invalid>)
-// CHECK:STDOUT:   %Class.ref.loc30: type = name_reference "Class", file.%Class
-// CHECK:STDOUT:   %WithSelf.ref.loc30: <function> = 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: <function> = name_reference WithSelf, @Class.%WithSelf
+// CHECK:STDOUT:   %c.ref.loc30: Class = name_reference c, %c
 // CHECK:STDOUT:   %.loc30: init () = call %WithSelf.ref.loc30(<invalid>)
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 2 - 2
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: <error> = name_reference "F", <error>
+// CHECK:STDOUT:   %Class.ref: type = name_reference Class, file.%Class
+// CHECK:STDOUT:   %F.ref: <error> = name_reference F, <error>
 // CHECK:STDOUT:   return <error>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 1 - 1
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: <error> = name_reference "F", <error>
+// CHECK:STDOUT:   %F.ref: <error> = name_reference F, <error>
 // CHECK:STDOUT:   return <error>
 // CHECK:STDOUT: }

+ 3 - 3
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: <error> = name_reference "self", <error>
+// CHECK:STDOUT:   %self.ref: <error> = name_reference self, <error>
 // CHECK:STDOUT:   return <error>
 // 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> = bound_method %ws.ref, @WrongSelf.%F
 // CHECK:STDOUT:   %.loc50_7: init () = call %.loc50_5(<invalid>)
 // CHECK:STDOUT:   return

+ 5 - 5
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: <unbound field of class Class> = field "field", member0
-// CHECK:STDOUT:   %field: <unbound field of class Class> = bind_name "field", %.loc8_12.2
+// CHECK:STDOUT:   %.loc8_12.2: <unbound field of class Class> = field field, member0
+// CHECK:STDOUT:   %field: <unbound field of class Class> = bind_name field, %.loc8_12.2
 // CHECK:STDOUT:   %F: <function> = 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: <unbound field of class Class> = name_reference "field", @Class.%field
+// CHECK:STDOUT:   %field.ref: <unbound field of class Class> = name_reference field, @Class.%field
 // CHECK:STDOUT:   return <error>
 // 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: <unbound field of class Class> = name_reference "field", @Class.%field
+// CHECK:STDOUT:   %Class.ref: type = name_reference Class, file.%Class
+// CHECK:STDOUT:   %field.ref: <unbound field of class Class> = name_reference field, @Class.%field
 // CHECK:STDOUT:   return <error>
 // CHECK:STDOUT: }

+ 4 - 4
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: <unbound field of class Class> = field "n", member0
-// CHECK:STDOUT:   %n: <unbound field of class Class> = bind_name "n", %.loc8_8.2
+// CHECK:STDOUT:   %.loc8_8.2: <unbound field of class Class> = field n, member0
+// CHECK:STDOUT:   %n: <unbound field of class Class> = 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: <error> = name_reference "something", <error>
+// CHECK:STDOUT:   %c.ref: Class = name_reference c, %c
+// CHECK:STDOUT:   %something.ref: <error> = name_reference something, <error>
 // CHECK:STDOUT:   return <error>
 // CHECK:STDOUT: }

+ 11 - 11
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: <unbound field of class Class> = field "j", member0
-// CHECK:STDOUT:   %j: <unbound field of class Class> = bind_name "j", %.loc8_8.2
+// CHECK:STDOUT:   %.loc8_8.2: <unbound field of class Class> = field j, member0
+// CHECK:STDOUT:   %j: <unbound field of class Class> = bind_name j, %.loc8_8.2
 // CHECK:STDOUT:   %.loc9_8.1: type = unbound_field_type Class, i32
-// CHECK:STDOUT:   %.loc9_8.2: <unbound field of class Class> = field "k", member1
-// CHECK:STDOUT:   %k: <unbound field of class Class> = bind_name "k", %.loc9_8.2
+// CHECK:STDOUT:   %.loc9_8.2: <unbound field of class Class> = field k, member1
+// CHECK:STDOUT:   %k: <unbound field of class Class> = 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

+ 14 - 14
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: <unbound field of class Class> = field "j", member0
-// CHECK:STDOUT:   %j: <unbound field of class Class> = bind_name "j", %.loc8_8.2
+// CHECK:STDOUT:   %.loc8_8.2: <unbound field of class Class> = field j, member0
+// CHECK:STDOUT:   %j: <unbound field of class Class> = bind_name j, %.loc8_8.2
 // CHECK:STDOUT:   %.loc9_8.1: type = unbound_field_type Class, i32
-// CHECK:STDOUT:   %.loc9_8.2: <unbound field of class Class> = field "k", member1
-// CHECK:STDOUT:   %k: <unbound field of class Class> = bind_name "k", %.loc9_8.2
+// CHECK:STDOUT:   %.loc9_8.2: <unbound field of class Class> = field k, member1
+// CHECK:STDOUT:   %k: <unbound field of class Class> = 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

+ 1 - 1
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: }

+ 9 - 9
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: <unbound field of class Class> = field "n", member0
-// CHECK:STDOUT:   %n: <unbound field of class Class> = bind_name "n", %.loc8_8.2
-// CHECK:STDOUT:   %Class.ref: type = name_reference "Class", file.%Class
+// CHECK:STDOUT:   %.loc8_8.2: <unbound field of class Class> = field n, member0
+// CHECK:STDOUT:   %n: <unbound field of class Class> = 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: <unbound field of class Class> = field "next", member1
-// CHECK:STDOUT:   %next: <unbound field of class Class> = bind_name "next", %.loc9_11.2
+// CHECK:STDOUT:   %.loc9_11.2: <unbound field of class Class> = field next, member1
+// CHECK:STDOUT:   %next: <unbound field of class Class> = 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

+ 5 - 5
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: <unbound field of class Class> = field "a", member0
-// CHECK:STDOUT:   %a: <unbound field of class Class> = bind_name "a", %.loc8_8.2
+// CHECK:STDOUT:   %.loc8_8.2: <unbound field of class Class> = field a, member0
+// CHECK:STDOUT:   %a: <unbound field of class Class> = bind_name a, %.loc8_8.2
 // CHECK:STDOUT:   %.loc9_8.1: type = unbound_field_type Class, i32
-// CHECK:STDOUT:   %.loc9_8.2: <unbound field of class Class> = field "b", member1
-// CHECK:STDOUT:   %b: <unbound field of class Class> = bind_name "b", %.loc9_8.2
+// CHECK:STDOUT:   %.loc9_8.2: <unbound field of class Class> = field b, member1
+// CHECK:STDOUT:   %b: <unbound field of class Class> = 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

+ 12 - 12
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: <unbound field of class Inner> = field "a", member0
-// CHECK:STDOUT:   %a: <unbound field of class Inner> = bind_name "a", %.loc8_8.2
+// CHECK:STDOUT:   %.loc8_8.2: <unbound field of class Inner> = field a, member0
+// CHECK:STDOUT:   %a: <unbound field of class Inner> = bind_name a, %.loc8_8.2
 // CHECK:STDOUT:   %.loc9_8.1: type = unbound_field_type Inner, i32
-// CHECK:STDOUT:   %.loc9_8.2: <unbound field of class Inner> = field "b", member1
-// CHECK:STDOUT:   %b: <unbound field of class Inner> = bind_name "b", %.loc9_8.2
+// CHECK:STDOUT:   %.loc9_8.2: <unbound field of class Inner> = field b, member1
+// CHECK:STDOUT:   %b: <unbound field of class Inner> = 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: <unbound field of class Outer> = field "c", member0
-// CHECK:STDOUT:   %c: <unbound field of class Outer> = bind_name "c", %.loc15_8.2
-// CHECK:STDOUT:   %Inner.ref.loc16: type = name_reference "Inner", file.%Inner
+// CHECK:STDOUT:   %.loc15_8.2: <unbound field of class Outer> = field c, member0
+// CHECK:STDOUT:   %c: <unbound field of class Outer> = 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: <unbound field of class Outer> = field "d", member1
-// CHECK:STDOUT:   %d: <unbound field of class Outer> = bind_name "d", %.loc16_8.2
+// CHECK:STDOUT:   %.loc16_8.2: <unbound field of class Outer> = field d, member1
+// CHECK:STDOUT:   %d: <unbound field of class Outer> = 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: <function> = name_reference "MakeInner", file.%MakeInner
+// CHECK:STDOUT:   %MakeInner.ref.loc20_16: <function> = 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: <function> = name_reference "MakeInner", file.%MakeInner
+// CHECK:STDOUT:   %MakeInner.ref.loc20_34: <function> = 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)

+ 12 - 12
toolchain/check/testdata/class/method.carbon

@@ -66,8 +66,8 @@ fn CallGOnInitializingExpression() -> i32 {
 // CHECK:STDOUT:   %F: <function> = fn_decl @F
 // CHECK:STDOUT:   %G: <function> = fn_decl @G
 // CHECK:STDOUT:   %.loc11_8.1: type = unbound_field_type Class, i32
-// CHECK:STDOUT:   %.loc11_8.2: <unbound field of class Class> = field "k", member0
-// CHECK:STDOUT:   %k: <unbound field of class Class> = bind_name "k", %.loc11_8.2
+// CHECK:STDOUT:   %.loc11_8.2: <unbound field of class Class> = field k, member0
+// CHECK:STDOUT:   %k: <unbound field of class Class> = 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> = 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> = 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> = 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> = 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: <function> = name_reference "Make", file.%Make
+// CHECK:STDOUT:   %Make.ref: <function> = 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: <function> = name_reference "Make", file.%Make
+// CHECK:STDOUT:   %Make.ref: <function> = 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

+ 30 - 30
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: <unbound field of class Outer> = field "po", member0
-// CHECK:STDOUT:   %po: <unbound field of class Outer> = bind_name "po", %.loc14_9.2
-// CHECK:STDOUT:   %Outer.ref: type = name_reference "Outer", file.%Outer
+// CHECK:STDOUT:   %.loc14_9.2: <unbound field of class Outer> = field po, member0
+// CHECK:STDOUT:   %po: <unbound field of class Outer> = 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: <unbound field of class Outer> = field "qo", member1
-// CHECK:STDOUT:   %qo: <unbound field of class Outer> = bind_name "qo", %.loc15_9.2
-// CHECK:STDOUT:   %Inner.ref: type = name_reference "Inner", %Inner
+// CHECK:STDOUT:   %.loc15_9.2: <unbound field of class Outer> = field qo, member1
+// CHECK:STDOUT:   %qo: <unbound field of class Outer> = 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: <unbound field of class Outer> = field "pi", member2
-// CHECK:STDOUT:   %pi: <unbound field of class Outer> = bind_name "pi", %.loc16_9.2
+// CHECK:STDOUT:   %.loc16_9.2: <unbound field of class Outer> = field pi, member2
+// CHECK:STDOUT:   %pi: <unbound field of class Outer> = bind_name pi, %.loc16_9.2
 // CHECK:STDOUT:
 // CHECK:STDOUT: !members:
 // CHECK:STDOUT:   .Inner = <unexpected instref 11>
@@ -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: <unbound field of class Inner> = field "pi", member0
-// CHECK:STDOUT:   %pi: <unbound field of class Inner> = bind_name "pi", %.loc9_11.2
-// CHECK:STDOUT:   %Outer.ref: type = name_reference "Outer", file.%Outer
+// CHECK:STDOUT:   %.loc9_11.2: <unbound field of class Inner> = field pi, member0
+// CHECK:STDOUT:   %pi: <unbound field of class Inner> = 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: <unbound field of class Inner> = field "po", member1
-// CHECK:STDOUT:   %po: <unbound field of class Inner> = bind_name "po", %.loc10_11.2
-// CHECK:STDOUT:   %Inner.ref: type = name_reference "Inner", @Outer.%Inner
+// CHECK:STDOUT:   %.loc10_11.2: <unbound field of class Inner> = field po, member1
+// CHECK:STDOUT:   %po: <unbound field of class Inner> = 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: <unbound field of class Inner> = field "qi", member2
-// CHECK:STDOUT:   %qi: <unbound field of class Inner> = bind_name "qi", %.loc11_11.2
+// CHECK:STDOUT:   %.loc11_11.2: <unbound field of class Inner> = field qi, member2
+// CHECK:STDOUT:   %qi: <unbound field of class Inner> = 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

+ 7 - 7
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: <unbound field of class Inner> = field "n", member0
-// CHECK:STDOUT:   %n: <unbound field of class Inner> = bind_name "n", %.loc9_10.2
+// CHECK:STDOUT:   %.loc9_10.2: <unbound field of class Inner> = field n, member0
+// CHECK:STDOUT:   %n: <unbound field of class Inner> = 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: }

+ 1 - 1
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: <function> = name_reference "G", @Class.%G
+// CHECK:STDOUT:   %G.ref: <function> = 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

+ 4 - 4
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: <function> = name_reference "F", @Class.%F
+// CHECK:STDOUT:   %F.ref: <function> = 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: <function> = name_reference "F", file.%F
+// CHECK:STDOUT:   %F.ref.loc22_10: <function> = 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: <function> = name_reference "F", @Class.%F
+// CHECK:STDOUT:   %Class.ref: type = name_reference Class, file.%Class
+// CHECK:STDOUT:   %F.ref.loc22_21: <function> = 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

+ 4 - 4
toolchain/check/testdata/class/self.carbon

@@ -35,8 +35,8 @@ fn Class.G[addr self: Class*]() -> i32 {
 // CHECK:STDOUT:   %F: <function> = fn_decl @F
 // CHECK:STDOUT:   %G: <function> = fn_decl @G
 // CHECK:STDOUT:   %.loc11_8.1: type = unbound_field_type Class, i32
-// CHECK:STDOUT:   %.loc11_8.2: <unbound field of class Class> = field "n", member0
-// CHECK:STDOUT:   %n: <unbound field of class Class> = bind_name "n", %.loc11_8.2
+// CHECK:STDOUT:   %.loc11_8.2: <unbound field of class Class> = field n, member0
+// CHECK:STDOUT:   %n: <unbound field of class Class> = 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

+ 4 - 4
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: <function> = 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: <unbound field of class Class> = field "p", member0
-// CHECK:STDOUT:   %p: <unbound field of class Class> = bind_name "p", %.loc9_8.2
+// CHECK:STDOUT:   %.loc9_8.2: <unbound field of class Class> = field p, member0
+// CHECK:STDOUT:   %p: <unbound field of class Class> = 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

+ 5 - 5
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: <function> = 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: <function> = 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

+ 1 - 1
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: }

+ 1 - 1
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 <error>
 // CHECK:STDOUT: }

+ 7 - 7
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: <function> = 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: <function> = 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: <function> = name_reference "F", file.%F
+// CHECK:STDOUT:   %v.ref: ref (i32, i32) = name_reference v, %v
+// CHECK:STDOUT:   %F.ref.loc11: <function> = 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: <function> = name_reference "F", file.%F
+// CHECK:STDOUT:   %F.ref.loc12: <function> = 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: <function> = name_reference "G", file.%G
+// CHECK:STDOUT:   %G.ref: <function> = 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

+ 2 - 2
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: <function> = name_reference "Echo", file.%Echo
+// CHECK:STDOUT:   %Echo.ref: <function> = 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)

+ 2 - 2
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: <function> = name_reference "Echo", file.%Echo
+// CHECK:STDOUT:   %Echo.ref: <function> = 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)

+ 2 - 2
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, <error>
 // CHECK:STDOUT:   return

+ 6 - 6
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: <function> = name_reference "Run0", file.%Run0
+// CHECK:STDOUT:   %Run0.ref.loc18: <function> = name_reference Run0, file.%Run0
 // CHECK:STDOUT:   %.loc18_8: i32 = int_literal 1
 // CHECK:STDOUT:   %.loc18_7: init () = call %Run0.ref.loc18(<invalid>)
-// CHECK:STDOUT:   %Run0.ref.loc25: <function> = name_reference "Run0", file.%Run0
+// CHECK:STDOUT:   %Run0.ref.loc25: <function> = 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(<invalid>)
-// CHECK:STDOUT:   %Run1.ref.loc33: <function> = name_reference "Run1", file.%Run1
+// CHECK:STDOUT:   %Run1.ref.loc33: <function> = name_reference Run1, file.%Run1
 // CHECK:STDOUT:   %.loc33: init () = call %Run1.ref.loc33(<invalid>)
-// CHECK:STDOUT:   %Run1.ref.loc40: <function> = name_reference "Run1", file.%Run1
+// CHECK:STDOUT:   %Run1.ref.loc40: <function> = 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(<invalid>)
-// CHECK:STDOUT:   %Run2.ref.loc48: <function> = name_reference "Run2", file.%Run2
+// CHECK:STDOUT:   %Run2.ref.loc48: <function> = name_reference Run2, file.%Run2
 // CHECK:STDOUT:   %.loc48: init () = call %Run2.ref.loc48(<invalid>)
-// CHECK:STDOUT:   %Run2.ref.loc55: <function> = name_reference "Run2", file.%Run2
+// CHECK:STDOUT:   %Run2.ref.loc55: <function> = name_reference Run2, file.%Run2
 // CHECK:STDOUT:   %.loc55_8: i32 = int_literal 0
 // CHECK:STDOUT:   %.loc55_7: init () = call %Run2.ref.loc55(<invalid>)
 // CHECK:STDOUT:   return

+ 1 - 1
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: <function> = name_reference "G", file.%G
+// CHECK:STDOUT:   %G.ref: <function> = name_reference G, file.%G
 // CHECK:STDOUT:   %.loc16_5: f64 = real_literal 10e-1
 // CHECK:STDOUT:   %.loc16_4: init () = call %G.ref(<invalid>)
 // CHECK:STDOUT:   return

+ 3 - 3
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: <function> = 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: <function> = name_reference Foo, file.%Foo
 // CHECK:STDOUT:   %.loc13: init f64 = call %Foo.ref()
 // CHECK:STDOUT:   assign %x.var, <error>
 // CHECK:STDOUT:   return

+ 4 - 4
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: <function> = 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: <function> = 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

+ 1 - 1
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: <function> = name_reference "Foo", file.%Foo
+// CHECK:STDOUT:   %Foo.ref: <function> = 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

+ 1 - 1
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: <function> = name_reference "Foo", file.%Foo
+// CHECK:STDOUT:   %Foo.ref: <function> = 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

+ 2 - 2
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: <function> = name_reference "Foo", file.%Foo
+// CHECK:STDOUT:   %Foo.ref.loc10: <function> = 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: <function> = name_reference "Foo", file.%Foo
+// CHECK:STDOUT:   %Foo.ref.loc11: <function> = 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

+ 1 - 1
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: <function> = name_reference "Foo", file.%Foo
+// CHECK:STDOUT:   %Foo.ref: <function> = 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)

+ 2 - 2
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: <function> = name_reference "Foo", file.%Foo
+// CHECK:STDOUT:   %Foo.ref.loc10: <function> = 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: <function> = name_reference "Foo", file.%Foo
+// CHECK:STDOUT:   %Foo.ref.loc11: <function> = 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)

+ 1 - 1
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: <function> = name_reference "Foo", file.%Foo
+// CHECK:STDOUT:   %Foo.ref: <function> = name_reference Foo, file.%Foo
 // CHECK:STDOUT:   %.loc10: init () = call %Foo.ref()
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 3 - 3
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: <function> = 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: <function> = name_reference MakeImplicitEmptyTuple, file.%MakeImplicitEmptyTuple
 // CHECK:STDOUT:   %.loc11_37: init () = call %MakeImplicitEmptyTuple.ref()
 // CHECK:STDOUT:   assign %b.var, %.loc11_37
 // CHECK:STDOUT:   return

+ 1 - 1
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: <function> = name_reference "F", file.%F
+// CHECK:STDOUT:   %F.ref: <function> = name_reference F, file.%F
 // CHECK:STDOUT:   %.loc9: init () = call %F.ref()
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 4 - 4
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: <function> = name_reference "F", file.%F
+// CHECK:STDOUT:   %F.ref: <function> = 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: <function> = name_reference "G", file.%G
+// CHECK:STDOUT:   %G.ref: <function> = 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: <function> = name_reference "H", file.%H
+// CHECK:STDOUT:   %H.ref: <function> = name_reference H, file.%H
 // CHECK:STDOUT:   %.loc17: init () = call %H.ref()
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 3 - 3
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:

+ 5 - 5
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: <error> = name_reference "n", <error>
+// CHECK:STDOUT:   %n.ref.loc15: <error> = name_reference n, <error>
 // CHECK:STDOUT:   return <error>
 // CHECK:STDOUT: }

+ 3 - 3
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: <function> = name_reference "F", file.%F
+// CHECK:STDOUT:   %F.ref: <function> = 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: <function> = name_reference "G", file.%G
+// CHECK:STDOUT:   %G.ref: <function> = name_reference G, file.%G
 // CHECK:STDOUT:   %.loc14: init () = call %G.ref()
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 1 - 1
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:

+ 5 - 5
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:

+ 4 - 4
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: <function> = name_reference "A", file.%A
+// CHECK:STDOUT:   %A.ref: <function> = 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: <function> = name_reference "B", file.%B
+// CHECK:STDOUT:   %B.ref: <function> = 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: <function> = name_reference "A", file.%A
+// CHECK:STDOUT:   %A.ref: <function> = 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: <function> = name_reference "B", file.%B
+// CHECK:STDOUT:   %B.ref: <function> = 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)

+ 3 - 3
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: <function> = name_reference "A", file.%A
+// CHECK:STDOUT:   %A.ref: <function> = 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: <function> = name_reference "B", file.%B
+// CHECK:STDOUT:   %B.ref: <function> = 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)

+ 1 - 1
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 <unexpected instblockref 4>
-// 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: }

+ 3 - 3
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:

+ 6 - 6
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: <function> = name_reference "G", file.%G
-// CHECK:STDOUT:   %cond.ref: bool = name_reference "cond", %cond
+// CHECK:STDOUT:   %G.ref: <function> = 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

+ 11 - 11
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

+ 11 - 11
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: <function> = name_reference "F", file.%F
+// CHECK:STDOUT:   %F.ref: <function> = 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

+ 5 - 5
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, <error>
 // CHECK:STDOUT:   %.loc11_35.2: i32 = bind_value %.loc11_35.1

+ 5 - 5
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, <error>
 // CHECK:STDOUT:   %.loc11_19.2: i32 = bind_value %.loc11_19.1

+ 5 - 5
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, <error>
 // CHECK:STDOUT:   %.loc11_17.2: i32 = bind_value %.loc11_17.1

Некоторые файлы не были показаны из-за большого количества измененных файлов