mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Initial scaffolding for building a witness table for an impl. (#3743)
Add an instruction to hold the witness table, along with a corresponding
type to keep things simpler. Add `check/impl.{h,cpp}` to house the new
logic. No checking of impls against interfaces is performed yet.
---------
Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
This commit is contained in:
co-authored by
Jon Ross-Perkins
parent
2424ea16ea
commit
abf23ae7fe
+3
@@ -18,6 +18,7 @@ impl i32 as Simple {
|
||||
// CHECK:STDOUT: %.1: type = interface_type @Simple [template]
|
||||
// CHECK:STDOUT: %.2: type = assoc_entity_type @Simple, <function> [template]
|
||||
// CHECK:STDOUT: %.3: <associated <function> in Simple> = assoc_entity element0, @Simple.%F [template]
|
||||
// CHECK:STDOUT: %.4: <witness> = interface_witness @Simple, () [template]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
@@ -43,9 +44,11 @@ impl i32 as Simple {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: impl @impl: i32 as Simple {
|
||||
// CHECK:STDOUT: %F: <function> = fn_decl @F.2 [template] {}
|
||||
// CHECK:STDOUT: %.1: <witness> = interface_witness @Simple, () [template = constants.%.4]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .F = %F
|
||||
// CHECK:STDOUT: witness = %.1
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F.1();
|
||||
|
||||
Reference in New Issue
Block a user