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:
@@ -8,6 +8,10 @@ fn F();
|
||||
|
||||
fn G() { F(); }
|
||||
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %.loc9: type = tuple_type ()
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file "simple.carbon" {
|
||||
// CHECK:STDOUT: %F: <function> = fn_decl @F
|
||||
// CHECK:STDOUT: %G: <function> = fn_decl @G
|
||||
@@ -18,7 +22,6 @@ fn G() { F(); }
|
||||
// CHECK:STDOUT: fn @G() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %F.ref: <function> = name_reference "F", file.%F
|
||||
// CHECK:STDOUT: %.loc9_11.1: type = tuple_type ()
|
||||
// CHECK:STDOUT: %.loc9_11.2: init () = call %F.ref()
|
||||
// CHECK:STDOUT: %.loc9: init () = call %F.ref()
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
Reference in New Issue
Block a user