Include the complete type witness for a class in its SemIR output. (#4599)

This seems slightly redundant for a locally-defined class, where there
will be a complete_type_witness instruction earlier in the class, but is
important for imported classes, where we're currently doing the wrong
thing in a way that's invisible in formatted SemIR.
This commit is contained in:
Richard Smith
2024-11-27 23:45:20 +00:00
committed by GitHub
parent d6ec885eb3
commit 4a10d29b99
225 changed files with 955 additions and 0 deletions
@@ -199,6 +199,7 @@ extern library "basic" fn F();
// CHECK:STDOUT: .Self = constants.%C
// CHECK:STDOUT: .F = %F.decl
// CHECK:STDOUT: .G = %G.decl
// CHECK:STDOUT: complete_type_witness = %.loc15
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F();
@@ -157,6 +157,7 @@ fn CallFAndGIncomplete() {
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = constants.%D
// CHECK:STDOUT: complete_type_witness = %.loc37
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @ReturnCUnused() -> %C;
@@ -189,6 +190,8 @@ fn CallFAndGIncomplete() {
// CHECK:STDOUT: %ReturnDUnused.type: type = fn_type @ReturnDUnused [template]
// CHECK:STDOUT: %ReturnDUnused: %ReturnDUnused.type = struct_value () [template]
// CHECK:STDOUT: %D: type = class_type @D [template]
// CHECK:STDOUT: %.1: type = struct_type {} [template]
// CHECK:STDOUT: %.2: <witness> = complete_type_witness %.1 [template]
// CHECK:STDOUT: %ReturnDUsed.type: type = fn_type @ReturnDUsed [template]
// CHECK:STDOUT: %ReturnDUsed: %ReturnDUsed.type = struct_value () [template]
// CHECK:STDOUT: }
@@ -224,6 +227,7 @@ fn CallFAndGIncomplete() {
// CHECK:STDOUT: class @D {
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = imports.%import_ref.8
// CHECK:STDOUT: complete_type_witness = constants.%.2
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @CallFAndGIncomplete() {