[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:
Ivan Kylchik
2023-05-28 18:43:30 +02:00
committed by Space Team
parent 8067df3c94
commit dd264cff50
96 changed files with 648 additions and 327 deletions
@@ -91,7 +91,8 @@ FILE fqName:<root> fileName:/lambdaInDataClassDefaultParameter.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in <root>.A'
STRING_CONCATENATION type=kotlin.String
CONST String type=kotlin.String value="A(runA="
CONST String type=kotlin.String value="A("
CONST String type=kotlin.String value="runA="
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:runA type:@[ExtensionFunctionType] kotlin.Function2<<root>.A, kotlin.String, kotlin.Unit> visibility:private [final]' type=@[ExtensionFunctionType] kotlin.Function2<<root>.A, kotlin.String, kotlin.Unit> origin=null
receiver: GET_VAR '<this>: <root>.A declared in <root>.A.toString' type=<root>.A origin=null
CONST String type=kotlin.String value=")"
@@ -201,7 +202,8 @@ FILE fqName:<root> fileName:/lambdaInDataClassDefaultParameter.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in <root>.B'
STRING_CONCATENATION type=kotlin.String
CONST String type=kotlin.String value="B(x="
CONST String type=kotlin.String value="B("
CONST String type=kotlin.String value="x="
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null
receiver: GET_VAR '<this>: <root>.B declared in <root>.B.toString' type=<root>.B origin=null
CONST String type=kotlin.String value=")"