FIR2IR converter: handle receivers and parents more correctly

This commit is contained in:
Mikhail Glukhikh
2019-05-14 15:58:50 +03:00
parent 90009f002c
commit 26974788e9
59 changed files with 400 additions and 174 deletions
@@ -5,6 +5,7 @@ FILE fqName:<root> fileName:/floatingPointCompareTo.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test1d (x: kotlin.Double, y: kotlin.Double): kotlin.Int declared in <root>'
CALL 'public open fun compareTo (other: kotlin.Double): kotlin.Int declared in kotlin.Double' type=kotlin.Int origin=null
$this: GET_VAR 'x: kotlin.Double declared in <root>.test1d' type=kotlin.Double origin=null
other: GET_VAR 'y: kotlin.Double declared in <root>.test1d' type=kotlin.Double origin=null
FUN name:test2d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Any) returnType:kotlin.Boolean
VALUE_PARAMETER name:x index:0 type:kotlin.Double
@@ -51,6 +52,7 @@ FILE fqName:<root> fileName:/floatingPointCompareTo.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test1f (x: kotlin.Float, y: kotlin.Float): kotlin.Int declared in <root>'
CALL 'public open fun compareTo (other: kotlin.Float): kotlin.Int declared in kotlin.Float' type=kotlin.Int origin=null
$this: GET_VAR 'x: kotlin.Float declared in <root>.test1f' type=kotlin.Float origin=null
other: GET_VAR 'y: kotlin.Float declared in <root>.test1f' type=kotlin.Float origin=null
FUN name:test2f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:kotlin.Boolean
VALUE_PARAMETER name:x index:0 type:kotlin.Float
@@ -5,6 +5,7 @@ FILE fqName:<root> fileName:/floatingPointEquals.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test1d (x: kotlin.Double, y: kotlin.Double): kotlin.Boolean declared in <root>'
CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any' type=kotlin.Boolean origin=null
$this: GET_VAR 'x: kotlin.Double declared in <root>.test1d' type=kotlin.Double origin=null
other: GET_VAR 'y: kotlin.Double declared in <root>.test1d' type=kotlin.Double origin=null
FUN name:test2d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Double?) returnType:kotlin.Boolean
VALUE_PARAMETER name:x index:0 type:kotlin.Double
@@ -12,6 +13,7 @@ FILE fqName:<root> fileName:/floatingPointEquals.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test2d (x: kotlin.Double, y: kotlin.Double?): kotlin.Boolean declared in <root>'
CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any' type=kotlin.Boolean origin=null
$this: GET_VAR 'x: kotlin.Double declared in <root>.test2d' type=kotlin.Double origin=null
other: GET_VAR 'y: kotlin.Double? declared in <root>.test2d' type=kotlin.Double? origin=null
FUN name:test3d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Any) returnType:kotlin.Boolean
VALUE_PARAMETER name:x index:0 type:kotlin.Double
@@ -19,6 +21,7 @@ FILE fqName:<root> fileName:/floatingPointEquals.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test3d (x: kotlin.Double, y: kotlin.Any): kotlin.Boolean declared in <root>'
CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any' type=kotlin.Boolean origin=null
$this: GET_VAR 'x: kotlin.Double declared in <root>.test3d' type=kotlin.Double origin=null
other: GET_VAR 'y: kotlin.Any declared in <root>.test3d' type=kotlin.Any origin=null
FUN name:test4d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Number) returnType:kotlin.Boolean
VALUE_PARAMETER name:x index:0 type:kotlin.Double
@@ -26,6 +29,7 @@ FILE fqName:<root> fileName:/floatingPointEquals.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test4d (x: kotlin.Double, y: kotlin.Number): kotlin.Boolean declared in <root>'
CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any' type=kotlin.Boolean origin=null
$this: GET_VAR 'x: kotlin.Double declared in <root>.test4d' type=kotlin.Double origin=null
other: GET_VAR 'y: kotlin.Number declared in <root>.test4d' type=kotlin.Number origin=null
FUN name:test5d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Any) returnType:kotlin.Boolean
VALUE_PARAMETER name:x index:0 type:kotlin.Double
@@ -37,6 +41,7 @@ FILE fqName:<root> fileName:/floatingPointEquals.kt
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double
GET_VAR 'y: kotlin.Any declared in <root>.test5d' type=kotlin.Any origin=null
then: CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any' type=kotlin.Boolean origin=null
$this: GET_VAR 'x: kotlin.Double declared in <root>.test5d' type=kotlin.Double origin=null
other: GET_VAR 'y: kotlin.Any declared in <root>.test5d' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
@@ -58,6 +63,7 @@ FILE fqName:<root> fileName:/floatingPointEquals.kt
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
then: CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any' type=kotlin.Boolean origin=null
$this: GET_VAR 'x: kotlin.Any declared in <root>.test6d' type=kotlin.Any origin=null
other: GET_VAR 'y: kotlin.Any declared in <root>.test6d' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
@@ -68,6 +74,7 @@ FILE fqName:<root> fileName:/floatingPointEquals.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test1f (x: kotlin.Float, y: kotlin.Float): kotlin.Boolean declared in <root>'
CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any' type=kotlin.Boolean origin=null
$this: GET_VAR 'x: kotlin.Float declared in <root>.test1f' type=kotlin.Float origin=null
other: GET_VAR 'y: kotlin.Float declared in <root>.test1f' type=kotlin.Float origin=null
FUN name:test2f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Float?) returnType:kotlin.Boolean
VALUE_PARAMETER name:x index:0 type:kotlin.Float
@@ -75,6 +82,7 @@ FILE fqName:<root> fileName:/floatingPointEquals.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test2f (x: kotlin.Float, y: kotlin.Float?): kotlin.Boolean declared in <root>'
CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any' type=kotlin.Boolean origin=null
$this: GET_VAR 'x: kotlin.Float declared in <root>.test2f' type=kotlin.Float origin=null
other: GET_VAR 'y: kotlin.Float? declared in <root>.test2f' type=kotlin.Float? origin=null
FUN name:test3f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:kotlin.Boolean
VALUE_PARAMETER name:x index:0 type:kotlin.Float
@@ -82,6 +90,7 @@ FILE fqName:<root> fileName:/floatingPointEquals.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test3f (x: kotlin.Float, y: kotlin.Any): kotlin.Boolean declared in <root>'
CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any' type=kotlin.Boolean origin=null
$this: GET_VAR 'x: kotlin.Float declared in <root>.test3f' type=kotlin.Float origin=null
other: GET_VAR 'y: kotlin.Any declared in <root>.test3f' type=kotlin.Any origin=null
FUN name:test4f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Number) returnType:kotlin.Boolean
VALUE_PARAMETER name:x index:0 type:kotlin.Float
@@ -89,6 +98,7 @@ FILE fqName:<root> fileName:/floatingPointEquals.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test4f (x: kotlin.Float, y: kotlin.Number): kotlin.Boolean declared in <root>'
CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any' type=kotlin.Boolean origin=null
$this: GET_VAR 'x: kotlin.Float declared in <root>.test4f' type=kotlin.Float origin=null
other: GET_VAR 'y: kotlin.Number declared in <root>.test4f' type=kotlin.Number origin=null
FUN name:test5f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:kotlin.Boolean
VALUE_PARAMETER name:x index:0 type:kotlin.Float
@@ -100,6 +110,7 @@ FILE fqName:<root> fileName:/floatingPointEquals.kt
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float
GET_VAR 'y: kotlin.Any declared in <root>.test5f' type=kotlin.Any origin=null
then: CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any' type=kotlin.Boolean origin=null
$this: GET_VAR 'x: kotlin.Float declared in <root>.test5f' type=kotlin.Float origin=null
other: GET_VAR 'y: kotlin.Any declared in <root>.test5f' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
@@ -121,6 +132,7 @@ FILE fqName:<root> fileName:/floatingPointEquals.kt
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
then: CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any' type=kotlin.Boolean origin=null
$this: GET_VAR 'x: kotlin.Any declared in <root>.test6f' type=kotlin.Any origin=null
other: GET_VAR 'y: kotlin.Any declared in <root>.test6f' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
@@ -142,6 +154,7 @@ FILE fqName:<root> fileName:/floatingPointEquals.kt
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
then: CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any' type=kotlin.Boolean origin=null
$this: GET_VAR 'x: kotlin.Any declared in <root>.testFD' type=kotlin.Any origin=null
other: GET_VAR 'y: kotlin.Any declared in <root>.testFD' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
@@ -163,6 +176,7 @@ FILE fqName:<root> fileName:/floatingPointEquals.kt
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
then: CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any' type=kotlin.Boolean origin=null
$this: GET_VAR 'x: kotlin.Any declared in <root>.testDF' type=kotlin.Any origin=null
other: GET_VAR 'y: kotlin.Any declared in <root>.testDF' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
@@ -23,6 +23,7 @@ FILE fqName:<root> fileName:/whenByFloatingPoint.kt
GET_VAR 'x: kotlin.Any declared in <root>.testSmartCastInWhenSubject' type=kotlin.Any origin=null
then: RETURN type=kotlin.Nothing from='public final fun testSmartCastInWhenSubject (x: kotlin.Any): kotlin.Int declared in <root>'
CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=1
RETURN type=kotlin.Nothing from='public final fun testSmartCastInWhenSubject (x: kotlin.Any): kotlin.Int declared in <root>'
BLOCK type=kotlin.Int origin=WHEN
VAR IR_TEMPORARY_VARIABLE name:tmp1_subject type:kotlin.Any [val]
@@ -45,6 +46,7 @@ FILE fqName:<root> fileName:/whenByFloatingPoint.kt
GET_VAR 'y: kotlin.Any declared in <root>.testSmartCastInWhenCondition' type=kotlin.Any origin=null
then: RETURN type=kotlin.Nothing from='public final fun testSmartCastInWhenCondition (x: kotlin.Double, y: kotlin.Any): kotlin.Int declared in <root>'
CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=1
RETURN type=kotlin.Nothing from='public final fun testSmartCastInWhenCondition (x: kotlin.Double, y: kotlin.Any): kotlin.Int declared in <root>'
BLOCK type=kotlin.Int origin=WHEN
VAR IR_TEMPORARY_VARIABLE name:tmp2_subject type:kotlin.Double [val]
@@ -68,6 +70,7 @@ FILE fqName:<root> fileName:/whenByFloatingPoint.kt
if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=kotlin.Double
GET_VAR 'val tmp3_subject: kotlin.Any [val] declared in <root>.testSmartCastInWhenConditionInBranch' type=kotlin.Any origin=null
then: CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=1
BRANCH
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'val tmp3_subject: kotlin.Any [val] declared in <root>.testSmartCastInWhenConditionInBranch' type=kotlin.Any origin=null
@@ -86,12 +89,14 @@ FILE fqName:<root> fileName:/whenByFloatingPoint.kt
GET_VAR 'x: kotlin.Any declared in <root>.testSmartCastToDifferentTypes' type=kotlin.Any origin=null
then: RETURN type=kotlin.Nothing from='public final fun testSmartCastToDifferentTypes (x: kotlin.Any, y: kotlin.Any): kotlin.Int declared in <root>'
CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=1
WHEN type=kotlin.Int origin=IF
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=kotlin.Float
GET_VAR 'y: kotlin.Any declared in <root>.testSmartCastToDifferentTypes' type=kotlin.Any origin=null
then: RETURN type=kotlin.Nothing from='public final fun testSmartCastToDifferentTypes (x: kotlin.Any, y: kotlin.Any): kotlin.Int declared in <root>'
CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=1
RETURN type=kotlin.Nothing from='public final fun testSmartCastToDifferentTypes (x: kotlin.Any, y: kotlin.Any): kotlin.Int declared in <root>'
BLOCK type=kotlin.Int origin=WHEN
VAR IR_TEMPORARY_VARIABLE name:tmp4_subject type:kotlin.Any [val]