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
+14 -14
View File
@@ -724,8 +724,8 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: %.4: type = ptr_type %.3 [symbolic]
// CHECK:STDOUT: %CallTupleParam.type: type = fn_type @CallTupleParam [template]
// CHECK:STDOUT: %CallTupleParam: %CallTupleParam.type = struct_value () [template]
// 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 = tuple_type (i32, i32) [template]
// CHECK:STDOUT: %.8: <specific function> = specific_function %TupleParam, @TupleParam(i32) [template]
// CHECK:STDOUT: %.9: type = ptr_type %.7 [template]
@@ -786,8 +786,8 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: fn @CallTupleParam() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %TupleParam.ref: %TupleParam.type = name_ref TupleParam, file.%TupleParam.decl [template = constants.%TupleParam]
// CHECK:STDOUT: %.loc7_15: i32 = int_literal 1 [template = constants.%.5]
// CHECK:STDOUT: %.loc7_18: i32 = int_literal 2 [template = constants.%.6]
// CHECK:STDOUT: %.loc7_15: i32 = int_value 1 [template = constants.%.5]
// CHECK:STDOUT: %.loc7_18: i32 = int_value 2 [template = constants.%.6]
// CHECK:STDOUT: %.loc7_19.1: %.7 = tuple_literal (%.loc7_15, %.loc7_18)
// CHECK:STDOUT: %.loc7_3: <specific function> = specific_function %TupleParam.ref, @TupleParam(i32) [template = constants.%.8]
// CHECK:STDOUT: %tuple: %.7 = tuple_value (%.loc7_15, %.loc7_18) [template = constants.%tuple]
@@ -824,8 +824,8 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: %.3: type = ptr_type %.2 [symbolic]
// CHECK:STDOUT: %CallStructParam.type: type = fn_type @CallStructParam [template]
// CHECK:STDOUT: %CallStructParam: %CallStructParam.type = struct_value () [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: %.6: type = struct_type {.a: i32, .b: i32} [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -882,8 +882,8 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: fn @CallStructParam() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %StructParam.ref: %StructParam.type = name_ref StructParam, file.%StructParam.decl [template = constants.%StructParam]
// CHECK:STDOUT: %.loc14_21: i32 = int_literal 1 [template = constants.%.4]
// CHECK:STDOUT: %.loc14_29: i32 = int_literal 2 [template = constants.%.5]
// CHECK:STDOUT: %.loc14_21: i32 = int_value 1 [template = constants.%.4]
// CHECK:STDOUT: %.loc14_29: i32 = int_value 2 [template = constants.%.5]
// CHECK:STDOUT: %.loc14_30: %.6 = struct_literal (%.loc14_21, %.loc14_29)
// CHECK:STDOUT: return
// CHECK:STDOUT: }
@@ -906,7 +906,7 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: %ImplicitNotDeducible: %ImplicitNotDeducible.type = struct_value () [template]
// CHECK:STDOUT: %CallImplicitNotDeducible.type: type = fn_type @CallImplicitNotDeducible [template]
// CHECK:STDOUT: %CallImplicitNotDeducible: %CallImplicitNotDeducible.type = struct_value () [template]
// CHECK:STDOUT: %.2: i32 = int_literal 42 [template]
// CHECK:STDOUT: %.2: i32 = int_value 42 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -959,7 +959,7 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: fn @CallImplicitNotDeducible() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %ImplicitNotDeducible.ref: %ImplicitNotDeducible.type = name_ref ImplicitNotDeducible, file.%ImplicitNotDeducible.decl [template = constants.%ImplicitNotDeducible]
// CHECK:STDOUT: %.loc16: i32 = int_literal 42 [template = constants.%.2]
// CHECK:STDOUT: %.loc16: i32 = int_value 42 [template = constants.%.2]
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -980,8 +980,8 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: %ImplicitNotDeducible: %ImplicitNotDeducible.type = struct_value () [template]
// CHECK:STDOUT: %CallImplicitNotDeducible.type: type = fn_type @CallImplicitNotDeducible [template]
// CHECK:STDOUT: %CallImplicitNotDeducible: %CallImplicitNotDeducible.type = struct_value () [template]
// CHECK:STDOUT: %.2: i32 = int_literal 42 [template]
// CHECK:STDOUT: %.3: i32 = int_literal 12 [template]
// CHECK:STDOUT: %.2: i32 = int_value 42 [template]
// CHECK:STDOUT: %.3: i32 = int_value 12 [template]
// CHECK:STDOUT: %.4: type = struct_type {.x: i32} [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -1034,8 +1034,8 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: fn @CallImplicitNotDeducible() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %ImplicitNotDeducible.ref: %ImplicitNotDeducible.type = name_ref ImplicitNotDeducible, file.%ImplicitNotDeducible.decl [template = constants.%ImplicitNotDeducible]
// CHECK:STDOUT: %.loc13_24: i32 = int_literal 42 [template = constants.%.2]
// CHECK:STDOUT: %.loc13_34: i32 = int_literal 12 [template = constants.%.3]
// CHECK:STDOUT: %.loc13_24: i32 = int_value 42 [template = constants.%.2]
// CHECK:STDOUT: %.loc13_34: i32 = int_value 12 [template = constants.%.3]
// CHECK:STDOUT: %.loc13_36: %.4 = struct_literal (%.loc13_34)
// CHECK:STDOUT: return
// CHECK:STDOUT: }
@@ -45,7 +45,7 @@ fn CallNegative() {
// CHECK:STDOUT: %.2: type = int_type signed, %N [symbolic]
// CHECK:STDOUT: %CallNegative.type: type = fn_type @CallNegative [template]
// CHECK:STDOUT: %CallNegative: %CallNegative.type = struct_value () [template]
// CHECK:STDOUT: %.3: i32 = int_literal 0 [template]
// CHECK:STDOUT: %.3: i32 = int_value 0 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -116,7 +116,7 @@ fn CallNegative() {
// CHECK:STDOUT: fn @CallNegative() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %ErrorIfNIsZero.ref: %ErrorIfNIsZero.type = name_ref ErrorIfNIsZero, file.%ErrorIfNIsZero.decl [template = constants.%ErrorIfNIsZero]
// CHECK:STDOUT: %.loc19: i32 = int_literal 0 [template = constants.%.3]
// CHECK:STDOUT: %.loc19: i32 = int_value 0 [template = constants.%.3]
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -37,7 +37,7 @@ fn G() {
// CHECK:STDOUT: %C: type = class_type @C [template]
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
// CHECK:STDOUT: %.5: i32 = int_literal 100 [template]
// CHECK:STDOUT: %.5: i32 = int_value 100 [template]
// CHECK:STDOUT: %.6: type = array_type %.5, i32 [template]
// CHECK:STDOUT: %.7: type = ptr_type %.6 [template]
// CHECK:STDOUT: %.8: type = unbound_element_type %C, %.6 [template]
@@ -117,7 +117,7 @@ fn G() {
// CHECK:STDOUT:
// CHECK:STDOUT: class @C {
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc15_26: i32 = int_literal 100 [template = constants.%.5]
// CHECK:STDOUT: %.loc15_26: i32 = int_value 100 [template = constants.%.5]
// CHECK:STDOUT: %.loc15_21.1: type = value_of_initializer %int.make_type_32 [template = i32]
// CHECK:STDOUT: %.loc15_21.2: type = converted %int.make_type_32, %.loc15_21.1 [template = i32]
// CHECK:STDOUT: %.loc15_29: type = array_type %.loc15_26, i32 [template = constants.%.6]
+6 -6
View File
@@ -62,7 +62,7 @@ fn CallUndefined() -> i32 {
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
// CHECK:STDOUT: %CallDefined.type: type = fn_type @CallDefined [template]
// CHECK:STDOUT: %CallDefined: %CallDefined.type = struct_value () [template]
// CHECK:STDOUT: %.2: i32 = int_literal 0 [template]
// CHECK:STDOUT: %.2: i32 = int_value 0 [template]
// CHECK:STDOUT: %.3: <specific function> = specific_function %Defined, @Defined(i32) [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -129,7 +129,7 @@ fn CallUndefined() -> i32 {
// CHECK:STDOUT: fn @CallDefined() -> i32 {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Defined.ref: %Defined.type = name_ref Defined, file.%Defined.decl [template = constants.%Defined]
// CHECK:STDOUT: %.loc9_18: i32 = int_literal 0 [template = constants.%.2]
// CHECK:STDOUT: %.loc9_18: i32 = int_value 0 [template = constants.%.2]
// CHECK:STDOUT: %.loc9_10: <specific function> = specific_function %Defined.ref, @Defined(i32) [template = constants.%.3]
// CHECK:STDOUT: %Defined.call: init i32 = call %.loc9_10(%.loc9_18)
// CHECK:STDOUT: %.loc9_20.1: i32 = value_of_initializer %Defined.call
@@ -161,7 +161,7 @@ fn CallUndefined() -> i32 {
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
// CHECK:STDOUT: %CallDefined.type: type = fn_type @CallDefined [template]
// CHECK:STDOUT: %CallDefined: %CallDefined.type = struct_value () [template]
// CHECK:STDOUT: %.2: i32 = int_literal 0 [template]
// CHECK:STDOUT: %.2: i32 = int_value 0 [template]
// CHECK:STDOUT: %.3: <specific function> = specific_function %Defined, @Defined(i32) [template]
// CHECK:STDOUT: %T.patt.2: type = symbolic_binding_pattern T, 0 [symbolic]
// CHECK:STDOUT: }
@@ -246,7 +246,7 @@ fn CallUndefined() -> i32 {
// CHECK:STDOUT: fn @CallDefined() -> i32 {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Defined.ref: %Defined.type = name_ref Defined, file.%Defined.decl.loc4 [template = constants.%Defined]
// CHECK:STDOUT: %.loc7_18: i32 = int_literal 0 [template = constants.%.2]
// CHECK:STDOUT: %.loc7_18: i32 = int_value 0 [template = constants.%.2]
// CHECK:STDOUT: %.loc7_10: <specific function> = specific_function %Defined.ref, @Defined(i32) [template = constants.%.3]
// CHECK:STDOUT: %Defined.call: init i32 = call %.loc7_10(%.loc7_18)
// CHECK:STDOUT: %.loc7_20.1: i32 = value_of_initializer %Defined.call
@@ -278,7 +278,7 @@ fn CallUndefined() -> i32 {
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
// CHECK:STDOUT: %CallUndefined.type: type = fn_type @CallUndefined [template]
// CHECK:STDOUT: %CallUndefined: %CallUndefined.type = struct_value () [template]
// CHECK:STDOUT: %.2: i32 = int_literal 0 [template]
// CHECK:STDOUT: %.2: i32 = int_value 0 [template]
// CHECK:STDOUT: %.3: <specific function> = specific_function %Undefined, @Undefined(i32) [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -339,7 +339,7 @@ fn CallUndefined() -> i32 {
// CHECK:STDOUT: fn @CallUndefined() -> i32 {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Undefined.ref: %Undefined.type = name_ref Undefined, file.%Undefined.decl [template = constants.%Undefined]
// CHECK:STDOUT: %.loc13_20: i32 = int_literal 0 [template = constants.%.2]
// CHECK:STDOUT: %.loc13_20: i32 = int_value 0 [template = constants.%.2]
// CHECK:STDOUT: %.loc13_10: <specific function> = specific_function %Undefined.ref, @Undefined(i32) [template = constants.%.3]
// CHECK:STDOUT: %Undefined.call: init i32 = call %.loc13_10(%.loc13_20)
// CHECK:STDOUT: %.loc13_22.1: i32 = value_of_initializer %Undefined.call