Rename IntLiteral to IntValue. (#4475)

This instruction represents integer values, whether they come from
literals or calculations, so it the old name is inaccurate. I also plan
to rename `BigInt` to `IntLiteral` based on recent discussion and this
change aims to avoid confusion stemming from the same name being used
for two different things.

I'm not renaming `FloatLiteral` because recent discussion suggests we
may want distinct `FloatLiteral` versus `FloatValue` representations in
SemIR.
This commit is contained in:
Richard Smith
2024-11-02 01:19:39 +00:00
committed by GitHub
parent 261fe38508
commit db76e81630
250 changed files with 1933 additions and 1935 deletions
@@ -18,7 +18,7 @@ var x: {} = {.a = 1};
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %.1: type = struct_type {} [template]
// CHECK:STDOUT: %.2: type = tuple_type () [template]
// CHECK:STDOUT: %.3: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.3: i32 = int_value 1 [template]
// CHECK:STDOUT: %.4: type = struct_type {.a: i32} [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -43,7 +43,7 @@ var x: {} = {.a = 1};
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %.loc14_19: i32 = int_literal 1 [template = constants.%.3]
// CHECK:STDOUT: %.loc14_19: i32 = int_value 1 [template = constants.%.3]
// CHECK:STDOUT: %.loc14_20: %.4 = struct_literal (%.loc14_19)
// CHECK:STDOUT: assign file.%x.var, <error>
// CHECK:STDOUT: return
+11 -11
View File
@@ -60,13 +60,13 @@ var y: {.b: i32, .c: i32} = {.b = 3, .b = 4};
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
// CHECK:STDOUT: %F.type: type = fn_type @F [template]
// CHECK:STDOUT: %F: %F.type = struct_value () [template]
// CHECK:STDOUT: %.2: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.2: i32 = int_value 1 [template]
// CHECK:STDOUT: %.3: type = struct_type {.a: i32} [template]
// CHECK:STDOUT: %.4: i32 = int_literal 2 [template]
// CHECK:STDOUT: %.4: i32 = int_value 2 [template]
// CHECK:STDOUT: %.5: type = struct_type {.b: i32, .c: i32} [template]
// CHECK:STDOUT: %.6: type = ptr_type %.5 [template]
// CHECK:STDOUT: %.7: i32 = int_literal 3 [template]
// CHECK:STDOUT: %.8: i32 = int_literal 4 [template]
// CHECK:STDOUT: %.7: i32 = int_value 3 [template]
// CHECK:STDOUT: %.8: i32 = int_value 4 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -142,17 +142,17 @@ var y: {.b: i32, .c: i32} = {.b = 3, .b = 4};
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %.loc27_35: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %.loc27_35: i32 = int_value 1 [template = constants.%.2]
// CHECK:STDOUT: %.loc27_36: %.3 = struct_literal (%.loc27_35)
// CHECK:STDOUT: %v: <error> = bind_name v, <error>
// CHECK:STDOUT: %.loc36_22: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %.loc36_32: i32 = int_literal 2 [template = constants.%.4]
// CHECK:STDOUT: %.loc36_22: i32 = int_value 1 [template = constants.%.2]
// CHECK:STDOUT: %.loc36_32: i32 = int_value 2 [template = constants.%.4]
// CHECK:STDOUT: %w: i32 = bind_name w, <error>
// CHECK:STDOUT: %.loc45_26: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %.loc45_34: i32 = int_literal 2 [template = constants.%.4]
// CHECK:STDOUT: %.loc45_26: i32 = int_value 1 [template = constants.%.2]
// CHECK:STDOUT: %.loc45_34: i32 = int_value 2 [template = constants.%.4]
// CHECK:STDOUT: assign file.%x.var, <error>
// CHECK:STDOUT: %.loc53_35: i32 = int_literal 3 [template = constants.%.7]
// CHECK:STDOUT: %.loc53_43: i32 = int_literal 4 [template = constants.%.8]
// CHECK:STDOUT: %.loc53_35: i32 = int_value 3 [template = constants.%.7]
// CHECK:STDOUT: %.loc53_43: i32 = int_value 4 [template = constants.%.8]
// CHECK:STDOUT: assign file.%y.var, <error>
// CHECK:STDOUT: return
// CHECK:STDOUT: }
@@ -26,7 +26,7 @@ var y: {.b: i32} = x;
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
// CHECK:STDOUT: %.2: type = struct_type {.a: i32} [template]
// CHECK:STDOUT: %.3: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.3: i32 = int_value 1 [template]
// CHECK:STDOUT: %.4: type = struct_type {.b: i32} [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -64,7 +64,7 @@ var y: {.b: i32} = x;
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %.loc15_26: i32 = int_literal 1 [template = constants.%.3]
// CHECK:STDOUT: %.loc15_26: i32 = int_value 1 [template = constants.%.3]
// CHECK:STDOUT: %.loc15_27: %.4 = struct_literal (%.loc15_26)
// CHECK:STDOUT: assign file.%x.var, <error>
// CHECK:STDOUT: %x.ref: ref %.2 = name_ref x, file.%x
@@ -17,7 +17,7 @@ var y: i32 = x.b;
// CHECK:STDOUT: --- fail_member_access_type.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %.1: Core.BigInt = int_literal 64 [template]
// CHECK:STDOUT: %.1: Core.BigInt = int_value 64 [template]
// CHECK:STDOUT: %Float.type: type = fn_type @Float [template]
// CHECK:STDOUT: %.2: type = tuple_type () [template]
// CHECK:STDOUT: %Float: %Float.type = struct_value () [template]
@@ -46,7 +46,7 @@ var y: i32 = x.b;
// CHECK:STDOUT: .y = %y
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %.loc11_13.1: Core.BigInt = int_literal 64 [template = constants.%.1]
// CHECK:STDOUT: %.loc11_13.1: Core.BigInt = int_value 64 [template = constants.%.1]
// CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%.loc11_13.1) [template = f64]
// CHECK:STDOUT: %.loc11_13.2: type = value_of_initializer %float.make_type [template = f64]
// CHECK:STDOUT: %.loc11_13.3: type = converted %float.make_type, %.loc11_13.2 [template = f64]
@@ -21,7 +21,7 @@ var y: i32 = x.b;
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
// CHECK:STDOUT: %.2: type = struct_type {.a: i32} [template]
// CHECK:STDOUT: %.3: i32 = int_literal 4 [template]
// CHECK:STDOUT: %.3: i32 = int_value 4 [template]
// CHECK:STDOUT: %struct: %.2 = struct_value (%.3) [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -58,7 +58,7 @@ var y: i32 = x.b;
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %.loc11_26: i32 = int_literal 4 [template = constants.%.3]
// CHECK:STDOUT: %.loc11_26: i32 = int_value 4 [template = constants.%.3]
// CHECK:STDOUT: %.loc11_27.1: %.2 = struct_literal (%.loc11_26)
// CHECK:STDOUT: %.loc11_27.2: init %.2 = struct_init (%.loc11_26) to file.%x.var [template = constants.%struct]
// CHECK:STDOUT: %.loc11_28: init %.2 = converted %.loc11_27.1, %.loc11_27.2 [template = constants.%struct]
+2 -2
View File
@@ -21,7 +21,7 @@ var x: {.a: i32, .b: i32} = {.a = 1};
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
// CHECK:STDOUT: %.2: type = struct_type {.a: i32, .b: i32} [template]
// CHECK:STDOUT: %.3: type = ptr_type %.2 [template]
// CHECK:STDOUT: %.4: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.4: i32 = int_value 1 [template]
// CHECK:STDOUT: %.5: type = struct_type {.a: i32} [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -55,7 +55,7 @@ var x: {.a: i32, .b: i32} = {.a = 1};
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %.loc14_35: i32 = int_literal 1 [template = constants.%.4]
// CHECK:STDOUT: %.loc14_35: i32 = int_value 1 [template = constants.%.4]
// CHECK:STDOUT: %.loc14_36: %.5 = struct_literal (%.loc14_35)
// CHECK:STDOUT: assign file.%x.var, <error>
// CHECK:STDOUT: return
+2 -2
View File
@@ -19,7 +19,7 @@ var x: {.a = 1};
// CHECK:STDOUT: --- fail_value_as_type.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %.1: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.1: i32 = int_value 1 [template]
// CHECK:STDOUT: %.2: type = struct_type {.a: i32} [template]
// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template]
// CHECK:STDOUT: %.3: type = tuple_type () [template]
@@ -62,7 +62,7 @@ var x: {.a = 1};
// CHECK:STDOUT: .x = %x
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %.loc17_14: i32 = int_literal 1 [template = constants.%.1]
// CHECK:STDOUT: %.loc17_14: i32 = int_value 1 [template = constants.%.1]
// CHECK:STDOUT: %.loc17_15.1: %.2 = struct_literal (%.loc17_14)
// CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(type) [template = constants.%ImplicitAs.type.3]
// CHECK:STDOUT: %.loc17_15.2: %.6 = specific_constant imports.%import_ref.3, @ImplicitAs(type) [template = constants.%.7]
+23 -23
View File
@@ -58,7 +58,7 @@ var c_bad: C({.a = 3, .b = 4}) = F();
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
// CHECK:STDOUT: %.2: type = struct_type {.a: i32} [template]
// CHECK:STDOUT: %.3: i32 = int_literal 0 [template]
// CHECK:STDOUT: %.3: i32 = int_value 0 [template]
// CHECK:STDOUT: %struct.1: %.2 = struct_value (%.3) [template]
// CHECK:STDOUT: %.4: type = tuple_type (type) [template]
// CHECK:STDOUT: %.5: type = tuple_type (i32) [template]
@@ -78,8 +78,8 @@ var c_bad: C({.a = 3, .b = 4}) = F();
// CHECK:STDOUT: %C.2: type = class_type @C, @C(%S) [symbolic]
// CHECK:STDOUT: %.12: type = struct_type {} [template]
// CHECK:STDOUT: %.13: <witness> = complete_type_witness %.12 [template]
// CHECK:STDOUT: %.14: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.15: i32 = int_literal 2 [template]
// CHECK:STDOUT: %.14: i32 = int_value 1 [template]
// CHECK:STDOUT: %.15: i32 = int_value 2 [template]
// CHECK:STDOUT: %.16: type = ptr_type %.11 [template]
// CHECK:STDOUT: %struct.4: %.11 = struct_value (%.14, %.15) [template]
// CHECK:STDOUT: %C.3: type = class_type @C, @C(%struct.4) [template]
@@ -145,8 +145,8 @@ var c_bad: C({.a = 3, .b = 4}) = F();
// CHECK:STDOUT: %return.param_patt: %C.3 = out_param_pattern %return.patt, runtime_param0
// CHECK:STDOUT: } {
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.1]
// CHECK:STDOUT: %.loc9_19: i32 = int_literal 1 [template = constants.%.14]
// CHECK:STDOUT: %.loc9_27: i32 = int_literal 2 [template = constants.%.15]
// CHECK:STDOUT: %.loc9_19: i32 = int_value 1 [template = constants.%.14]
// CHECK:STDOUT: %.loc9_27: i32 = int_value 2 [template = constants.%.15]
// CHECK:STDOUT: %.loc9_28: %.11 = struct_literal (%.loc9_19, %.loc9_27)
// CHECK:STDOUT: %struct: %.11 = struct_value (%.loc9_19, %.loc9_27) [template = constants.%struct.4]
// CHECK:STDOUT: %.loc9_12: %.11 = converted %.loc9_28, %struct [template = constants.%struct.4]
@@ -176,16 +176,16 @@ var c_bad: C({.a = 3, .b = 4}) = F();
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %.loc4_30: i32 = int_literal 0 [template = constants.%.3]
// CHECK:STDOUT: %.loc4_30: i32 = int_value 0 [template = constants.%.3]
// CHECK:STDOUT: %.loc4_31.1: %.2 = struct_literal (%.loc4_30)
// CHECK:STDOUT: %.loc4_31.2: init %.2 = struct_init (%.loc4_30) to file.%a_ref.var [template = constants.%struct.1]
// CHECK:STDOUT: %.loc4_32: init %.2 = converted %.loc4_31.1, %.loc4_31.2 [template = constants.%struct.1]
// CHECK:STDOUT: assign file.%a_ref.var, %.loc4_32
// CHECK:STDOUT: %.loc6_17: i32 = int_literal 0 [template = constants.%.3]
// CHECK:STDOUT: %.loc6_26: i32 = int_literal 0 [template = constants.%.3]
// CHECK:STDOUT: %.loc6_17: i32 = int_value 0 [template = constants.%.3]
// CHECK:STDOUT: %.loc6_26: i32 = int_value 0 [template = constants.%.3]
// CHECK:STDOUT: %.loc6_28.1: %.5 = tuple_literal (%.loc6_26)
// CHECK:STDOUT: %.loc6_29.1: %.6 = struct_literal (%.loc6_17, %.loc6_28.1)
// CHECK:STDOUT: %.loc6_37: i32 = int_literal 0 [template = constants.%.3]
// CHECK:STDOUT: %.loc6_37: i32 = int_value 0 [template = constants.%.3]
// CHECK:STDOUT: %.loc6_38.1: %.7 = struct_literal (%.loc6_29.1, %.loc6_37)
// CHECK:STDOUT: %.loc6_38.2: ref %.6 = struct_access file.%b_ref.var, element0
// CHECK:STDOUT: %.loc6_29.2: ref i32 = struct_access %.loc6_38.2, element0
@@ -236,8 +236,8 @@ var c_bad: C({.a = 3, .b = 4}) = F();
// CHECK:STDOUT: %S: %.12 = bind_symbolic_name S, 0 [symbolic]
// CHECK:STDOUT: %C.2: type = class_type @C, @C(%S) [symbolic]
// CHECK:STDOUT: %S.patt: %.12 = symbolic_binding_pattern S, 0 [symbolic]
// CHECK:STDOUT: %.13: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.14: i32 = int_literal 2 [template]
// CHECK:STDOUT: %.13: i32 = int_value 1 [template]
// CHECK:STDOUT: %.14: i32 = int_value 2 [template]
// CHECK:STDOUT: %.15: type = ptr_type %.12 [template]
// CHECK:STDOUT: %struct: %.12 = struct_value (%.13, %.14) [template]
// CHECK:STDOUT: %C.3: type = class_type @C, @C(%struct) [template]
@@ -296,8 +296,8 @@ var c_bad: C({.a = 3, .b = 4}) = F();
// CHECK:STDOUT: %b.var: ref %.6 = var b
// CHECK:STDOUT: %b: ref %.6 = bind_name b, %b.var
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C.1]
// CHECK:STDOUT: %.loc6_16: i32 = int_literal 1 [template = constants.%.13]
// CHECK:STDOUT: %.loc6_24: i32 = int_literal 2 [template = constants.%.14]
// CHECK:STDOUT: %.loc6_16: i32 = int_value 1 [template = constants.%.13]
// CHECK:STDOUT: %.loc6_24: i32 = int_value 2 [template = constants.%.14]
// CHECK:STDOUT: %.loc6_25: %.12 = struct_literal (%.loc6_16, %.loc6_24)
// CHECK:STDOUT: %struct: %.12 = struct_value (%.loc6_16, %.loc6_24) [template = constants.%struct]
// CHECK:STDOUT: %.loc6_9: %.12 = converted %.loc6_25, %struct [template = constants.%struct]
@@ -384,8 +384,8 @@ var c_bad: C({.a = 3, .b = 4}) = F();
// CHECK:STDOUT: %S: %.4 = bind_symbolic_name S, 0 [symbolic]
// CHECK:STDOUT: %C.2: type = class_type @C, @C(%S) [symbolic]
// CHECK:STDOUT: %S.patt: %.4 = symbolic_binding_pattern S, 0 [symbolic]
// CHECK:STDOUT: %.5: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.6: i32 = int_literal 2 [template]
// CHECK:STDOUT: %.5: i32 = int_value 1 [template]
// CHECK:STDOUT: %.6: i32 = int_value 2 [template]
// CHECK:STDOUT: %.7: type = struct_type {.c: i32, .d: i32} [template]
// CHECK:STDOUT: %.8: type = ptr_type %.4 [template]
// CHECK:STDOUT: %F.type: type = fn_type @F [template]
@@ -420,8 +420,8 @@ var c_bad: C({.a = 3, .b = 4}) = F();
// CHECK:STDOUT: %default.import = import <invalid>
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C.1]
// CHECK:STDOUT: %.loc11_20: i32 = int_literal 1 [template = constants.%.5]
// CHECK:STDOUT: %.loc11_28: i32 = int_literal 2 [template = constants.%.6]
// CHECK:STDOUT: %.loc11_20: i32 = int_value 1 [template = constants.%.5]
// CHECK:STDOUT: %.loc11_28: i32 = int_value 2 [template = constants.%.6]
// CHECK:STDOUT: %.loc11_29: %.7 = struct_literal (%.loc11_20, %.loc11_28)
// CHECK:STDOUT: %c_bad.var: ref <error> = var c_bad
// CHECK:STDOUT: %c_bad: ref <error> = bind_name c_bad, %c_bad.var
@@ -474,16 +474,16 @@ var c_bad: C({.a = 3, .b = 4}) = F();
// CHECK:STDOUT: %S: %.4 = bind_symbolic_name S, 0 [symbolic]
// CHECK:STDOUT: %C.2: type = class_type @C, @C(%S) [symbolic]
// CHECK:STDOUT: %S.patt: %.4 = symbolic_binding_pattern S, 0 [symbolic]
// CHECK:STDOUT: %.5: i32 = int_literal 3 [template]
// CHECK:STDOUT: %.6: i32 = int_literal 4 [template]
// CHECK:STDOUT: %.5: i32 = int_value 3 [template]
// CHECK:STDOUT: %.6: i32 = int_value 4 [template]
// CHECK:STDOUT: %.7: type = ptr_type %.4 [template]
// CHECK:STDOUT: %struct.1: %.4 = struct_value (%.5, %.6) [template]
// CHECK:STDOUT: %C.3: type = class_type @C, @C(%struct.1) [template]
// CHECK:STDOUT: %.8: type = ptr_type %.2 [template]
// CHECK:STDOUT: %F.type: type = fn_type @F [template]
// CHECK:STDOUT: %F: %F.type = struct_value () [template]
// CHECK:STDOUT: %.9: i32 = int_literal 2 [template]
// CHECK:STDOUT: %.10: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.9: i32 = int_value 2 [template]
// CHECK:STDOUT: %.10: i32 = int_value 1 [template]
// CHECK:STDOUT: %struct.2: %.4 = struct_value (%.10, %.9) [template]
// CHECK:STDOUT: %C.4: type = class_type @C, @C(%struct.2) [template]
// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template]
@@ -537,8 +537,8 @@ var c_bad: C({.a = 3, .b = 4}) = F();
// CHECK:STDOUT: %default.import = import <invalid>
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C.1]
// CHECK:STDOUT: %.loc9_20: i32 = int_literal 3 [template = constants.%.5]
// CHECK:STDOUT: %.loc9_28: i32 = int_literal 4 [template = constants.%.6]
// CHECK:STDOUT: %.loc9_20: i32 = int_value 3 [template = constants.%.5]
// CHECK:STDOUT: %.loc9_28: i32 = int_value 4 [template = constants.%.6]
// CHECK:STDOUT: %.loc9_29: %.4 = struct_literal (%.loc9_20, %.loc9_28)
// CHECK:STDOUT: %struct: %.4 = struct_value (%.loc9_20, %.loc9_28) [template = constants.%struct.1]
// CHECK:STDOUT: %.loc9_13: %.4 = converted %.loc9_29, %struct [template = constants.%struct.1]
@@ -25,9 +25,9 @@ fn F() -> i32 {
// CHECK:STDOUT: %G: %G.type = struct_value () [template]
// CHECK:STDOUT: %F.type: type = fn_type @F [template]
// CHECK:STDOUT: %F: %F.type = struct_value () [template]
// CHECK:STDOUT: %.3: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.3: i32 = int_value 1 [template]
// CHECK:STDOUT: %.4: type = ptr_type %.2 [template]
// CHECK:STDOUT: %.5: i32 = int_literal 3 [template]
// CHECK:STDOUT: %.5: i32 = int_value 3 [template]
// CHECK:STDOUT: %.6: type = struct_type {.a: i32, .b: %.2, .c: i32} [template]
// CHECK:STDOUT: %.7: type = struct_type {.a: i32, .b: %.4, .c: i32} [template]
// CHECK:STDOUT: %.8: type = ptr_type %.7 [template]
@@ -84,11 +84,11 @@ fn F() -> i32 {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F() -> i32 {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %.loc14_16: i32 = int_literal 1 [template = constants.%.3]
// CHECK:STDOUT: %.loc14_16: i32 = int_value 1 [template = constants.%.3]
// CHECK:STDOUT: %G.ref: %G.type = name_ref G, file.%G.decl [template = constants.%G]
// CHECK:STDOUT: %.loc14_25.1: ref %.2 = temporary_storage
// CHECK:STDOUT: %G.call: init %.2 = call %G.ref() to %.loc14_25.1
// CHECK:STDOUT: %.loc14_34: i32 = int_literal 3 [template = constants.%.5]
// CHECK:STDOUT: %.loc14_34: i32 = int_value 3 [template = constants.%.5]
// CHECK:STDOUT: %.loc14_35.1: %.6 = struct_literal (%.loc14_16, %G.call, %.loc14_34)
// CHECK:STDOUT: %.loc14_25.2: ref %.2 = temporary %.loc14_25.1, %G.call
// CHECK:STDOUT: %.loc14_25.3: ref i32 = struct_access %.loc14_25.2, element0
+4 -4
View File
@@ -15,7 +15,7 @@ var z: i32 = y;
// CHECK:STDOUT: --- member_access.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %.1: Core.BigInt = int_literal 64 [template]
// CHECK:STDOUT: %.1: Core.BigInt = int_value 64 [template]
// CHECK:STDOUT: %Float.type: type = fn_type @Float [template]
// CHECK:STDOUT: %.2: type = tuple_type () [template]
// CHECK:STDOUT: %Float: %Float.type = struct_value () [template]
@@ -24,7 +24,7 @@ var z: i32 = y;
// CHECK:STDOUT: %.3: type = struct_type {.a: f64, .b: i32} [template]
// CHECK:STDOUT: %.4: type = ptr_type %.3 [template]
// CHECK:STDOUT: %.5: f64 = float_literal 0 [template]
// CHECK:STDOUT: %.6: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.6: i32 = int_value 1 [template]
// CHECK:STDOUT: %struct: %.3 = struct_value (%.5, %.6) [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -47,7 +47,7 @@ var z: i32 = y;
// CHECK:STDOUT: .z = %z
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %.loc11_13.1: Core.BigInt = int_literal 64 [template = constants.%.1]
// CHECK:STDOUT: %.loc11_13.1: Core.BigInt = int_value 64 [template = constants.%.1]
// CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%.loc11_13.1) [template = f64]
// CHECK:STDOUT: %.loc11_13.2: type = value_of_initializer %float.make_type [template = f64]
// CHECK:STDOUT: %.loc11_13.3: type = converted %float.make_type, %.loc11_13.2 [template = f64]
@@ -76,7 +76,7 @@ var z: i32 = y;
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %.loc11_35: f64 = float_literal 0 [template = constants.%.5]
// CHECK:STDOUT: %.loc11_45: i32 = int_literal 1 [template = constants.%.6]
// CHECK:STDOUT: %.loc11_45: i32 = int_value 1 [template = constants.%.6]
// CHECK:STDOUT: %.loc11_46.1: %.3 = struct_literal (%.loc11_35, %.loc11_45)
// CHECK:STDOUT: %.loc11_46.2: ref f64 = struct_access file.%x.var, element0
// CHECK:STDOUT: %.loc11_46.3: init f64 = initialize_from %.loc11_35 to %.loc11_46.2 [template = constants.%.5]
+2 -2
View File
@@ -18,7 +18,7 @@ var y: {.a: i32} = x;
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
// CHECK:STDOUT: %.2: type = struct_type {.a: i32} [template]
// CHECK:STDOUT: %.3: i32 = int_literal 4 [template]
// CHECK:STDOUT: %.3: i32 = int_value 4 [template]
// CHECK:STDOUT: %struct: %.2 = struct_value (%.3) [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -56,7 +56,7 @@ var y: {.a: i32} = x;
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %.loc11_26: i32 = int_literal 4 [template = constants.%.3]
// CHECK:STDOUT: %.loc11_26: i32 = int_value 4 [template = constants.%.3]
// CHECK:STDOUT: %.loc11_27.1: %.2 = struct_literal (%.loc11_26)
// CHECK:STDOUT: %.loc11_27.2: init %.2 = struct_init (%.loc11_26) to file.%x.var [template = constants.%struct]
// CHECK:STDOUT: %.loc11_28: init %.2 = converted %.loc11_27.1, %.loc11_27.2 [template = constants.%struct]
+5 -5
View File
@@ -25,7 +25,7 @@ fn F() -> {.a: i32, .b: f64} {
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
// CHECK:STDOUT: %MakeI32.type: type = fn_type @MakeI32 [template]
// CHECK:STDOUT: %MakeI32: %MakeI32.type = struct_value () [template]
// CHECK:STDOUT: %.2: Core.BigInt = int_literal 64 [template]
// CHECK:STDOUT: %.2: Core.BigInt = int_value 64 [template]
// CHECK:STDOUT: %Float.type: type = fn_type @Float [template]
// CHECK:STDOUT: %Float: %Float.type = struct_value () [template]
// CHECK:STDOUT: %MakeF64.type: type = fn_type @MakeF64 [template]
@@ -71,7 +71,7 @@ fn F() -> {.a: i32, .b: f64} {
// CHECK:STDOUT: %return.patt: f64 = return_slot_pattern
// CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param0
// CHECK:STDOUT: } {
// CHECK:STDOUT: %.loc12_17.1: Core.BigInt = int_literal 64 [template = constants.%.2]
// CHECK:STDOUT: %.loc12_17.1: Core.BigInt = int_value 64 [template = constants.%.2]
// CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%.loc12_17.1) [template = f64]
// CHECK:STDOUT: %.loc12_17.2: type = value_of_initializer %float.make_type [template = f64]
// CHECK:STDOUT: %.loc12_17.3: type = converted %float.make_type, %.loc12_17.2 [template = f64]
@@ -85,7 +85,7 @@ fn F() -> {.a: i32, .b: f64} {
// CHECK:STDOUT: %int.make_type_32.loc14: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc14_16.1: type = value_of_initializer %int.make_type_32.loc14 [template = i32]
// CHECK:STDOUT: %.loc14_16.2: type = converted %int.make_type_32.loc14, %.loc14_16.1 [template = i32]
// CHECK:STDOUT: %.loc14_25.1: Core.BigInt = int_literal 64 [template = constants.%.2]
// CHECK:STDOUT: %.loc14_25.1: Core.BigInt = int_value 64 [template = constants.%.2]
// CHECK:STDOUT: %float.make_type.loc14: init type = call constants.%Float(%.loc14_25.1) [template = f64]
// CHECK:STDOUT: %.loc14_25.2: type = value_of_initializer %float.make_type.loc14 [template = f64]
// CHECK:STDOUT: %.loc14_25.3: type = converted %float.make_type.loc14, %.loc14_25.2 [template = f64]
@@ -108,7 +108,7 @@ fn F() -> {.a: i32, .b: f64} {
// CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc15_15.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32]
// CHECK:STDOUT: %.loc15_15.2: type = converted %int.make_type_32.loc15, %.loc15_15.1 [template = i32]
// CHECK:STDOUT: %.loc15_24.1: Core.BigInt = int_literal 64 [template = constants.%.2]
// CHECK:STDOUT: %.loc15_24.1: Core.BigInt = int_value 64 [template = constants.%.2]
// CHECK:STDOUT: %float.make_type.loc15: init type = call constants.%Float(%.loc15_24.1) [template = f64]
// CHECK:STDOUT: %.loc15_24.2: type = value_of_initializer %float.make_type.loc15 [template = f64]
// CHECK:STDOUT: %.loc15_24.3: type = converted %float.make_type.loc15, %.loc15_24.2 [template = f64]
@@ -125,7 +125,7 @@ fn F() -> {.a: i32, .b: f64} {
// CHECK:STDOUT: %struct.loc15: %.3 = struct_value (%.loc15_62.3, %.loc15_62.5)
// CHECK:STDOUT: %.loc15_63: %.3 = converted %.loc15_62.1, %struct.loc15
// CHECK:STDOUT: %x: %.3 = bind_name x, %.loc15_63
// CHECK:STDOUT: %.loc16_15.1: Core.BigInt = int_literal 64 [template = constants.%.2]
// CHECK:STDOUT: %.loc16_15.1: Core.BigInt = int_value 64 [template = constants.%.2]
// CHECK:STDOUT: %float.make_type.loc16: init type = call constants.%Float(%.loc16_15.1) [template = f64]
// CHECK:STDOUT: %.loc16_15.2: type = value_of_initializer %float.make_type.loc16 [template = f64]
// CHECK:STDOUT: %.loc16_15.3: type = converted %float.make_type.loc16, %.loc16_15.2 [template = f64]
+4 -4
View File
@@ -21,8 +21,8 @@ var y: {.a: i32, .b: (i32,)} = x;
// CHECK:STDOUT: %.3: type = tuple_type (i32) [template]
// CHECK:STDOUT: %.4: type = struct_type {.a: i32, .b: %.3} [template]
// CHECK:STDOUT: %.5: type = ptr_type %.4 [template]
// CHECK:STDOUT: %.6: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.7: i32 = int_literal 2 [template]
// CHECK:STDOUT: %.6: i32 = int_value 1 [template]
// CHECK:STDOUT: %.7: i32 = int_value 2 [template]
// CHECK:STDOUT: %tuple: %.3 = tuple_value (%.7) [template]
// CHECK:STDOUT: %struct: %.4 = struct_value (%.6, %tuple) [template]
// CHECK:STDOUT: }
@@ -71,8 +71,8 @@ var y: {.a: i32, .b: (i32,)} = x;
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %.loc11_38: i32 = int_literal 1 [template = constants.%.6]
// CHECK:STDOUT: %.loc11_47: i32 = int_literal 2 [template = constants.%.7]
// CHECK:STDOUT: %.loc11_38: i32 = int_value 1 [template = constants.%.6]
// CHECK:STDOUT: %.loc11_47: i32 = int_value 2 [template = constants.%.7]
// CHECK:STDOUT: %.loc11_49.1: %.3 = tuple_literal (%.loc11_47)
// CHECK:STDOUT: %.loc11_50.1: %.4 = struct_literal (%.loc11_38, %.loc11_49.1)
// CHECK:STDOUT: %.loc11_50.2: ref i32 = struct_access file.%x.var, element0
+6 -6
View File
@@ -22,8 +22,8 @@ var y: {.a: i32, .b: i32} = x;
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
// CHECK:STDOUT: %.2: type = struct_type {.a: i32, .b: i32} [template]
// CHECK:STDOUT: %.3: type = ptr_type %.2 [template]
// CHECK:STDOUT: %.4: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.5: i32 = int_literal 2 [template]
// CHECK:STDOUT: %.4: i32 = int_value 1 [template]
// CHECK:STDOUT: %.5: i32 = int_value 2 [template]
// CHECK:STDOUT: %struct: %.2 = struct_value (%.4, %.5) [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -83,16 +83,16 @@ var y: {.a: i32, .b: i32} = x;
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %.loc11_35: i32 = int_literal 1 [template = constants.%.4]
// CHECK:STDOUT: %.loc11_43: i32 = int_literal 2 [template = constants.%.5]
// CHECK:STDOUT: %.loc11_35: i32 = int_value 1 [template = constants.%.4]
// CHECK:STDOUT: %.loc11_43: i32 = int_value 2 [template = constants.%.5]
// CHECK:STDOUT: %.loc11_44: %.2 = struct_literal (%.loc11_35, %.loc11_43)
// CHECK:STDOUT: %struct: %.2 = struct_value (%.loc11_35, %.loc11_43) [template = constants.%struct]
// CHECK:STDOUT: %.loc11_45: %.2 = converted %.loc11_44, %struct [template = constants.%struct]
// CHECK:STDOUT: %v: %.2 = bind_name v, %.loc11_45
// CHECK:STDOUT: %v.ref: %.2 = name_ref v, %v
// CHECK:STDOUT: %w: %.2 = bind_name w, %v.ref
// CHECK:STDOUT: %.loc14_35: i32 = int_literal 1 [template = constants.%.4]
// CHECK:STDOUT: %.loc14_43: i32 = int_literal 2 [template = constants.%.5]
// CHECK:STDOUT: %.loc14_35: i32 = int_value 1 [template = constants.%.4]
// CHECK:STDOUT: %.loc14_43: i32 = int_value 2 [template = constants.%.5]
// CHECK:STDOUT: %.loc14_44.1: %.2 = struct_literal (%.loc14_35, %.loc14_43)
// CHECK:STDOUT: %.loc14_44.2: ref i32 = struct_access file.%x.var, element0
// CHECK:STDOUT: %.loc14_44.3: init i32 = initialize_from %.loc14_35 to %.loc14_44.2 [template = constants.%.4]