mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Add a separate store for computed constant values. (#3362)
This moves the instructions generated for type values out of the block in which they happen to first be referenced, and into shared storage.
This commit is contained in:
@@ -19,6 +19,11 @@ fn Deref(n: i32) {
|
||||
*{};
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %.loc15: type = tuple_type ()
|
||||
// CHECK:STDOUT: %.loc19: type = struct_type {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file "fail_dereference_not_pointer.carbon" {
|
||||
// CHECK:STDOUT: %Deref: <function> = fn_decl @Deref
|
||||
// CHECK:STDOUT: }
|
||||
@@ -27,13 +32,11 @@ fn Deref(n: i32) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %n.ref: i32 = name_reference "n", %n
|
||||
// CHECK:STDOUT: %.loc11: ref <error> = dereference %n.ref
|
||||
// CHECK:STDOUT: %.loc15_5.1: type = tuple_type ()
|
||||
// CHECK:STDOUT: %.loc15_5.2: () = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc15_5.3: () = tuple_value %.loc15_5.2, ()
|
||||
// CHECK:STDOUT: %.loc15_3: ref <error> = dereference %.loc15_5.3
|
||||
// CHECK:STDOUT: %.loc19_5.1: type = struct_type {}
|
||||
// CHECK:STDOUT: %.loc19_5.2: {} = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc19_5.3: {} = struct_value %.loc19_5.2, ()
|
||||
// CHECK:STDOUT: %.loc19_3: ref <error> = dereference %.loc19_5.3
|
||||
// CHECK:STDOUT: %.loc15_5.1: () = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc15_5.2: () = tuple_value %.loc15_5.1, ()
|
||||
// CHECK:STDOUT: %.loc15_3: ref <error> = dereference %.loc15_5.2
|
||||
// CHECK:STDOUT: %.loc19_5.1: {} = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc19_5.2: {} = struct_value %.loc19_5.1, ()
|
||||
// CHECK:STDOUT: %.loc19_3: ref <error> = dereference %.loc19_5.2
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
Reference in New Issue
Block a user