mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 20:51:16 +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:
+2
-1
@@ -17,6 +17,7 @@ fn F(b: bool, n: i32, m: i32) -> i32 {
|
||||
// CHECK:STDOUT: %.3: type = ptr_type [i32; 1] [template]
|
||||
// CHECK:STDOUT: %.4: i32 = int_literal 0 [template]
|
||||
// CHECK:STDOUT: %.5: type = tuple_type (i32) [template]
|
||||
// CHECK:STDOUT: %.6: i32 = int_literal 0 [template]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
@@ -32,7 +33,7 @@ fn F(b: bool, n: i32, m: i32) -> i32 {
|
||||
// CHECK:STDOUT: %x: ref [i32; 1] = bind_name x, %x.var
|
||||
// CHECK:STDOUT: %.loc8_22: i32 = int_literal 0 [template = constants.%.4]
|
||||
// CHECK:STDOUT: %.loc8_24.1: (i32,) = tuple_literal (%.loc8_22)
|
||||
// CHECK:STDOUT: %.loc8_24.2: i32 = int_literal 0
|
||||
// CHECK:STDOUT: %.loc8_24.2: i32 = int_literal 0 [template = constants.%.6]
|
||||
// CHECK:STDOUT: %.loc8_24.3: ref i32 = array_index %x.var, %.loc8_24.2
|
||||
// CHECK:STDOUT: %.loc8_24.4: init i32 = initialize_from %.loc8_22 to %.loc8_24.3
|
||||
// CHECK:STDOUT: %.loc8_24.5: init [i32; 1] = array_init (%.loc8_24.4) to %x.var
|
||||
|
||||
Reference in New Issue
Block a user