Simplify IrElement hierarchy.
IrDeclaration can be now hosted under IrExpression (as IrStatement).
This commit is contained in:
committed by
Dmitry Petrov
parent
55eb79febf
commit
37cce98d19
@@ -1,7 +1,7 @@
|
||||
IrFile /callWithReorderedArguments.kt
|
||||
IrFunction public fun foo(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Unit
|
||||
IrExpressionBody
|
||||
BLOCK type=kotlin.Unit
|
||||
BLOCK type=kotlin.Unit hasResult=false isDesugared=false
|
||||
IrFunction public fun noReorder1(): kotlin.Int
|
||||
IrExpressionBody
|
||||
LITERAL Int type=kotlin.Int value='1'
|
||||
@@ -16,17 +16,15 @@ IrFile /callWithReorderedArguments.kt
|
||||
LITERAL Int type=kotlin.Int value='2'
|
||||
IrFunction public fun test(): kotlin.Unit
|
||||
IrExpressionBody
|
||||
BLOCK type=kotlin.Unit
|
||||
BLOCK type=kotlin.Unit hasResult=false isDesugared=false
|
||||
CALL .foo type=kotlin.Unit operator=
|
||||
a: CALL .noReorder1 type=kotlin.Int operator=
|
||||
b: CALL .noReorder2 type=kotlin.Int operator=
|
||||
BLOCK type=kotlin.Unit
|
||||
LOCAL tmp0
|
||||
IrLocalVariable val tmp0: kotlin.Int
|
||||
CALL .reordered1 type=kotlin.Int operator=
|
||||
LOCAL tmp1
|
||||
IrLocalVariable val tmp1: kotlin.Int
|
||||
CALL .reordered2 type=kotlin.Int operator=
|
||||
BLOCK type=kotlin.Unit hasResult=false isDesugared=true
|
||||
VAR val tmp0: kotlin.Int
|
||||
CALL .reordered1 type=kotlin.Int operator=
|
||||
VAR val tmp1: kotlin.Int
|
||||
CALL .reordered2 type=kotlin.Int operator=
|
||||
CALL .foo type=kotlin.Unit operator=
|
||||
a: GET_VAR tmp1 type=kotlin.Int
|
||||
b: GET_VAR tmp0 type=kotlin.Int
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
object A
|
||||
|
||||
object B {
|
||||
operator fun A.component1() = 1
|
||||
operator fun A.component2() = 2
|
||||
}
|
||||
|
||||
fun B.test() { // <<< destructuring1.txt
|
||||
val (x, y) = A
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
IrFunction public fun B.test(): kotlin.Unit
|
||||
IrExpressionBody
|
||||
BLOCK type=kotlin.Unit hasResult=false isDesugared=false
|
||||
DUMMY KtDestructuringDeclaration type=kotlin.Unit
|
||||
+3
-4
@@ -17,10 +17,9 @@ IrFile /references.kt
|
||||
GET_VAR x type=kotlin.String
|
||||
IrFunction public fun test3(): kotlin.String
|
||||
IrExpressionBody
|
||||
BLOCK type=kotlin.Nothing
|
||||
LOCAL x
|
||||
IrLocalVariable val x: kotlin.String = "OK"
|
||||
LITERAL String type=kotlin.String value='OK'
|
||||
BLOCK type=kotlin.Nothing hasResult=false isDesugared=false
|
||||
VAR val x: kotlin.String = "OK"
|
||||
LITERAL String type=kotlin.String value='OK'
|
||||
RETURN type=kotlin.Nothing
|
||||
GET_VAR x type=kotlin.String
|
||||
IrFunction public fun test4(): kotlin.String
|
||||
|
||||
Vendored
+2
-2
@@ -1,6 +1,6 @@
|
||||
// <<< smoke.txt
|
||||
fun testFun(): String { return "OK" }
|
||||
val testSimpleVal = 1 // <<< smoke.testSimpleVal.txt
|
||||
val testSimpleVal = 1
|
||||
val testValWithGetter: Int get() = 42
|
||||
var testSimpleVar = 2
|
||||
var testVarWithAccessors: Int
|
||||
@@ -13,4 +13,4 @@ var testVarWithAccessors: Int
|
||||
// 2 IrPropertyGetter
|
||||
// 1 IrPropertySetter
|
||||
// 1 IrProperty public var testSimpleVar
|
||||
// 1 IrProperty public var testVarWithAccessors
|
||||
// 1 IrProperty public var testVarWithAccessors
|
||||
@@ -1,3 +0,0 @@
|
||||
IrProperty public val testSimpleVal: kotlin.Int = 1 getter=null setter=null
|
||||
IrExpressionBody
|
||||
LITERAL Int type=kotlin.Int value='1'
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
IrFile /smoke.kt
|
||||
IrFunction public fun testFun(): kotlin.String
|
||||
IrExpressionBody
|
||||
BLOCK type=kotlin.Nothing
|
||||
BLOCK type=kotlin.Nothing hasResult=false isDesugared=false
|
||||
RETURN type=kotlin.Nothing
|
||||
LITERAL String type=kotlin.String value='OK'
|
||||
IrProperty public val testSimpleVal: kotlin.Int = 1 getter=null setter=null
|
||||
@@ -20,4 +20,4 @@ IrFile /smoke.kt
|
||||
LITERAL Int type=kotlin.Int value='42'
|
||||
IrPropertySetter public fun <set-testVarWithAccessors>(/*0*/ v: kotlin.Int): kotlin.Unit property=testVarWithAccessors
|
||||
IrExpressionBody
|
||||
BLOCK type=kotlin.Unit
|
||||
BLOCK type=kotlin.Unit hasResult=false isDesugared=false
|
||||
|
||||
Reference in New Issue
Block a user