mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 09:11:04 +01:00
Ensure we evaluate instructions created in uncommon ways. (#3598)
Instructions created by splices during conversion are now evaluated, as are instructions created in cases where we first create a placeholder instruction and later replace it by a different instruction. This also removes the ability to set a parse node and instruction independently after creating an `InstId`, which could lead to them accidentally not matching.
This commit is contained in:
+6
-3
@@ -23,6 +23,9 @@ fn G() -> i32 {
|
||||
// CHECK:STDOUT: %.6: i32 = int_literal 3 [template]
|
||||
// CHECK:STDOUT: %.7: type = tuple_type (i32, i32, i32) [template]
|
||||
// CHECK:STDOUT: %.8: i32 = int_literal 1 [template]
|
||||
// CHECK:STDOUT: %.9: i32 = int_literal 0 [template]
|
||||
// CHECK:STDOUT: %.10: i32 = int_literal 1 [template]
|
||||
// CHECK:STDOUT: %.11: i32 = int_literal 2 [template]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
@@ -50,13 +53,13 @@ fn G() -> i32 {
|
||||
// CHECK:STDOUT: %.loc12_20.1: (i32, i32, i32) = tuple_literal (%.loc12_13, %.loc12_16, %.loc12_19)
|
||||
// CHECK:STDOUT: %.loc12_23: i32 = int_literal 1 [template = constants.%.8]
|
||||
// CHECK:STDOUT: %.loc12_20.2: ref [i32; 3] = temporary_storage
|
||||
// CHECK:STDOUT: %.loc12_20.3: i32 = int_literal 0
|
||||
// CHECK:STDOUT: %.loc12_20.3: i32 = int_literal 0 [template = constants.%.9]
|
||||
// CHECK:STDOUT: %.loc12_20.4: ref i32 = array_index %.loc12_20.2, %.loc12_20.3
|
||||
// CHECK:STDOUT: %.loc12_20.5: init i32 = initialize_from %.loc12_13 to %.loc12_20.4
|
||||
// CHECK:STDOUT: %.loc12_20.6: i32 = int_literal 1
|
||||
// CHECK:STDOUT: %.loc12_20.6: i32 = int_literal 1 [template = constants.%.10]
|
||||
// CHECK:STDOUT: %.loc12_20.7: ref i32 = array_index %.loc12_20.2, %.loc12_20.6
|
||||
// CHECK:STDOUT: %.loc12_20.8: init i32 = initialize_from %.loc12_16 to %.loc12_20.7
|
||||
// CHECK:STDOUT: %.loc12_20.9: i32 = int_literal 2
|
||||
// CHECK:STDOUT: %.loc12_20.9: i32 = int_literal 2 [template = constants.%.11]
|
||||
// CHECK:STDOUT: %.loc12_20.10: ref i32 = array_index %.loc12_20.2, %.loc12_20.9
|
||||
// CHECK:STDOUT: %.loc12_20.11: init i32 = initialize_from %.loc12_19 to %.loc12_20.10
|
||||
// CHECK:STDOUT: %.loc12_20.12: init [i32; 3] = array_init (%.loc12_20.5, %.loc12_20.8, %.loc12_20.11) to %.loc12_20.2
|
||||
|
||||
Reference in New Issue
Block a user