Skip to content

Commit b2cfcd0

Browse files
committed
Add unit tagging to InterfaceId
1 parent b09dbcc commit b2cfcd0

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

toolchain/check/testdata/basics/raw_sem_ir/one_file.carbon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,13 +436,13 @@ fn Foo[T:! type](p: T*) -> (T*, ()) {
436436
// CHECK:STDOUT: inst60000043: {kind: TupleAccess, arg0: inst60000034, arg1: element0, type: type(symbolic_constant00000004)}
437437
// CHECK:STDOUT: inst60000044: {kind: RequireCompleteType, arg0: inst6000001B, type: type(inst(WitnessType))}
438438
// CHECK:STDOUT: inst60000045: {kind: ImportRefLoaded, arg0: import_ir_inst00000000, arg1: entity_name00000003, type: type(TypeType)}
439-
// CHECK:STDOUT: inst60000046: {kind: InterfaceDecl, arg0: interface00000000, arg1: inst_block_empty, type: type(TypeType)}
439+
// CHECK:STDOUT: inst60000046: {kind: InterfaceDecl, arg0: interface60000000, arg1: inst_block_empty, type: type(TypeType)}
440440
// CHECK:STDOUT: inst60000047: {kind: FacetType, arg0: facet_type00000001, type: type(TypeType)}
441441
// CHECK:STDOUT: inst60000048: {kind: BindSymbolicName, arg0: entity_name00000004, arg1: inst<none>, type: type(inst60000047)}
442442
// CHECK:STDOUT: inst60000049: {kind: ImportRefUnloaded, arg0: import_ir_inst00000002, arg1: entity_name<none>}
443443
// CHECK:STDOUT: inst6000004A: {kind: ImportRefLoaded, arg0: import_ir_inst00000003, arg1: entity_name<none>, type: type(inst6000004C)}
444444
// CHECK:STDOUT: inst6000004B: {kind: ImportRefUnloaded, arg0: import_ir_inst00000004, arg1: entity_name00000005}
445-
// CHECK:STDOUT: inst6000004C: {kind: AssociatedEntityType, arg0: interface00000000, arg1: specific<none>, type: type(TypeType)}
445+
// CHECK:STDOUT: inst6000004C: {kind: AssociatedEntityType, arg0: interface60000000, arg1: specific<none>, type: type(TypeType)}
446446
// CHECK:STDOUT: inst6000004D: {kind: ImportRefLoaded, arg0: import_ir_inst00000005, arg1: entity_name<none>, type: type(inst60000050)}
447447
// CHECK:STDOUT: inst6000004E: {kind: AssociatedEntity, arg0: element0, arg1: inst6000004D, type: type(inst6000004C)}
448448
// CHECK:STDOUT: inst6000004F: {kind: FunctionDecl, arg0: function60000001, arg1: inst_block_empty, type: type(inst60000050)}

toolchain/sem_ir/file.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ File::File(const Parse::Tree* parse_tree, CheckIRId check_ir_id,
3838
functions_(check_ir_id),
3939
cpp_overload_sets_(check_ir_id),
4040
classes_(check_ir_id),
41+
interfaces_(check_ir_id),
4142
associated_constants_(check_ir_id),
4243
impls_(*this),
4344
specific_interfaces_(check_ir_id_),

toolchain/sem_ir/inst_namer.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ class InstNamer {
6565
index = sem_ir_->specific_interfaces().GetRawIndex(id);
6666
} else if constexpr (std::is_same_v<IdT, VtableId>) {
6767
index = sem_ir_->vtables().GetRawIndex(id);
68+
} else if constexpr (std::is_same_v<IdT, InterfaceId>) {
69+
index = sem_ir_->interfaces().GetRawIndex(id);
6870
}
6971
return static_cast<ScopeId>(GetScopeIdOffset(ScopeIdTypeEnum::For<IdT>) +
7072
index);

0 commit comments

Comments
 (0)