[IR] Split const folding into necessary one and for optimizations only
In this commit we have a lot of change in test data. This was caused by the way where we evaluate constants. We split constant evaluation into two distinct parts: only necessary evaluations for `fir2ir` (like const val and annotations) and optimizations for lowering. Now we don't do all constant evaluation on `fir2ir`, but IR dump is executed after this phase, so test data changed. #KT-58923
This commit is contained in:
Vendored
+2
-1
@@ -91,7 +91,8 @@ FILE fqName:<root> fileName:/arrayAccessCompositeOperators.kt
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in <root>.MyContainer'
|
||||
STRING_CONCATENATION type=kotlin.String
|
||||
CONST String type=kotlin.String value="MyContainer(i="
|
||||
CONST String type=kotlin.String value="MyContainer("
|
||||
CONST String type=kotlin.String value="i="
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.MyContainer declared in <root>.MyContainer.toString' type=<root>.MyContainer origin=null
|
||||
CONST String type=kotlin.String value=")"
|
||||
|
||||
Vendored
+1
-1
@@ -37,7 +37,7 @@ data class MyContainer {
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return "MyContainer(i=" + <this>.#i + ")"
|
||||
return "MyContainer(" + "i=" + <this>.#i + ")"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-1
@@ -91,7 +91,8 @@ FILE fqName:<root> fileName:/arrayAccessOperators.kt
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in <root>.MyContainer'
|
||||
STRING_CONCATENATION type=kotlin.String
|
||||
CONST String type=kotlin.String value="MyContainer(s="
|
||||
CONST String type=kotlin.String value="MyContainer("
|
||||
CONST String type=kotlin.String value="s="
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private' type=kotlin.String origin=null
|
||||
receiver: GET_VAR '<this>: <root>.MyContainer declared in <root>.MyContainer.toString' type=<root>.MyContainer origin=null
|
||||
CONST String type=kotlin.String value=")"
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ data class MyContainer {
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return "MyContainer(s=" + <this>.#s + ")"
|
||||
return "MyContainer(" + "s=" + <this>.#s + ")"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Vendored
+2
-1
@@ -91,7 +91,8 @@ FILE fqName:<root> fileName:/compoundAssignmentOperators.kt
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in <root>.Result'
|
||||
STRING_CONCATENATION type=kotlin.String
|
||||
CONST String type=kotlin.String value="Result(i="
|
||||
CONST String type=kotlin.String value="Result("
|
||||
CONST String type=kotlin.String value="i="
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Result declared in <root>.Result.toString' type=<root>.Result origin=null
|
||||
CONST String type=kotlin.String value=")"
|
||||
|
||||
Vendored
+1
-1
@@ -37,7 +37,7 @@ data class Result {
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return "Result(i=" + <this>.#i + ")"
|
||||
return "Result(" + "i=" + <this>.#i + ")"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+4
-2
@@ -148,10 +148,12 @@ FILE fqName:<root> fileName:/compareTo.kt
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in <root>.Pair'
|
||||
STRING_CONCATENATION type=kotlin.String
|
||||
CONST String type=kotlin.String value="Pair(first="
|
||||
CONST String type=kotlin.String value="Pair("
|
||||
CONST String type=kotlin.String value="first="
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:first type:A of <root>.Pair visibility:private [final]' type=A of <root>.Pair origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Pair<A of <root>.Pair, B of <root>.Pair> declared in <root>.Pair.toString' type=<root>.Pair<A of <root>.Pair, B of <root>.Pair> origin=null
|
||||
CONST String type=kotlin.String value=", second="
|
||||
CONST String type=kotlin.String value=", "
|
||||
CONST String type=kotlin.String value="second="
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:second type:B of <root>.Pair visibility:private [final]' type=B of <root>.Pair origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Pair<A of <root>.Pair, B of <root>.Pair> declared in <root>.Pair.toString' type=<root>.Pair<A of <root>.Pair, B of <root>.Pair> origin=null
|
||||
CONST String type=kotlin.String value=")"
|
||||
|
||||
+1
-1
@@ -55,7 +55,7 @@ data class Pair<A : Any?, B : Any?> {
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return "Pair(first=" + <this>.#first + ", second=" + <this>.#second + ")"
|
||||
return "Pair(" + "first=" + <this>.#first + ", " + "second=" + <this>.#second + ")"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+4
-2
@@ -93,7 +93,8 @@ FILE fqName:<root> fileName:/iteratorOperator.kt
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in <root>.Counter'
|
||||
STRING_CONCATENATION type=kotlin.String
|
||||
CONST String type=kotlin.String value="Counter(i="
|
||||
CONST String type=kotlin.String value="Counter("
|
||||
CONST String type=kotlin.String value="i="
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Counter declared in <root>.Counter.toString' type=<root>.Counter origin=null
|
||||
CONST String type=kotlin.String value=")"
|
||||
@@ -183,7 +184,8 @@ FILE fqName:<root> fileName:/iteratorOperator.kt
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in <root>.CounterConfig'
|
||||
STRING_CONCATENATION type=kotlin.String
|
||||
CONST String type=kotlin.String value="CounterConfig(max="
|
||||
CONST String type=kotlin.String value="CounterConfig("
|
||||
CONST String type=kotlin.String value="max="
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:max type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.CounterConfig declared in <root>.CounterConfig.toString' type=<root>.CounterConfig origin=null
|
||||
CONST String type=kotlin.String value=")"
|
||||
|
||||
+2
-2
@@ -37,7 +37,7 @@ data class Counter {
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return "Counter(i=" + <this>.#i + ")"
|
||||
return "Counter(" + "i=" + <this>.#i + ")"
|
||||
}
|
||||
|
||||
}
|
||||
@@ -80,7 +80,7 @@ data class CounterConfig {
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return "CounterConfig(max=" + <this>.#max + ")"
|
||||
return "CounterConfig(" + "max=" + <this>.#max + ")"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-1
@@ -83,7 +83,8 @@ FILE fqName:<root> fileName:/unaryOperators.kt
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in <root>.Result'
|
||||
STRING_CONCATENATION type=kotlin.String
|
||||
CONST String type=kotlin.String value="Result(i="
|
||||
CONST String type=kotlin.String value="Result("
|
||||
CONST String type=kotlin.String value="i="
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Result declared in <root>.Result.toString' type=<root>.Result origin=null
|
||||
CONST String type=kotlin.String value=")"
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ data class Result {
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return "Result(i=" + <this>.#i + ")"
|
||||
return "Result(" + "i=" + <this>.#i + ")"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user