mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 08:44:41 +01:00
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:
+5
-5
@@ -23,10 +23,10 @@ fn F(b: bool, n: i32, m: i32) -> i32 {
|
||||
// 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 = array_type %.2, i32 [template]
|
||||
// CHECK:STDOUT: %.4: type = ptr_type %.3 [template]
|
||||
// CHECK:STDOUT: %.5: i32 = int_literal 0 [template]
|
||||
// CHECK:STDOUT: %.5: i32 = int_value 0 [template]
|
||||
// CHECK:STDOUT: %.6: type = tuple_type (i32) [template]
|
||||
// CHECK:STDOUT: %array: %.3 = tuple_value (%.5) [template]
|
||||
// CHECK:STDOUT: }
|
||||
@@ -88,15 +88,15 @@ fn F(b: bool, n: i32, m: i32) -> i32 {
|
||||
// CHECK:STDOUT: fn @F(%b.param_patt: bool, %n.param_patt: i32, %m.param_patt: i32) -> i32 {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %.loc12_16: i32 = int_literal 1 [template = constants.%.2]
|
||||
// CHECK:STDOUT: %.loc12_16: i32 = int_value 1 [template = constants.%.2]
|
||||
// CHECK:STDOUT: %.loc12_11.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32]
|
||||
// CHECK:STDOUT: %.loc12_11.2: type = converted %int.make_type_32.loc12, %.loc12_11.1 [template = i32]
|
||||
// CHECK:STDOUT: %.loc12_17: type = array_type %.loc12_16, i32 [template = constants.%.3]
|
||||
// CHECK:STDOUT: %x.var: ref %.3 = var x
|
||||
// CHECK:STDOUT: %x: ref %.3 = bind_name x, %x.var
|
||||
// CHECK:STDOUT: %.loc12_22: i32 = int_literal 0 [template = constants.%.5]
|
||||
// CHECK:STDOUT: %.loc12_22: i32 = int_value 0 [template = constants.%.5]
|
||||
// CHECK:STDOUT: %.loc12_24.1: %.6 = tuple_literal (%.loc12_22)
|
||||
// CHECK:STDOUT: %.loc12_24.2: i32 = int_literal 0 [template = constants.%.5]
|
||||
// CHECK:STDOUT: %.loc12_24.2: i32 = int_value 0 [template = constants.%.5]
|
||||
// CHECK:STDOUT: %.loc12_24.3: ref i32 = array_index %x.var, %.loc12_24.2
|
||||
// CHECK:STDOUT: %.loc12_24.4: init i32 = initialize_from %.loc12_22 to %.loc12_24.3 [template = constants.%.5]
|
||||
// CHECK:STDOUT: %.loc12_24.5: init %.3 = array_init (%.loc12_24.4) to %x.var [template = constants.%array]
|
||||
|
||||
@@ -39,10 +39,10 @@ fn PartiallyConstant(t: type) -> i32 {
|
||||
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %A.type: type = fn_type @A [template]
|
||||
// CHECK:STDOUT: %A: %A.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %.2: i32 = int_literal 1 [template]
|
||||
// CHECK:STDOUT: %.2: i32 = int_value 1 [template]
|
||||
// CHECK:STDOUT: %B.type: type = fn_type @B [template]
|
||||
// CHECK:STDOUT: %B: %B.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %.3: i32 = int_literal 2 [template]
|
||||
// CHECK:STDOUT: %.3: i32 = int_value 2 [template]
|
||||
// CHECK:STDOUT: %F.type: type = fn_type @F [template]
|
||||
// CHECK:STDOUT: %F: %F.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %.4: bool = bool_literal true [template]
|
||||
@@ -146,13 +146,13 @@ fn PartiallyConstant(t: type) -> i32 {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @A() -> i32 {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc11_24: i32 = int_literal 1 [template = constants.%.2]
|
||||
// CHECK:STDOUT: %.loc11_24: i32 = int_value 1 [template = constants.%.2]
|
||||
// CHECK:STDOUT: return %.loc11_24
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @B() -> i32 {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc12_24: i32 = int_literal 2 [template = constants.%.3]
|
||||
// CHECK:STDOUT: %.loc12_24: i32 = int_value 2 [template = constants.%.3]
|
||||
// CHECK:STDOUT: return %.loc12_24
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -226,7 +226,7 @@ fn PartiallyConstant(t: type) -> i32 {
|
||||
// CHECK:STDOUT: %.loc23_10: type = block_arg !if.expr.result.loc23 [template = i32]
|
||||
// CHECK:STDOUT: %v.var: ref i32 = var v
|
||||
// CHECK:STDOUT: %v: ref i32 = bind_name v, %v.var
|
||||
// CHECK:STDOUT: %.loc23_39: i32 = int_literal 1 [template = constants.%.2]
|
||||
// CHECK:STDOUT: %.loc23_39: i32 = int_value 1 [template = constants.%.2]
|
||||
// CHECK:STDOUT: assign %v.var, %.loc23_39
|
||||
// CHECK:STDOUT: %.loc24_13: bool = bool_literal false [template = constants.%.5]
|
||||
// CHECK:STDOUT: if %.loc24_13 br !if.expr.then.loc24 else br !if.expr.else.loc24
|
||||
@@ -277,7 +277,7 @@ fn PartiallyConstant(t: type) -> i32 {
|
||||
// CHECK:STDOUT: %.loc29_10: type = block_arg !if.expr.result.loc29 [template = i32]
|
||||
// CHECK:STDOUT: %v.var: ref i32 = var v
|
||||
// CHECK:STDOUT: %v: ref i32 = bind_name v, %v.var
|
||||
// CHECK:STDOUT: %.loc29_36: i32 = int_literal 1 [template = constants.%.2]
|
||||
// CHECK:STDOUT: %.loc29_36: i32 = int_value 1 [template = constants.%.2]
|
||||
// CHECK:STDOUT: assign %v.var, %.loc29_36
|
||||
// CHECK:STDOUT: %.loc30_13: bool = bool_literal false [template = constants.%.5]
|
||||
// CHECK:STDOUT: if %.loc30_13 br !if.expr.then.loc30 else br !if.expr.else.loc30
|
||||
|
||||
+4
-4
@@ -23,10 +23,10 @@ fn F(b: bool) -> i32 {
|
||||
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %A.type: type = fn_type @A [template]
|
||||
// CHECK:STDOUT: %A: %A.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %.2: i32 = int_literal 1 [template]
|
||||
// CHECK:STDOUT: %.2: i32 = int_value 1 [template]
|
||||
// CHECK:STDOUT: %B.type: type = fn_type @B [template]
|
||||
// CHECK:STDOUT: %B: %B.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %.3: i32 = int_literal 2 [template]
|
||||
// CHECK:STDOUT: %.3: i32 = int_value 2 [template]
|
||||
// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template]
|
||||
// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %F.type: type = fn_type @F [template]
|
||||
@@ -95,13 +95,13 @@ fn F(b: bool) -> i32 {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @A() -> i32 {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc11_24: i32 = int_literal 1 [template = constants.%.2]
|
||||
// CHECK:STDOUT: %.loc11_24: i32 = int_value 1 [template = constants.%.2]
|
||||
// CHECK:STDOUT: return %.loc11_24
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @B() -> i32 {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc12_24: i32 = int_literal 2 [template = constants.%.3]
|
||||
// CHECK:STDOUT: %.loc12_24: i32 = int_value 2 [template = constants.%.3]
|
||||
// CHECK:STDOUT: return %.loc12_24
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -44,10 +44,10 @@ class C {
|
||||
// CHECK:STDOUT: %.1: type = tuple_type () [template]
|
||||
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %.2: bool = bool_literal true [template]
|
||||
// CHECK:STDOUT: %.3: i32 = int_literal 1 [template]
|
||||
// CHECK:STDOUT: %.4: i32 = int_literal 0 [template]
|
||||
// CHECK:STDOUT: %.3: i32 = int_value 1 [template]
|
||||
// CHECK:STDOUT: %.4: i32 = int_value 0 [template]
|
||||
// CHECK:STDOUT: %C: type = class_type @C [template]
|
||||
// CHECK:STDOUT: %.5: Core.BigInt = int_literal 64 [template]
|
||||
// CHECK:STDOUT: %.5: 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: %.6: type = unbound_element_type %C, i32 [template]
|
||||
|
||||
@@ -49,7 +49,7 @@ fn ChosenBranchIsNonConstant(t: type) {
|
||||
// CHECK:STDOUT: %ConditionIsNonConstant: %ConditionIsNonConstant.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
|
||||
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %.2: i32 = int_literal 1 [template]
|
||||
// CHECK:STDOUT: %.2: i32 = int_value 1 [template]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
@@ -104,7 +104,7 @@ fn ChosenBranchIsNonConstant(t: type) {
|
||||
// CHECK:STDOUT: %.loc12_10: type = block_arg !if.expr.result
|
||||
// CHECK:STDOUT: %v.var: ref <error> = var v
|
||||
// CHECK:STDOUT: %v: ref <error> = bind_name v, %v.var
|
||||
// CHECK:STDOUT: %.loc12_35: i32 = int_literal 1 [template = constants.%.2]
|
||||
// CHECK:STDOUT: %.loc12_35: i32 = int_value 1 [template = constants.%.2]
|
||||
// CHECK:STDOUT: assign %v.var, <error>
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
@@ -120,7 +120,7 @@ fn ChosenBranchIsNonConstant(t: type) {
|
||||
// CHECK:STDOUT: %.2: bool = bool_literal true [template]
|
||||
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
|
||||
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %.3: i32 = int_literal 1 [template]
|
||||
// CHECK:STDOUT: %.3: i32 = int_value 1 [template]
|
||||
// CHECK:STDOUT: %.4: bool = bool_literal false [template]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -167,7 +167,7 @@ fn ChosenBranchIsNonConstant(t: type) {
|
||||
// CHECK:STDOUT: %.loc9_10: type = block_arg !if.expr.result.loc9
|
||||
// CHECK:STDOUT: %v.var: ref <error> = var v
|
||||
// CHECK:STDOUT: %v: ref <error> = bind_name v, %v.var
|
||||
// CHECK:STDOUT: %.loc9_36: i32 = int_literal 1 [template = constants.%.3]
|
||||
// CHECK:STDOUT: %.loc9_36: i32 = int_value 1 [template = constants.%.3]
|
||||
// CHECK:STDOUT: assign %v.var, <error>
|
||||
// CHECK:STDOUT: %.loc13_13: bool = bool_literal false [template = constants.%.4]
|
||||
// CHECK:STDOUT: if %.loc13_13 br !if.expr.then.loc13 else br !if.expr.else.loc13
|
||||
@@ -186,7 +186,7 @@ fn ChosenBranchIsNonConstant(t: type) {
|
||||
// CHECK:STDOUT: %.loc13_10: type = block_arg !if.expr.result.loc13
|
||||
// CHECK:STDOUT: %w.var: ref <error> = var w
|
||||
// CHECK:STDOUT: %w: ref <error> = bind_name w, %w.var
|
||||
// CHECK:STDOUT: %.loc13_37: i32 = int_literal 1 [template = constants.%.3]
|
||||
// CHECK:STDOUT: %.loc13_37: i32 = int_value 1 [template = constants.%.3]
|
||||
// CHECK:STDOUT: assign %w.var, <error>
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
+8
-8
@@ -22,10 +22,10 @@ fn F(a: bool, b: bool, c: bool) -> i32 {
|
||||
// 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: %.3: i32 = int_literal 2 [template]
|
||||
// CHECK:STDOUT: %.4: i32 = int_literal 3 [template]
|
||||
// CHECK:STDOUT: %.5: i32 = int_literal 4 [template]
|
||||
// CHECK:STDOUT: %.2: i32 = int_value 1 [template]
|
||||
// CHECK:STDOUT: %.3: i32 = int_value 2 [template]
|
||||
// CHECK:STDOUT: %.4: i32 = int_value 3 [template]
|
||||
// CHECK:STDOUT: %.5: i32 = int_value 4 [template]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
@@ -92,11 +92,11 @@ fn F(a: bool, b: bool, c: bool) -> i32 {
|
||||
// CHECK:STDOUT: if %b.ref br !if.expr.then.loc12_20 else br !if.expr.else.loc12_20
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !if.expr.then.loc12_20:
|
||||
// CHECK:STDOUT: %.loc12_30: i32 = int_literal 1 [template = constants.%.2]
|
||||
// CHECK:STDOUT: %.loc12_30: i32 = int_value 1 [template = constants.%.2]
|
||||
// CHECK:STDOUT: br !if.expr.result.loc12_20(%.loc12_30)
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !if.expr.else.loc12_20:
|
||||
// CHECK:STDOUT: %.loc12_37: i32 = int_literal 2 [template = constants.%.3]
|
||||
// CHECK:STDOUT: %.loc12_37: i32 = int_value 2 [template = constants.%.3]
|
||||
// CHECK:STDOUT: br !if.expr.result.loc12_20(%.loc12_37)
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !if.expr.result.loc12_20:
|
||||
@@ -108,11 +108,11 @@ fn F(a: bool, b: bool, c: bool) -> i32 {
|
||||
// CHECK:STDOUT: if %c.ref br !if.expr.then.loc12_44 else br !if.expr.else.loc12_44
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !if.expr.then.loc12_44:
|
||||
// CHECK:STDOUT: %.loc12_54: i32 = int_literal 3 [template = constants.%.4]
|
||||
// CHECK:STDOUT: %.loc12_54: i32 = int_value 3 [template = constants.%.4]
|
||||
// CHECK:STDOUT: br !if.expr.result.loc12_44(%.loc12_54)
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !if.expr.else.loc12_44:
|
||||
// CHECK:STDOUT: %.loc12_61: i32 = int_literal 4 [template = constants.%.5]
|
||||
// CHECK:STDOUT: %.loc12_61: i32 = int_value 4 [template = constants.%.5]
|
||||
// CHECK:STDOUT: br !if.expr.result.loc12_44(%.loc12_61)
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !if.expr.result.loc12_44:
|
||||
|
||||
+4
-4
@@ -29,8 +29,8 @@ fn F(cond: bool) {
|
||||
// CHECK:STDOUT: %F.type: type = fn_type @F [template]
|
||||
// CHECK:STDOUT: %F: %F.type = struct_value () [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:
|
||||
@@ -95,8 +95,8 @@ fn F(cond: bool) {
|
||||
// CHECK:STDOUT: %.loc14_27: type = struct_type {.a: i32, .b: i32} [template = constants.%.2]
|
||||
// CHECK:STDOUT: %a.var: ref %.2 = var a
|
||||
// CHECK:STDOUT: %a: ref %.2 = bind_name a, %a.var
|
||||
// CHECK:STDOUT: %.loc14_37: i32 = int_literal 1 [template = constants.%.4]
|
||||
// CHECK:STDOUT: %.loc14_45: i32 = int_literal 2 [template = constants.%.5]
|
||||
// CHECK:STDOUT: %.loc14_37: i32 = int_value 1 [template = constants.%.4]
|
||||
// CHECK:STDOUT: %.loc14_45: i32 = int_value 2 [template = constants.%.5]
|
||||
// CHECK:STDOUT: %.loc14_46.1: %.2 = struct_literal (%.loc14_37, %.loc14_45)
|
||||
// CHECK:STDOUT: %.loc14_46.2: ref i32 = struct_access %a.var, element0
|
||||
// CHECK:STDOUT: %.loc14_46.3: init i32 = initialize_from %.loc14_37 to %.loc14_46.2 [template = constants.%.4]
|
||||
|
||||
Reference in New Issue
Block a user