From c2ddf50892f6b4d82aeef64dade5afdfb10b6d7b Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Wed, 22 Oct 2025 09:30:12 -0700 Subject: [PATCH] Add unit tagging to EntityNameId (#6257) --- .../basics/raw_sem_ir/cpp_interop.carbon | 24 +- .../basics/raw_sem_ir/multifile.carbon | 4 +- .../multifile_with_textual_ir.carbon | 4 +- .../basics/raw_sem_ir/one_file.carbon | 240 +++++++++--------- .../one_file_with_textual_ir.carbon | 6 +- toolchain/sem_ir/entity_name.h | 2 + toolchain/sem_ir/file.cpp | 1 + 7 files changed, 142 insertions(+), 139 deletions(-) diff --git a/toolchain/check/testdata/basics/raw_sem_ir/cpp_interop.carbon b/toolchain/check/testdata/basics/raw_sem_ir/cpp_interop.carbon index 882bae7c67be..507c89400635 100644 --- a/toolchain/check/testdata/basics/raw_sem_ir/cpp_interop.carbon +++ b/toolchain/check/testdata/basics/raw_sem_ir/cpp_interop.carbon @@ -56,12 +56,12 @@ fn G(x: Cpp.X) { // CHECK:STDOUT: name_scope60000001: {inst: inst60000010, parent_scope: name_scope00000000, has_error: false, extended_scopes: [], names: {name00000003: inst60000012, name00000004: inst60000029, name00000005: inst6000004B}} // CHECK:STDOUT: name_scope60000002: {inst: inst60000012, parent_scope: name_scope60000001, has_error: false, extended_scopes: [], names: {}} // CHECK:STDOUT: entity_names: -// CHECK:STDOUT: entity_name00000000: {name: name00000002, parent_scope: name_scope, index: -1, is_template: 0} -// CHECK:STDOUT: entity_name00000001: {name: name00000002, parent_scope: name_scope, index: -1, is_template: 0} -// CHECK:STDOUT: entity_name00000002: {name: name00000002, parent_scope: name_scope, index: -1, is_template: 0} -// CHECK:STDOUT: entity_name00000003: {name: name00000005, parent_scope: name_scope60000001, index: -1, is_template: 0} +// CHECK:STDOUT: entity_name60000000: {name: name00000002, parent_scope: name_scope, index: -1, is_template: 0} +// CHECK:STDOUT: entity_name60000001: {name: name00000002, parent_scope: name_scope, index: -1, is_template: 0} +// CHECK:STDOUT: entity_name60000002: {name: name00000002, parent_scope: name_scope, index: -1, is_template: 0} +// CHECK:STDOUT: entity_name60000003: {name: name00000005, parent_scope: name_scope60000001, index: -1, is_template: 0} // CHECK:STDOUT: cpp_global_vars: -// CHECK:STDOUT: cpp_global_var00000000: {key: {entity_name_id: entity_name00000003}, clang_decl_id: clang_decl_id00000007} +// CHECK:STDOUT: cpp_global_var00000000: {key: {entity_name_id: entity_name60000003}, clang_decl_id: clang_decl_id00000007} // CHECK:STDOUT: functions: // CHECK:STDOUT: function60000000: {name: name00000001, parent_scope: name_scope00000000, call_params_id: inst_block00000006, body: [inst_block00000009]} // CHECK:STDOUT: function60000001: {name: name00000004, parent_scope: name_scope60000001, call_params_id: inst_block_empty} @@ -131,9 +131,9 @@ fn G(x: Cpp.X) { // CHECK:STDOUT: inst60000012: {kind: ClassDecl, arg0: class60000000, arg1: inst_block, type: type(TypeType)} // CHECK:STDOUT: inst60000013: {kind: ClassType, arg0: class60000000, arg1: specific, type: type(TypeType)} // CHECK:STDOUT: inst60000014: {kind: NameRef, arg0: name00000003, arg1: inst60000012, type: type(TypeType)} -// CHECK:STDOUT: inst60000015: {kind: BindName, arg0: entity_name00000000, arg1: inst60000019, type: type(inst60000013)} +// CHECK:STDOUT: inst60000015: {kind: BindName, arg0: entity_name60000000, arg1: inst60000019, type: type(inst60000013)} // CHECK:STDOUT: inst60000016: {kind: PatternType, arg0: inst60000013, type: type(TypeType)} -// CHECK:STDOUT: inst60000017: {kind: BindingPattern, arg0: entity_name00000000, type: type(inst60000016)} +// CHECK:STDOUT: inst60000017: {kind: BindingPattern, arg0: entity_name60000000, type: type(inst60000016)} // CHECK:STDOUT: inst60000018: {kind: ValueParamPattern, arg0: inst60000017, arg1: call_param0, type: type(inst60000016)} // CHECK:STDOUT: inst60000019: {kind: ValueParam, arg0: call_param0, arg1: name00000002, type: type(inst60000013)} // CHECK:STDOUT: inst6000001A: {kind: SpliceBlock, arg0: inst_block00000004, arg1: inst60000014, type: type(TypeType)} @@ -164,16 +164,16 @@ fn G(x: Cpp.X) { // CHECK:STDOUT: inst60000033: {kind: NameRef, arg0: name00000000, arg1: inst60000010, type: type(inst(NamespaceType))} // CHECK:STDOUT: inst60000034: {kind: NameRef, arg0: name00000004, arg1: inst60000029, type: type(inst60000028)} // CHECK:STDOUT: inst60000035: {kind: NameRef, arg0: name00000002, arg1: inst60000015, type: type(inst60000013)} -// CHECK:STDOUT: inst60000036: {kind: BindName, arg0: entity_name00000001, arg1: inst60000039, type: type(inst60000013)} -// CHECK:STDOUT: inst60000037: {kind: BindingPattern, arg0: entity_name00000001, type: type(inst60000016)} +// CHECK:STDOUT: inst60000036: {kind: BindName, arg0: entity_name60000001, arg1: inst60000039, type: type(inst60000013)} +// CHECK:STDOUT: inst60000037: {kind: BindingPattern, arg0: entity_name60000001, type: type(inst60000016)} // CHECK:STDOUT: inst60000038: {kind: ValueParamPattern, arg0: inst60000037, arg1: call_param0, type: type(inst60000016)} // CHECK:STDOUT: inst60000039: {kind: ValueParam, arg0: call_param0, arg1: name00000002, type: type(inst60000013)} // CHECK:STDOUT: inst6000003A: {kind: FunctionDecl, arg0: function60000003, arg1: inst_block0000000F, type: type(inst6000003B)} // CHECK:STDOUT: inst6000003B: {kind: FunctionType, arg0: function60000003, arg1: specific, type: type(TypeType)} // CHECK:STDOUT: inst6000003C: {kind: StructValue, arg0: inst_block_empty, type: type(inst6000003B)} -// CHECK:STDOUT: inst6000003D: {kind: BindName, arg0: entity_name00000002, arg1: inst60000041, type: type(inst6000001F)} +// CHECK:STDOUT: inst6000003D: {kind: BindName, arg0: entity_name60000002, arg1: inst60000041, type: type(inst6000001F)} // CHECK:STDOUT: inst6000003E: {kind: PatternType, arg0: inst6000001F, type: type(TypeType)} -// CHECK:STDOUT: inst6000003F: {kind: BindingPattern, arg0: entity_name00000002, type: type(inst6000003E)} +// CHECK:STDOUT: inst6000003F: {kind: BindingPattern, arg0: entity_name60000002, type: type(inst6000003E)} // CHECK:STDOUT: inst60000040: {kind: ValueParamPattern, arg0: inst6000003F, arg1: call_param0, type: type(inst6000003E)} // CHECK:STDOUT: inst60000041: {kind: ValueParam, arg0: call_param0, arg1: name00000002, type: type(inst6000001F)} // CHECK:STDOUT: inst60000042: {kind: FunctionDecl, arg0: function60000004, arg1: inst_block00000014, type: type(inst60000043)} @@ -186,7 +186,7 @@ fn G(x: Cpp.X) { // CHECK:STDOUT: inst60000049: {kind: NameRef, arg0: name00000004, arg1: inst60000029, type: type(inst60000028)} // CHECK:STDOUT: inst6000004A: {kind: NameRef, arg0: name00000000, arg1: inst60000010, type: type(inst(NamespaceType))} // CHECK:STDOUT: inst6000004B: {kind: VarStorage, arg0: inst6000004D, type: type(inst6000001F)} -// CHECK:STDOUT: inst6000004C: {kind: BindingPattern, arg0: entity_name00000003, type: type(inst6000003E)} +// CHECK:STDOUT: inst6000004C: {kind: BindingPattern, arg0: entity_name60000003, type: type(inst6000003E)} // CHECK:STDOUT: inst6000004D: {kind: VarPattern, arg0: inst6000004C, type: type(inst6000003E)} // CHECK:STDOUT: inst6000004E: {kind: NameBindingDecl, arg0: inst_block00000017} // CHECK:STDOUT: inst6000004F: {kind: NameRef, arg0: name00000005, arg1: inst6000004B, type: type(inst6000001F)} diff --git a/toolchain/check/testdata/basics/raw_sem_ir/multifile.carbon b/toolchain/check/testdata/basics/raw_sem_ir/multifile.carbon index 975c74bdf7b4..3b3f3d9e6edd 100644 --- a/toolchain/check/testdata/basics/raw_sem_ir/multifile.carbon +++ b/toolchain/check/testdata/basics/raw_sem_ir/multifile.carbon @@ -100,7 +100,7 @@ fn B() { // CHECK:STDOUT: name_scope00000000: {inst: inst0000000E, parent_scope: name_scope, has_error: false, extended_scopes: [], names: {name00000001: inst50000010, name00000000: inst50000011}} // CHECK:STDOUT: name_scope50000001: {inst: inst50000010, parent_scope: name_scope00000000, has_error: false, extended_scopes: [], names: {name00000001: inst50000016}} // CHECK:STDOUT: entity_names: -// CHECK:STDOUT: entity_name00000000: {name: name00000001, parent_scope: name_scope50000001, index: -1, is_template: 0} +// CHECK:STDOUT: entity_name50000000: {name: name00000001, parent_scope: name_scope50000001, index: -1, is_template: 0} // CHECK:STDOUT: cpp_global_vars: {} // CHECK:STDOUT: functions: // CHECK:STDOUT: function50000000: {name: name00000000, parent_scope: name_scope00000000, call_params_id: inst_block_empty, body: [inst_block00000005]} @@ -130,7 +130,7 @@ fn B() { // CHECK:STDOUT: inst50000013: {kind: TupleType, arg0: inst_block_empty, type: type(TypeType)} // CHECK:STDOUT: inst50000014: {kind: StructValue, arg0: inst_block_empty, type: type(inst50000012)} // CHECK:STDOUT: inst50000015: {kind: NameRef, arg0: name00000001, arg1: inst50000010, type: type(inst(NamespaceType))} -// CHECK:STDOUT: inst50000016: {kind: ImportRefLoaded, arg0: import_ir_inst00000000, arg1: entity_name00000000, type: type(inst50000018)} +// CHECK:STDOUT: inst50000016: {kind: ImportRefLoaded, arg0: import_ir_inst00000000, arg1: entity_name50000000, type: type(inst50000018)} // CHECK:STDOUT: inst50000017: {kind: FunctionDecl, arg0: function50000001, arg1: inst_block_empty, type: type(inst50000018)} // CHECK:STDOUT: inst50000018: {kind: FunctionType, arg0: function50000001, arg1: specific, type: type(TypeType)} // CHECK:STDOUT: inst50000019: {kind: StructValue, arg0: inst_block_empty, type: type(inst50000018)} diff --git a/toolchain/check/testdata/basics/raw_sem_ir/multifile_with_textual_ir.carbon b/toolchain/check/testdata/basics/raw_sem_ir/multifile_with_textual_ir.carbon index 35409ae31578..14adf7bffff9 100644 --- a/toolchain/check/testdata/basics/raw_sem_ir/multifile_with_textual_ir.carbon +++ b/toolchain/check/testdata/basics/raw_sem_ir/multifile_with_textual_ir.carbon @@ -119,7 +119,7 @@ fn B() { // CHECK:STDOUT: name_scope00000000: {inst: inst0000000E, parent_scope: name_scope, has_error: false, extended_scopes: [], names: {name00000001: inst50000010, name00000000: inst50000011}} // CHECK:STDOUT: name_scope50000001: {inst: inst50000010, parent_scope: name_scope00000000, has_error: false, extended_scopes: [], names: {name00000001: inst50000016}} // CHECK:STDOUT: entity_names: -// CHECK:STDOUT: entity_name00000000: {name: name00000001, parent_scope: name_scope50000001, index: -1, is_template: 0} +// CHECK:STDOUT: entity_name50000000: {name: name00000001, parent_scope: name_scope50000001, index: -1, is_template: 0} // CHECK:STDOUT: cpp_global_vars: {} // CHECK:STDOUT: functions: // CHECK:STDOUT: function50000000: {name: name00000000, parent_scope: name_scope00000000, call_params_id: inst_block_empty, body: [inst_block00000005]} @@ -149,7 +149,7 @@ fn B() { // CHECK:STDOUT: inst50000013: {kind: TupleType, arg0: inst_block_empty, type: type(TypeType)} // CHECK:STDOUT: inst50000014: {kind: StructValue, arg0: inst_block_empty, type: type(inst50000012)} // CHECK:STDOUT: inst50000015: {kind: NameRef, arg0: name00000001, arg1: inst50000010, type: type(inst(NamespaceType))} -// CHECK:STDOUT: inst50000016: {kind: ImportRefLoaded, arg0: import_ir_inst00000000, arg1: entity_name00000000, type: type(inst50000018)} +// CHECK:STDOUT: inst50000016: {kind: ImportRefLoaded, arg0: import_ir_inst00000000, arg1: entity_name50000000, type: type(inst50000018)} // CHECK:STDOUT: inst50000017: {kind: FunctionDecl, arg0: function50000001, arg1: inst_block_empty, type: type(inst50000018)} // CHECK:STDOUT: inst50000018: {kind: FunctionType, arg0: function50000001, arg1: specific, type: type(TypeType)} // CHECK:STDOUT: inst50000019: {kind: StructValue, arg0: inst_block_empty, type: type(inst50000018)} diff --git a/toolchain/check/testdata/basics/raw_sem_ir/one_file.carbon b/toolchain/check/testdata/basics/raw_sem_ir/one_file.carbon index 5c3cdf571497..20dae3455cf0 100644 --- a/toolchain/check/testdata/basics/raw_sem_ir/one_file.carbon +++ b/toolchain/check/testdata/basics/raw_sem_ir/one_file.carbon @@ -232,68 +232,68 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: name_scope6000000B: {inst: inst600000BD, parent_scope: name_scope60000001, has_error: false, extended_scopes: [], names: {}} // CHECK:STDOUT: name_scope6000000C: {inst: inst600000F5, parent_scope: name_scope60000001, has_error: false, extended_scopes: [], names: {}} // CHECK:STDOUT: entity_names: -// CHECK:STDOUT: entity_name00000000: {name: name(PeriodSelf), parent_scope: name_scope, index: -1, is_template: 0} -// CHECK:STDOUT: entity_name00000001: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name00000002: {name: name00000002, parent_scope: name_scope, index: -1, is_template: 0} -// CHECK:STDOUT: entity_name00000003: {name: name00000003, parent_scope: name_scope60000001, index: -1, is_template: 0} -// CHECK:STDOUT: entity_name00000004: {name: name(SelfType), parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name00000005: {name: name00000004, parent_scope: name_scope60000002, index: -1, is_template: 0} -// CHECK:STDOUT: entity_name00000006: {name: name(SelfType), parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name00000007: {name: name(SelfType), parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name00000008: {name: name(SelfValue), parent_scope: name_scope, index: -1, is_template: 0} -// CHECK:STDOUT: entity_name00000009: {name: name(SelfType), parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name0000000A: {name: name(SelfType), parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name0000000B: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name0000000C: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name0000000D: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name0000000E: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name0000000F: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name00000010: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name00000011: {name: name(SelfValue), parent_scope: name_scope, index: -1, is_template: 0} -// CHECK:STDOUT: entity_name00000012: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name00000013: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name00000014: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name00000015: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name00000016: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name00000017: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name00000018: {name: name(SelfValue), parent_scope: name_scope, index: -1, is_template: 0} -// CHECK:STDOUT: entity_name00000019: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name0000001A: {name: name00000005, parent_scope: name_scope, index: 1, is_template: 0} -// CHECK:STDOUT: entity_name0000001B: {name: name00000005, parent_scope: name_scope, index: 1, is_template: 0} -// CHECK:STDOUT: entity_name0000001C: {name: name00000005, parent_scope: name_scope, index: 1, is_template: 0} -// CHECK:STDOUT: entity_name0000001D: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name0000001E: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name0000001F: {name: name00000005, parent_scope: name_scope, index: 1, is_template: 0} -// CHECK:STDOUT: entity_name00000020: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name00000021: {name: name00000005, parent_scope: name_scope, index: 1, is_template: 0} -// CHECK:STDOUT: entity_name00000022: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name00000023: {name: name00000005, parent_scope: name_scope, index: 1, is_template: 0} -// CHECK:STDOUT: entity_name00000024: {name: name(SelfValue), parent_scope: name_scope, index: -1, is_template: 0} -// CHECK:STDOUT: entity_name00000025: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name00000026: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name00000027: {name: name00000005, parent_scope: name_scope, index: 1, is_template: 0} -// CHECK:STDOUT: entity_name00000028: {name: name00000005, parent_scope: name_scope, index: 1, is_template: 0} -// CHECK:STDOUT: entity_name00000029: {name: name00000006, parent_scope: name_scope, index: 2, is_template: 0} -// CHECK:STDOUT: entity_name0000002A: {name: name00000006, parent_scope: name_scope, index: 2, is_template: 0} -// CHECK:STDOUT: entity_name0000002B: {name: name00000006, parent_scope: name_scope, index: 2, is_template: 0} -// CHECK:STDOUT: entity_name0000002C: {name: name00000005, parent_scope: name_scope, index: 1, is_template: 0} -// CHECK:STDOUT: entity_name0000002D: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name0000002E: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name0000002F: {name: name00000005, parent_scope: name_scope, index: 1, is_template: 0} -// CHECK:STDOUT: entity_name00000030: {name: name00000006, parent_scope: name_scope, index: 2, is_template: 0} -// CHECK:STDOUT: entity_name00000031: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name00000032: {name: name00000005, parent_scope: name_scope, index: 1, is_template: 0} -// CHECK:STDOUT: entity_name00000033: {name: name00000006, parent_scope: name_scope, index: 2, is_template: 0} -// CHECK:STDOUT: entity_name00000034: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name00000035: {name: name00000005, parent_scope: name_scope, index: 1, is_template: 0} -// CHECK:STDOUT: entity_name00000036: {name: name00000006, parent_scope: name_scope, index: 2, is_template: 0} -// CHECK:STDOUT: entity_name00000037: {name: name(SelfValue), parent_scope: name_scope, index: -1, is_template: 0} -// CHECK:STDOUT: entity_name00000038: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name00000039: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} -// CHECK:STDOUT: entity_name0000003A: {name: name00000005, parent_scope: name_scope, index: 1, is_template: 0} -// CHECK:STDOUT: entity_name0000003B: {name: name00000005, parent_scope: name_scope, index: 1, is_template: 0} -// CHECK:STDOUT: entity_name0000003C: {name: name00000006, parent_scope: name_scope, index: 2, is_template: 0} -// CHECK:STDOUT: entity_name0000003D: {name: name00000006, parent_scope: name_scope, index: 2, is_template: 0} +// CHECK:STDOUT: entity_name60000000: {name: name(PeriodSelf), parent_scope: name_scope, index: -1, is_template: 0} +// CHECK:STDOUT: entity_name60000001: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} +// CHECK:STDOUT: entity_name60000002: {name: name00000002, parent_scope: name_scope, index: -1, is_template: 0} +// CHECK:STDOUT: entity_name60000003: {name: name00000003, parent_scope: name_scope60000001, index: -1, is_template: 0} +// CHECK:STDOUT: entity_name60000004: {name: name(SelfType), parent_scope: name_scope, index: 0, is_template: 0} +// CHECK:STDOUT: entity_name60000005: {name: name00000004, parent_scope: name_scope60000002, index: -1, is_template: 0} +// CHECK:STDOUT: entity_name60000006: {name: name(SelfType), parent_scope: name_scope, index: 0, is_template: 0} +// CHECK:STDOUT: entity_name60000007: {name: name(SelfType), parent_scope: name_scope, index: 0, is_template: 0} +// CHECK:STDOUT: entity_name60000008: {name: name(SelfValue), parent_scope: name_scope, index: -1, is_template: 0} +// CHECK:STDOUT: entity_name60000009: {name: name(SelfType), parent_scope: name_scope, index: 0, is_template: 0} +// CHECK:STDOUT: entity_name6000000A: {name: name(SelfType), parent_scope: name_scope, index: 0, is_template: 0} +// CHECK:STDOUT: entity_name6000000B: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} +// CHECK:STDOUT: entity_name6000000C: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} +// CHECK:STDOUT: entity_name6000000D: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} +// CHECK:STDOUT: entity_name6000000E: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} +// CHECK:STDOUT: entity_name6000000F: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} +// CHECK:STDOUT: entity_name60000010: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} +// CHECK:STDOUT: entity_name60000011: {name: name(SelfValue), parent_scope: name_scope, index: -1, is_template: 0} +// CHECK:STDOUT: entity_name60000012: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} +// CHECK:STDOUT: entity_name60000013: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} +// CHECK:STDOUT: entity_name60000014: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} +// CHECK:STDOUT: entity_name60000015: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} +// CHECK:STDOUT: entity_name60000016: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} +// CHECK:STDOUT: entity_name60000017: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} +// CHECK:STDOUT: entity_name60000018: {name: name(SelfValue), parent_scope: name_scope, index: -1, is_template: 0} +// CHECK:STDOUT: entity_name60000019: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} +// CHECK:STDOUT: entity_name6000001A: {name: name00000005, parent_scope: name_scope, index: 1, is_template: 0} +// CHECK:STDOUT: entity_name6000001B: {name: name00000005, parent_scope: name_scope, index: 1, is_template: 0} +// CHECK:STDOUT: entity_name6000001C: {name: name00000005, parent_scope: name_scope, index: 1, is_template: 0} +// CHECK:STDOUT: entity_name6000001D: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} +// CHECK:STDOUT: entity_name6000001E: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} +// CHECK:STDOUT: entity_name6000001F: {name: name00000005, parent_scope: name_scope, index: 1, is_template: 0} +// CHECK:STDOUT: entity_name60000020: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} +// CHECK:STDOUT: entity_name60000021: {name: name00000005, parent_scope: name_scope, index: 1, is_template: 0} +// CHECK:STDOUT: entity_name60000022: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} +// CHECK:STDOUT: entity_name60000023: {name: name00000005, parent_scope: name_scope, index: 1, is_template: 0} +// CHECK:STDOUT: entity_name60000024: {name: name(SelfValue), parent_scope: name_scope, index: -1, is_template: 0} +// CHECK:STDOUT: entity_name60000025: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} +// CHECK:STDOUT: entity_name60000026: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} +// CHECK:STDOUT: entity_name60000027: {name: name00000005, parent_scope: name_scope, index: 1, is_template: 0} +// CHECK:STDOUT: entity_name60000028: {name: name00000005, parent_scope: name_scope, index: 1, is_template: 0} +// CHECK:STDOUT: entity_name60000029: {name: name00000006, parent_scope: name_scope, index: 2, is_template: 0} +// CHECK:STDOUT: entity_name6000002A: {name: name00000006, parent_scope: name_scope, index: 2, is_template: 0} +// CHECK:STDOUT: entity_name6000002B: {name: name00000006, parent_scope: name_scope, index: 2, is_template: 0} +// CHECK:STDOUT: entity_name6000002C: {name: name00000005, parent_scope: name_scope, index: 1, is_template: 0} +// CHECK:STDOUT: entity_name6000002D: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} +// CHECK:STDOUT: entity_name6000002E: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} +// CHECK:STDOUT: entity_name6000002F: {name: name00000005, parent_scope: name_scope, index: 1, is_template: 0} +// CHECK:STDOUT: entity_name60000030: {name: name00000006, parent_scope: name_scope, index: 2, is_template: 0} +// CHECK:STDOUT: entity_name60000031: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} +// CHECK:STDOUT: entity_name60000032: {name: name00000005, parent_scope: name_scope, index: 1, is_template: 0} +// CHECK:STDOUT: entity_name60000033: {name: name00000006, parent_scope: name_scope, index: 2, is_template: 0} +// CHECK:STDOUT: entity_name60000034: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} +// CHECK:STDOUT: entity_name60000035: {name: name00000005, parent_scope: name_scope, index: 1, is_template: 0} +// CHECK:STDOUT: entity_name60000036: {name: name00000006, parent_scope: name_scope, index: 2, is_template: 0} +// CHECK:STDOUT: entity_name60000037: {name: name(SelfValue), parent_scope: name_scope, index: -1, is_template: 0} +// CHECK:STDOUT: entity_name60000038: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} +// CHECK:STDOUT: entity_name60000039: {name: name00000001, parent_scope: name_scope, index: 0, is_template: 0} +// CHECK:STDOUT: entity_name6000003A: {name: name00000005, parent_scope: name_scope, index: 1, is_template: 0} +// CHECK:STDOUT: entity_name6000003B: {name: name00000005, parent_scope: name_scope, index: 1, is_template: 0} +// CHECK:STDOUT: entity_name6000003C: {name: name00000006, parent_scope: name_scope, index: 2, is_template: 0} +// CHECK:STDOUT: entity_name6000003D: {name: name00000006, parent_scope: name_scope, index: 2, is_template: 0} // CHECK:STDOUT: cpp_global_vars: {} // CHECK:STDOUT: functions: // CHECK:STDOUT: function60000000: {name: name00000000, parent_scope: name_scope00000000, call_params_id: inst_block0000000D, return_slot_pattern: inst60000030, body: [inst_block00000014]} @@ -384,20 +384,20 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: inst6000000F: {kind: ImportDecl, arg0: name(Core)} // CHECK:STDOUT: inst60000010: {kind: Namespace, arg0: name_scope60000001, arg1: inst6000000F, type: type(inst(NamespaceType))} // CHECK:STDOUT: inst60000011: {kind: FacetType, arg0: facet_type00000000, type: type(TypeType)} -// CHECK:STDOUT: inst60000012: {kind: BindSymbolicName, arg0: entity_name00000000, arg1: inst, type: type(inst60000011)} -// CHECK:STDOUT: inst60000013: {kind: BindSymbolicName, arg0: entity_name00000000, arg1: inst, type: type(inst60000011)} -// CHECK:STDOUT: inst60000014: {kind: BindSymbolicName, arg0: entity_name00000001, arg1: inst, type: type(TypeType)} -// CHECK:STDOUT: inst60000015: {kind: BindSymbolicName, arg0: entity_name00000001, arg1: inst, type: type(TypeType)} -// CHECK:STDOUT: inst60000016: {kind: BindSymbolicName, arg0: entity_name00000001, arg1: inst, type: type(TypeType)} +// CHECK:STDOUT: inst60000012: {kind: BindSymbolicName, arg0: entity_name60000000, arg1: inst, type: type(inst60000011)} +// CHECK:STDOUT: inst60000013: {kind: BindSymbolicName, arg0: entity_name60000000, arg1: inst, type: type(inst60000011)} +// CHECK:STDOUT: inst60000014: {kind: BindSymbolicName, arg0: entity_name60000001, arg1: inst, type: type(TypeType)} +// CHECK:STDOUT: inst60000015: {kind: BindSymbolicName, arg0: entity_name60000001, arg1: inst, type: type(TypeType)} +// CHECK:STDOUT: inst60000016: {kind: BindSymbolicName, arg0: entity_name60000001, arg1: inst, type: type(TypeType)} // CHECK:STDOUT: inst60000017: {kind: PatternType, arg0: inst(TypeType), type: type(TypeType)} -// CHECK:STDOUT: inst60000018: {kind: SymbolicBindingPattern, arg0: entity_name00000001, type: type(inst60000017)} +// CHECK:STDOUT: inst60000018: {kind: SymbolicBindingPattern, arg0: entity_name60000001, type: type(inst60000017)} // CHECK:STDOUT: inst60000019: {kind: NameRef, arg0: name00000001, arg1: inst60000014, type: type(TypeType)} // CHECK:STDOUT: inst6000001A: {kind: PointerType, arg0: inst60000019, type: type(TypeType)} // CHECK:STDOUT: inst6000001B: {kind: PointerType, arg0: inst60000015, type: type(TypeType)} // CHECK:STDOUT: inst6000001C: {kind: PointerType, arg0: inst60000016, type: type(TypeType)} -// CHECK:STDOUT: inst6000001D: {kind: BindName, arg0: entity_name00000002, arg1: inst60000031, type: type(symbolic_constant00000004)} +// CHECK:STDOUT: inst6000001D: {kind: BindName, arg0: entity_name60000002, arg1: inst60000031, type: type(symbolic_constant00000004)} // CHECK:STDOUT: inst6000001E: {kind: PatternType, arg0: inst6000001B, type: type(TypeType)} -// CHECK:STDOUT: inst6000001F: {kind: BindingPattern, arg0: entity_name00000002, type: type(symbolic_constant00000006)} +// CHECK:STDOUT: inst6000001F: {kind: BindingPattern, arg0: entity_name60000002, type: type(symbolic_constant00000006)} // CHECK:STDOUT: inst60000020: {kind: PatternType, arg0: inst6000001C, type: type(TypeType)} // CHECK:STDOUT: inst60000021: {kind: ValueParamPattern, arg0: inst6000001F, arg1: call_param0, type: type(symbolic_constant00000006)} // CHECK:STDOUT: inst60000022: {kind: NameRef, arg0: name00000001, arg1: inst60000014, type: type(TypeType)} @@ -435,45 +435,45 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: inst60000042: {kind: RequireCompleteType, arg0: inst6000002A, type: type(inst(WitnessType))} // CHECK:STDOUT: inst60000043: {kind: TupleAccess, arg0: inst60000034, arg1: element0, type: type(symbolic_constant00000004)} // CHECK:STDOUT: inst60000044: {kind: RequireCompleteType, arg0: inst6000001B, type: type(inst(WitnessType))} -// CHECK:STDOUT: inst60000045: {kind: ImportRefLoaded, arg0: import_ir_inst00000000, arg1: entity_name00000003, type: type(TypeType)} +// CHECK:STDOUT: inst60000045: {kind: ImportRefLoaded, arg0: import_ir_inst00000000, arg1: entity_name60000003, type: type(TypeType)} // CHECK:STDOUT: inst60000046: {kind: InterfaceDecl, arg0: interface60000000, arg1: inst_block_empty, type: type(TypeType)} // CHECK:STDOUT: inst60000047: {kind: FacetType, arg0: facet_type00000001, type: type(TypeType)} -// CHECK:STDOUT: inst60000048: {kind: BindSymbolicName, arg0: entity_name00000004, arg1: inst, type: type(inst60000047)} +// CHECK:STDOUT: inst60000048: {kind: BindSymbolicName, arg0: entity_name60000004, arg1: inst, type: type(inst60000047)} // CHECK:STDOUT: inst60000049: {kind: ImportRefUnloaded, arg0: import_ir_inst00000002, arg1: entity_name} // CHECK:STDOUT: inst6000004A: {kind: ImportRefLoaded, arg0: import_ir_inst00000003, arg1: entity_name, type: type(inst6000004C)} -// CHECK:STDOUT: inst6000004B: {kind: ImportRefUnloaded, arg0: import_ir_inst00000004, arg1: entity_name00000005} +// CHECK:STDOUT: inst6000004B: {kind: ImportRefUnloaded, arg0: import_ir_inst00000004, arg1: entity_name60000005} // CHECK:STDOUT: inst6000004C: {kind: AssociatedEntityType, arg0: interface60000000, arg1: specific, type: type(TypeType)} // CHECK:STDOUT: inst6000004D: {kind: ImportRefLoaded, arg0: import_ir_inst00000005, arg1: entity_name, type: type(inst60000050)} // CHECK:STDOUT: inst6000004E: {kind: AssociatedEntity, arg0: element0, arg1: inst6000004D, type: type(inst6000004C)} // CHECK:STDOUT: inst6000004F: {kind: FunctionDecl, arg0: function60000001, arg1: inst_block_empty, type: type(inst60000050)} // CHECK:STDOUT: inst60000050: {kind: FunctionType, arg0: function60000001, arg1: specific, type: type(TypeType)} // CHECK:STDOUT: inst60000051: {kind: StructValue, arg0: inst_block_empty, type: type(inst60000050)} -// CHECK:STDOUT: inst60000052: {kind: SymbolicBindingType, arg0: entity_name00000004, arg1: inst60000048, type: type(TypeType)} +// CHECK:STDOUT: inst60000052: {kind: SymbolicBindingType, arg0: entity_name60000004, arg1: inst60000048, type: type(TypeType)} // CHECK:STDOUT: inst60000053: {kind: PatternType, arg0: inst60000052, type: type(TypeType)} // CHECK:STDOUT: inst60000054: {kind: ReturnSlotPattern, arg0: inst, type: type(symbolic_constant00000013)} // CHECK:STDOUT: inst60000055: {kind: OutParamPattern, arg0: inst60000054, arg1: call_param1, type: type(symbolic_constant00000013)} -// CHECK:STDOUT: inst60000056: {kind: BindingPattern, arg0: entity_name00000008, type: type(symbolic_constant00000013)} +// CHECK:STDOUT: inst60000056: {kind: BindingPattern, arg0: entity_name60000008, type: type(symbolic_constant00000013)} // CHECK:STDOUT: inst60000057: {kind: ValueParamPattern, arg0: inst60000056, arg1: call_param0, type: type(symbolic_constant00000013)} // CHECK:STDOUT: inst60000058: {kind: ImportRefLoaded, arg0: import_ir_inst0000000B, arg1: entity_name, type: type(inst60000047)} -// CHECK:STDOUT: inst60000059: {kind: BindSymbolicName, arg0: entity_name00000004, arg1: inst, type: type(inst60000047)} -// CHECK:STDOUT: inst6000005A: {kind: SymbolicBindingType, arg0: entity_name00000004, arg1: inst60000059, type: type(TypeType)} +// CHECK:STDOUT: inst60000059: {kind: BindSymbolicName, arg0: entity_name60000004, arg1: inst, type: type(inst60000047)} +// CHECK:STDOUT: inst6000005A: {kind: SymbolicBindingType, arg0: entity_name60000004, arg1: inst60000059, type: type(TypeType)} // CHECK:STDOUT: inst6000005B: {kind: PatternType, arg0: inst6000005A, type: type(TypeType)} // CHECK:STDOUT: inst6000005C: {kind: LookupImplWitness, arg0: inst6000001B, arg1: specific_interface60000000, type: type(inst(WitnessType))} // CHECK:STDOUT: inst6000005D: {kind: ImportRefUnloaded, arg0: import_ir_inst0000000F, arg1: entity_name} // CHECK:STDOUT: inst6000005E: {kind: ImplDecl, arg0: impl60000000, arg1: inst_block_empty} -// CHECK:STDOUT: inst6000005F: {kind: BindSymbolicName, arg0: entity_name00000001, arg1: inst, type: type(inst60000047)} -// CHECK:STDOUT: inst60000060: {kind: SymbolicBindingType, arg0: entity_name00000001, arg1: inst6000005F, type: type(TypeType)} +// CHECK:STDOUT: inst6000005F: {kind: BindSymbolicName, arg0: entity_name60000001, arg1: inst, type: type(inst60000047)} +// CHECK:STDOUT: inst60000060: {kind: SymbolicBindingType, arg0: entity_name60000001, arg1: inst6000005F, type: type(TypeType)} // CHECK:STDOUT: inst60000061: {kind: ConstType, arg0: inst60000060, type: type(TypeType)} // CHECK:STDOUT: inst60000062: {kind: PatternType, arg0: inst60000047, type: type(TypeType)} -// CHECK:STDOUT: inst60000063: {kind: SymbolicBindingPattern, arg0: entity_name0000000D, type: type(inst60000062)} +// CHECK:STDOUT: inst60000063: {kind: SymbolicBindingPattern, arg0: entity_name6000000D, type: type(inst60000062)} // CHECK:STDOUT: inst60000064: {kind: ImportRefLoaded, arg0: import_ir_inst00000012, arg1: entity_name, type: type(inst60000047)} // CHECK:STDOUT: inst60000065: {kind: ImportRefLoaded, arg0: import_ir_inst00000013, arg1: entity_name, type: type(TypeType)} // CHECK:STDOUT: inst60000066: {kind: ImportRefLoaded, arg0: import_ir_inst00000014, arg1: entity_name, type: type(TypeType)} // CHECK:STDOUT: inst60000067: {kind: ImportRefUnloaded, arg0: import_ir_inst00000015, arg1: entity_name} // CHECK:STDOUT: inst60000068: {kind: ImplWitnessTable, arg0: inst_block0000001E, arg1: impl60000000} // CHECK:STDOUT: inst60000069: {kind: ImplWitness, arg0: inst60000068, arg1: specific60000002, type: type(inst(WitnessType))} -// CHECK:STDOUT: inst6000006A: {kind: BindSymbolicName, arg0: entity_name00000001, arg1: inst, type: type(inst60000047)} -// CHECK:STDOUT: inst6000006B: {kind: SymbolicBindingType, arg0: entity_name00000001, arg1: inst6000006A, type: type(TypeType)} +// CHECK:STDOUT: inst6000006A: {kind: BindSymbolicName, arg0: entity_name60000001, arg1: inst, type: type(inst60000047)} +// CHECK:STDOUT: inst6000006B: {kind: SymbolicBindingType, arg0: entity_name60000001, arg1: inst6000006A, type: type(TypeType)} // CHECK:STDOUT: inst6000006C: {kind: ConstType, arg0: inst6000006B, type: type(TypeType)} // CHECK:STDOUT: inst6000006D: {kind: ImplWitness, arg0: inst60000068, arg1: specific60000003, type: type(inst(WitnessType))} // CHECK:STDOUT: inst6000006E: {kind: FunctionDecl, arg0: function60000002, arg1: inst_block_empty, type: type(symbolic_constant00000026)} @@ -482,13 +482,13 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: inst60000071: {kind: PatternType, arg0: inst60000061, type: type(TypeType)} // CHECK:STDOUT: inst60000072: {kind: ReturnSlotPattern, arg0: inst, type: type(symbolic_constant0000002B)} // CHECK:STDOUT: inst60000073: {kind: OutParamPattern, arg0: inst60000072, arg1: call_param1, type: type(symbolic_constant0000002B)} -// CHECK:STDOUT: inst60000074: {kind: BindingPattern, arg0: entity_name00000011, type: type(symbolic_constant0000002B)} +// CHECK:STDOUT: inst60000074: {kind: BindingPattern, arg0: entity_name60000011, type: type(symbolic_constant0000002B)} // CHECK:STDOUT: inst60000075: {kind: ValueParamPattern, arg0: inst60000074, arg1: call_param0, type: type(symbolic_constant0000002B)} // CHECK:STDOUT: inst60000076: {kind: ImportRefLoaded, arg0: import_ir_inst00000020, arg1: entity_name, type: type(inst60000047)} // CHECK:STDOUT: inst60000077: {kind: FunctionType, arg0: function60000002, arg1: specific60000003, type: type(TypeType)} // CHECK:STDOUT: inst60000078: {kind: StructValue, arg0: inst_block_empty, type: type(symbolic_constant0000002D)} -// CHECK:STDOUT: inst60000079: {kind: BindSymbolicName, arg0: entity_name00000001, arg1: inst, type: type(inst60000047)} -// CHECK:STDOUT: inst6000007A: {kind: SymbolicBindingType, arg0: entity_name00000001, arg1: inst60000079, type: type(TypeType)} +// CHECK:STDOUT: inst60000079: {kind: BindSymbolicName, arg0: entity_name60000001, arg1: inst, type: type(inst60000047)} +// CHECK:STDOUT: inst6000007A: {kind: SymbolicBindingType, arg0: entity_name60000001, arg1: inst60000079, type: type(TypeType)} // CHECK:STDOUT: inst6000007B: {kind: ConstType, arg0: inst6000007A, type: type(TypeType)} // CHECK:STDOUT: inst6000007C: {kind: PatternType, arg0: inst6000007B, type: type(TypeType)} // CHECK:STDOUT: inst6000007D: {kind: RequireCompleteType, arg0: inst60000061, type: type(inst(WitnessType))} @@ -522,14 +522,14 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: inst60000099: {kind: ImportRefLoaded, arg0: import_ir_inst0000003C, arg1: entity_name, type: type(TypeType)} // CHECK:STDOUT: inst6000009A: {kind: ImportRefLoaded, arg0: import_ir_inst0000003D, arg1: entity_name, type: type(inst(WitnessType))} // CHECK:STDOUT: inst6000009B: {kind: ImplDecl, arg0: impl60000005, arg1: inst_block_empty} -// CHECK:STDOUT: inst6000009C: {kind: SymbolicBindingPattern, arg0: entity_name00000015, type: type(inst60000017)} +// CHECK:STDOUT: inst6000009C: {kind: SymbolicBindingPattern, arg0: entity_name60000015, type: type(inst60000017)} // CHECK:STDOUT: inst6000009D: {kind: ImportRefLoaded, arg0: import_ir_inst00000040, arg1: entity_name, type: type(TypeType)} // CHECK:STDOUT: inst6000009E: {kind: ImportRefLoaded, arg0: import_ir_inst00000041, arg1: entity_name, type: type(TypeType)} // CHECK:STDOUT: inst6000009F: {kind: ImportRefLoaded, arg0: import_ir_inst00000042, arg1: entity_name, type: type(TypeType)} // CHECK:STDOUT: inst600000A0: {kind: ImportRefUnloaded, arg0: import_ir_inst00000043, arg1: entity_name} // CHECK:STDOUT: inst600000A1: {kind: ImplWitnessTable, arg0: inst_block0000002F, arg1: impl60000005} // CHECK:STDOUT: inst600000A2: {kind: ImplWitness, arg0: inst600000A1, arg1: specific60000007, type: type(inst(WitnessType))} -// CHECK:STDOUT: inst600000A3: {kind: BindSymbolicName, arg0: entity_name00000001, arg1: inst, type: type(TypeType)} +// CHECK:STDOUT: inst600000A3: {kind: BindSymbolicName, arg0: entity_name60000001, arg1: inst, type: type(TypeType)} // CHECK:STDOUT: inst600000A4: {kind: PointerType, arg0: inst600000A3, type: type(TypeType)} // CHECK:STDOUT: inst600000A5: {kind: ImplWitness, arg0: inst600000A1, arg1: specific60000008, type: type(inst(WitnessType))} // CHECK:STDOUT: inst600000A6: {kind: FunctionDecl, arg0: function60000003, arg1: inst_block_empty, type: type(symbolic_constant00000051)} @@ -537,13 +537,13 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: inst600000A8: {kind: StructValue, arg0: inst_block_empty, type: type(symbolic_constant00000051)} // CHECK:STDOUT: inst600000A9: {kind: ReturnSlotPattern, arg0: inst, type: type(symbolic_constant00000055)} // CHECK:STDOUT: inst600000AA: {kind: OutParamPattern, arg0: inst600000A9, arg1: call_param1, type: type(symbolic_constant00000055)} -// CHECK:STDOUT: inst600000AB: {kind: BindingPattern, arg0: entity_name00000018, type: type(symbolic_constant00000055)} +// CHECK:STDOUT: inst600000AB: {kind: BindingPattern, arg0: entity_name60000018, type: type(symbolic_constant00000055)} // CHECK:STDOUT: inst600000AC: {kind: ValueParamPattern, arg0: inst600000AB, arg1: call_param0, type: type(symbolic_constant00000055)} // CHECK:STDOUT: inst600000AD: {kind: ImportRefLoaded, arg0: import_ir_inst0000004D, arg1: entity_name, type: type(TypeType)} // CHECK:STDOUT: inst600000AE: {kind: FunctionType, arg0: function60000003, arg1: specific60000008, type: type(TypeType)} // CHECK:STDOUT: inst600000AF: {kind: StructValue, arg0: inst_block_empty, type: type(symbolic_constant00000058)} // CHECK:STDOUT: inst600000B0: {kind: RequireCompleteType, arg0: inst600000A4, type: type(inst(WitnessType))} -// CHECK:STDOUT: inst600000B1: {kind: BindSymbolicName, arg0: entity_name00000001, arg1: inst, type: type(TypeType)} +// CHECK:STDOUT: inst600000B1: {kind: BindSymbolicName, arg0: entity_name60000001, arg1: inst, type: type(TypeType)} // CHECK:STDOUT: inst600000B2: {kind: PointerType, arg0: inst600000B1, type: type(TypeType)} // CHECK:STDOUT: inst600000B3: {kind: PatternType, arg0: inst600000B2, type: type(TypeType)} // CHECK:STDOUT: inst600000B4: {kind: ImportRefUnloaded, arg0: import_ir_inst00000054, arg1: entity_name} @@ -556,11 +556,11 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: inst600000BB: {kind: ImportRefLoaded, arg0: import_ir_inst0000005B, arg1: entity_name, type: type(TypeType)} // CHECK:STDOUT: inst600000BC: {kind: ImportRefUnloaded, arg0: import_ir_inst0000005C, arg1: entity_name} // CHECK:STDOUT: inst600000BD: {kind: ImplDecl, arg0: impl60000008, arg1: inst_block_empty} -// CHECK:STDOUT: inst600000BE: {kind: BindSymbolicName, arg0: entity_name0000001A, arg1: inst, type: type(inst60000047)} -// CHECK:STDOUT: inst600000BF: {kind: SymbolicBindingType, arg0: entity_name0000001A, arg1: inst600000BE, type: type(TypeType)} +// CHECK:STDOUT: inst600000BE: {kind: BindSymbolicName, arg0: entity_name6000001A, arg1: inst, type: type(inst60000047)} +// CHECK:STDOUT: inst600000BF: {kind: SymbolicBindingType, arg0: entity_name6000001A, arg1: inst600000BE, type: type(TypeType)} // CHECK:STDOUT: inst600000C0: {kind: TupleType, arg0: inst_block00000039, type: type(TypeType)} -// CHECK:STDOUT: inst600000C1: {kind: SymbolicBindingPattern, arg0: entity_name0000001C, type: type(inst60000062)} -// CHECK:STDOUT: inst600000C2: {kind: SymbolicBindingPattern, arg0: entity_name0000001D, type: type(inst60000062)} +// CHECK:STDOUT: inst600000C1: {kind: SymbolicBindingPattern, arg0: entity_name6000001C, type: type(inst60000062)} +// CHECK:STDOUT: inst600000C2: {kind: SymbolicBindingPattern, arg0: entity_name6000001D, type: type(inst60000062)} // CHECK:STDOUT: inst600000C3: {kind: ImportRefLoaded, arg0: import_ir_inst00000060, arg1: entity_name, type: type(inst60000047)} // CHECK:STDOUT: inst600000C4: {kind: ImportRefLoaded, arg0: import_ir_inst00000061, arg1: entity_name, type: type(inst60000047)} // CHECK:STDOUT: inst600000C5: {kind: ImportRefLoaded, arg0: import_ir_inst00000062, arg1: entity_name, type: type(TypeType)} @@ -568,10 +568,10 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: inst600000C7: {kind: ImportRefUnloaded, arg0: import_ir_inst00000064, arg1: entity_name} // CHECK:STDOUT: inst600000C8: {kind: ImplWitnessTable, arg0: inst_block0000003C, arg1: impl60000008} // CHECK:STDOUT: inst600000C9: {kind: ImplWitness, arg0: inst600000C8, arg1: specific6000000A, type: type(inst(WitnessType))} -// CHECK:STDOUT: inst600000CA: {kind: BindSymbolicName, arg0: entity_name00000001, arg1: inst, type: type(inst60000047)} -// CHECK:STDOUT: inst600000CB: {kind: BindSymbolicName, arg0: entity_name0000001A, arg1: inst, type: type(inst60000047)} -// CHECK:STDOUT: inst600000CC: {kind: SymbolicBindingType, arg0: entity_name00000001, arg1: inst600000CA, type: type(TypeType)} -// CHECK:STDOUT: inst600000CD: {kind: SymbolicBindingType, arg0: entity_name0000001A, arg1: inst600000CB, type: type(TypeType)} +// CHECK:STDOUT: inst600000CA: {kind: BindSymbolicName, arg0: entity_name60000001, arg1: inst, type: type(inst60000047)} +// CHECK:STDOUT: inst600000CB: {kind: BindSymbolicName, arg0: entity_name6000001A, arg1: inst, type: type(inst60000047)} +// CHECK:STDOUT: inst600000CC: {kind: SymbolicBindingType, arg0: entity_name60000001, arg1: inst600000CA, type: type(TypeType)} +// CHECK:STDOUT: inst600000CD: {kind: SymbolicBindingType, arg0: entity_name6000001A, arg1: inst600000CB, type: type(TypeType)} // CHECK:STDOUT: inst600000CE: {kind: TupleType, arg0: inst_block0000003E, type: type(TypeType)} // CHECK:STDOUT: inst600000CF: {kind: ImplWitness, arg0: inst600000C8, arg1: specific6000000B, type: type(inst(WitnessType))} // CHECK:STDOUT: inst600000D0: {kind: FunctionDecl, arg0: function60000004, arg1: inst_block_empty, type: type(symbolic_constant00000072)} @@ -580,16 +580,16 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: inst600000D3: {kind: PatternType, arg0: inst600000C0, type: type(TypeType)} // CHECK:STDOUT: inst600000D4: {kind: ReturnSlotPattern, arg0: inst, type: type(symbolic_constant00000077)} // CHECK:STDOUT: inst600000D5: {kind: OutParamPattern, arg0: inst600000D4, arg1: call_param1, type: type(symbolic_constant00000077)} -// CHECK:STDOUT: inst600000D6: {kind: BindingPattern, arg0: entity_name00000024, type: type(symbolic_constant00000077)} +// CHECK:STDOUT: inst600000D6: {kind: BindingPattern, arg0: entity_name60000024, type: type(symbolic_constant00000077)} // CHECK:STDOUT: inst600000D7: {kind: ValueParamPattern, arg0: inst600000D6, arg1: call_param0, type: type(symbolic_constant00000077)} // CHECK:STDOUT: inst600000D8: {kind: ImportRefLoaded, arg0: import_ir_inst00000071, arg1: entity_name, type: type(inst60000047)} // CHECK:STDOUT: inst600000D9: {kind: ImportRefLoaded, arg0: import_ir_inst00000072, arg1: entity_name, type: type(inst60000047)} // CHECK:STDOUT: inst600000DA: {kind: FunctionType, arg0: function60000004, arg1: specific6000000B, type: type(TypeType)} // CHECK:STDOUT: inst600000DB: {kind: StructValue, arg0: inst_block_empty, type: type(symbolic_constant00000079)} -// CHECK:STDOUT: inst600000DC: {kind: BindSymbolicName, arg0: entity_name00000001, arg1: inst, type: type(inst60000047)} -// CHECK:STDOUT: inst600000DD: {kind: SymbolicBindingType, arg0: entity_name00000001, arg1: inst600000DC, type: type(TypeType)} -// CHECK:STDOUT: inst600000DE: {kind: BindSymbolicName, arg0: entity_name0000001A, arg1: inst, type: type(inst60000047)} -// CHECK:STDOUT: inst600000DF: {kind: SymbolicBindingType, arg0: entity_name0000001A, arg1: inst600000DE, type: type(TypeType)} +// CHECK:STDOUT: inst600000DC: {kind: BindSymbolicName, arg0: entity_name60000001, arg1: inst, type: type(inst60000047)} +// CHECK:STDOUT: inst600000DD: {kind: SymbolicBindingType, arg0: entity_name60000001, arg1: inst600000DC, type: type(TypeType)} +// CHECK:STDOUT: inst600000DE: {kind: BindSymbolicName, arg0: entity_name6000001A, arg1: inst, type: type(inst60000047)} +// CHECK:STDOUT: inst600000DF: {kind: SymbolicBindingType, arg0: entity_name6000001A, arg1: inst600000DE, type: type(TypeType)} // CHECK:STDOUT: inst600000E0: {kind: TupleType, arg0: inst_block00000046, type: type(TypeType)} // CHECK:STDOUT: inst600000E1: {kind: PatternType, arg0: inst600000E0, type: type(TypeType)} // CHECK:STDOUT: inst600000E2: {kind: RequireCompleteType, arg0: inst600000C0, type: type(inst(WitnessType))} @@ -612,12 +612,12 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: inst600000F3: {kind: PatternType, arg0: inst600000BF, type: type(TypeType)} // CHECK:STDOUT: inst600000F4: {kind: ImportRefUnloaded, arg0: import_ir_inst00000086, arg1: entity_name} // CHECK:STDOUT: inst600000F5: {kind: ImplDecl, arg0: impl60000009, arg1: inst_block_empty} -// CHECK:STDOUT: inst600000F6: {kind: BindSymbolicName, arg0: entity_name00000029, arg1: inst, type: type(inst60000047)} -// CHECK:STDOUT: inst600000F7: {kind: SymbolicBindingType, arg0: entity_name00000029, arg1: inst600000F6, type: type(TypeType)} +// CHECK:STDOUT: inst600000F6: {kind: BindSymbolicName, arg0: entity_name60000029, arg1: inst, type: type(inst60000047)} +// CHECK:STDOUT: inst600000F7: {kind: SymbolicBindingType, arg0: entity_name60000029, arg1: inst600000F6, type: type(TypeType)} // CHECK:STDOUT: inst600000F8: {kind: TupleType, arg0: inst_block0000004F, type: type(TypeType)} -// CHECK:STDOUT: inst600000F9: {kind: SymbolicBindingPattern, arg0: entity_name0000002B, type: type(inst60000062)} -// CHECK:STDOUT: inst600000FA: {kind: SymbolicBindingPattern, arg0: entity_name0000002C, type: type(inst60000062)} -// CHECK:STDOUT: inst600000FB: {kind: SymbolicBindingPattern, arg0: entity_name0000002D, type: type(inst60000062)} +// CHECK:STDOUT: inst600000F9: {kind: SymbolicBindingPattern, arg0: entity_name6000002B, type: type(inst60000062)} +// CHECK:STDOUT: inst600000FA: {kind: SymbolicBindingPattern, arg0: entity_name6000002C, type: type(inst60000062)} +// CHECK:STDOUT: inst600000FB: {kind: SymbolicBindingPattern, arg0: entity_name6000002D, type: type(inst60000062)} // CHECK:STDOUT: inst600000FC: {kind: ImportRefLoaded, arg0: import_ir_inst0000008B, arg1: entity_name, type: type(inst60000047)} // CHECK:STDOUT: inst600000FD: {kind: ImportRefLoaded, arg0: import_ir_inst0000008C, arg1: entity_name, type: type(inst60000047)} // CHECK:STDOUT: inst600000FE: {kind: ImportRefLoaded, arg0: import_ir_inst0000008D, arg1: entity_name, type: type(inst60000047)} @@ -626,12 +626,12 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: inst60000101: {kind: ImportRefUnloaded, arg0: import_ir_inst00000090, arg1: entity_name} // CHECK:STDOUT: inst60000102: {kind: ImplWitnessTable, arg0: inst_block00000052, arg1: impl60000009} // CHECK:STDOUT: inst60000103: {kind: ImplWitness, arg0: inst60000102, arg1: specific60000010, type: type(inst(WitnessType))} -// CHECK:STDOUT: inst60000104: {kind: BindSymbolicName, arg0: entity_name00000001, arg1: inst, type: type(inst60000047)} -// CHECK:STDOUT: inst60000105: {kind: BindSymbolicName, arg0: entity_name0000001A, arg1: inst, type: type(inst60000047)} -// CHECK:STDOUT: inst60000106: {kind: BindSymbolicName, arg0: entity_name00000029, arg1: inst, type: type(inst60000047)} -// CHECK:STDOUT: inst60000107: {kind: SymbolicBindingType, arg0: entity_name00000001, arg1: inst60000104, type: type(TypeType)} -// CHECK:STDOUT: inst60000108: {kind: SymbolicBindingType, arg0: entity_name0000001A, arg1: inst60000105, type: type(TypeType)} -// CHECK:STDOUT: inst60000109: {kind: SymbolicBindingType, arg0: entity_name00000029, arg1: inst60000106, type: type(TypeType)} +// CHECK:STDOUT: inst60000104: {kind: BindSymbolicName, arg0: entity_name60000001, arg1: inst, type: type(inst60000047)} +// CHECK:STDOUT: inst60000105: {kind: BindSymbolicName, arg0: entity_name6000001A, arg1: inst, type: type(inst60000047)} +// CHECK:STDOUT: inst60000106: {kind: BindSymbolicName, arg0: entity_name60000029, arg1: inst, type: type(inst60000047)} +// CHECK:STDOUT: inst60000107: {kind: SymbolicBindingType, arg0: entity_name60000001, arg1: inst60000104, type: type(TypeType)} +// CHECK:STDOUT: inst60000108: {kind: SymbolicBindingType, arg0: entity_name6000001A, arg1: inst60000105, type: type(TypeType)} +// CHECK:STDOUT: inst60000109: {kind: SymbolicBindingType, arg0: entity_name60000029, arg1: inst60000106, type: type(TypeType)} // CHECK:STDOUT: inst6000010A: {kind: TupleType, arg0: inst_block00000054, type: type(TypeType)} // CHECK:STDOUT: inst6000010B: {kind: ImplWitness, arg0: inst60000102, arg1: specific60000011, type: type(inst(WitnessType))} // CHECK:STDOUT: inst6000010C: {kind: FunctionDecl, arg0: function60000005, arg1: inst_block_empty, type: type(symbolic_constant000000BA)} @@ -640,19 +640,19 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: inst6000010F: {kind: PatternType, arg0: inst600000F8, type: type(TypeType)} // CHECK:STDOUT: inst60000110: {kind: ReturnSlotPattern, arg0: inst, type: type(symbolic_constant000000BF)} // CHECK:STDOUT: inst60000111: {kind: OutParamPattern, arg0: inst60000110, arg1: call_param1, type: type(symbolic_constant000000BF)} -// CHECK:STDOUT: inst60000112: {kind: BindingPattern, arg0: entity_name00000037, type: type(symbolic_constant000000BF)} +// CHECK:STDOUT: inst60000112: {kind: BindingPattern, arg0: entity_name60000037, type: type(symbolic_constant000000BF)} // CHECK:STDOUT: inst60000113: {kind: ValueParamPattern, arg0: inst60000112, arg1: call_param0, type: type(symbolic_constant000000BF)} // CHECK:STDOUT: inst60000114: {kind: ImportRefLoaded, arg0: import_ir_inst0000009F, arg1: entity_name, type: type(inst60000047)} // CHECK:STDOUT: inst60000115: {kind: ImportRefLoaded, arg0: import_ir_inst000000A0, arg1: entity_name, type: type(inst60000047)} // CHECK:STDOUT: inst60000116: {kind: ImportRefLoaded, arg0: import_ir_inst000000A1, arg1: entity_name, type: type(inst60000047)} // CHECK:STDOUT: inst60000117: {kind: FunctionType, arg0: function60000005, arg1: specific60000011, type: type(TypeType)} // CHECK:STDOUT: inst60000118: {kind: StructValue, arg0: inst_block_empty, type: type(symbolic_constant000000C1)} -// CHECK:STDOUT: inst60000119: {kind: BindSymbolicName, arg0: entity_name00000001, arg1: inst, type: type(inst60000047)} -// CHECK:STDOUT: inst6000011A: {kind: SymbolicBindingType, arg0: entity_name00000001, arg1: inst60000119, type: type(TypeType)} -// CHECK:STDOUT: inst6000011B: {kind: BindSymbolicName, arg0: entity_name0000001A, arg1: inst, type: type(inst60000047)} -// CHECK:STDOUT: inst6000011C: {kind: SymbolicBindingType, arg0: entity_name0000001A, arg1: inst6000011B, type: type(TypeType)} -// CHECK:STDOUT: inst6000011D: {kind: BindSymbolicName, arg0: entity_name00000029, arg1: inst, type: type(inst60000047)} -// CHECK:STDOUT: inst6000011E: {kind: SymbolicBindingType, arg0: entity_name00000029, arg1: inst6000011D, type: type(TypeType)} +// CHECK:STDOUT: inst60000119: {kind: BindSymbolicName, arg0: entity_name60000001, arg1: inst, type: type(inst60000047)} +// CHECK:STDOUT: inst6000011A: {kind: SymbolicBindingType, arg0: entity_name60000001, arg1: inst60000119, type: type(TypeType)} +// CHECK:STDOUT: inst6000011B: {kind: BindSymbolicName, arg0: entity_name6000001A, arg1: inst, type: type(inst60000047)} +// CHECK:STDOUT: inst6000011C: {kind: SymbolicBindingType, arg0: entity_name6000001A, arg1: inst6000011B, type: type(TypeType)} +// CHECK:STDOUT: inst6000011D: {kind: BindSymbolicName, arg0: entity_name60000029, arg1: inst, type: type(inst60000047)} +// CHECK:STDOUT: inst6000011E: {kind: SymbolicBindingType, arg0: entity_name60000029, arg1: inst6000011D, type: type(TypeType)} // CHECK:STDOUT: inst6000011F: {kind: TupleType, arg0: inst_block0000005C, type: type(TypeType)} // CHECK:STDOUT: inst60000120: {kind: PatternType, arg0: inst6000011F, type: type(TypeType)} // CHECK:STDOUT: inst60000121: {kind: RequireCompleteType, arg0: inst600000F8, type: type(inst(WitnessType))} diff --git a/toolchain/check/testdata/basics/raw_sem_ir/one_file_with_textual_ir.carbon b/toolchain/check/testdata/basics/raw_sem_ir/one_file_with_textual_ir.carbon index d62801c31282..a60e300d1c38 100644 --- a/toolchain/check/testdata/basics/raw_sem_ir/one_file_with_textual_ir.carbon +++ b/toolchain/check/testdata/basics/raw_sem_ir/one_file_with_textual_ir.carbon @@ -28,7 +28,7 @@ fn Foo(n: ()) -> ((), ()) { // CHECK:STDOUT: name_scopes: // CHECK:STDOUT: name_scope00000000: {inst: inst0000000E, parent_scope: name_scope, has_error: false, extended_scopes: [], names: {name00000000: inst60000025}} // CHECK:STDOUT: entity_names: -// CHECK:STDOUT: entity_name00000000: {name: name00000001, parent_scope: name_scope, index: -1, is_template: 0} +// CHECK:STDOUT: entity_name60000000: {name: name00000001, parent_scope: name_scope, index: -1, is_template: 0} // CHECK:STDOUT: cpp_global_vars: {} // CHECK:STDOUT: functions: // CHECK:STDOUT: function60000000: {name: name00000000, parent_scope: name_scope00000000, call_params_id: inst_block00000009, return_slot_pattern: inst60000020, body: [inst_block0000000C]} @@ -57,9 +57,9 @@ fn Foo(n: ()) -> ((), ()) { // CHECK:STDOUT: inst6000000F: {kind: TupleType, arg0: inst_block_empty, type: type(TypeType)} // CHECK:STDOUT: inst60000010: {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst6000000F)} // CHECK:STDOUT: inst60000011: {kind: Converted, arg0: inst60000010, arg1: inst6000000F, type: type(TypeType)} -// CHECK:STDOUT: inst60000012: {kind: BindName, arg0: entity_name00000000, arg1: inst60000021, type: type(inst6000000F)} +// CHECK:STDOUT: inst60000012: {kind: BindName, arg0: entity_name60000000, arg1: inst60000021, type: type(inst6000000F)} // CHECK:STDOUT: inst60000013: {kind: PatternType, arg0: inst6000000F, type: type(TypeType)} -// CHECK:STDOUT: inst60000014: {kind: BindingPattern, arg0: entity_name00000000, type: type(inst60000013)} +// CHECK:STDOUT: inst60000014: {kind: BindingPattern, arg0: entity_name60000000, type: type(inst60000013)} // CHECK:STDOUT: inst60000015: {kind: ValueParamPattern, arg0: inst60000014, arg1: call_param0, type: type(inst60000013)} // CHECK:STDOUT: inst60000016: {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst6000000F)} // CHECK:STDOUT: inst60000017: {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst6000000F)} diff --git a/toolchain/sem_ir/entity_name.h b/toolchain/sem_ir/entity_name.h index e4f71c8cc953..404ce3da919a 100644 --- a/toolchain/sem_ir/entity_name.h +++ b/toolchain/sem_ir/entity_name.h @@ -62,6 +62,8 @@ struct EntityName : public Printable { // functionality, this can provide optional canonical IDs for EntityNames. struct EntityNameStore : public ValueStore { public: + using ValueStore::ValueStore; + // Adds an entity name for a symbolic binding. auto AddSymbolicBindingName(NameId name_id, NameScopeId parent_scope_id, CompileTimeBindIndex bind_index, bool is_template) diff --git a/toolchain/sem_ir/file.cpp b/toolchain/sem_ir/file.cpp index f7a33772be84..14d0d023f73d 100644 --- a/toolchain/sem_ir/file.cpp +++ b/toolchain/sem_ir/file.cpp @@ -35,6 +35,7 @@ File::File(const Parse::Tree* parse_tree, CheckIRId check_ir_id, : LibraryNameId::Default), value_stores_(&value_stores), filename_(std::move(filename)), + entity_names_(check_ir_id), functions_(check_ir_id), cpp_overload_sets_(check_ir_id), classes_(check_ir_id),