Generate "raw" IR in Psi2IrTranslator.

This commit is contained in:
Dmitry Petrov
2016-08-29 19:29:33 +03:00
committed by Dmitry Petrov
parent ba85e714e3
commit 05b9eda809
23 changed files with 306 additions and 368 deletions
@@ -24,13 +24,17 @@ FILE /arrayAugmentedAssignment1.kt
VAR var x: kotlin.IntArray
CALL .foo type=kotlin.IntArray operator=null
BLOCK type=kotlin.Unit operator=PLUSEQ
VAR val tmp0_array: kotlin.IntArray
GET_VAR x type=kotlin.IntArray operator=null
VAR val tmp1_index0: kotlin.Int
CONST Int type=kotlin.Int value='0'
CALL .set type=kotlin.Unit operator=PLUSEQ
$this: GET_VAR x type=kotlin.IntArray operator=null
index: CONST Int type=kotlin.Int value='0'
$this: GET_VAR tmp0_array type=kotlin.IntArray operator=null
index: GET_VAR tmp1_index0 type=kotlin.Int operator=null
value: CALL .plus type=kotlin.Int operator=PLUSEQ
$this: CALL .get type=kotlin.Int operator=PLUSEQ
$this: GET_VAR x type=kotlin.IntArray operator=null
index: CONST Int type=kotlin.Int value='0'
$this: GET_VAR tmp0_array type=kotlin.IntArray operator=null
index: GET_VAR tmp1_index0 type=kotlin.Int operator=null
other: CONST Int type=kotlin.Int value='1'
FUN public fun testCall(): kotlin.Unit
BLOCK_BODY
@@ -53,13 +57,15 @@ FILE /arrayAugmentedAssignment1.kt
VAR val tmp0_array: kotlin.IntArray
CALL .<get-x> type=kotlin.IntArray operator=GET_PROPERTY
$this: GET_VAR c type=C operator=null
VAR val tmp1: kotlin.Int
VAR val tmp1_index0: kotlin.Int
CONST Int type=kotlin.Int value='0'
VAR val tmp2: kotlin.Int
CALL .get type=kotlin.Int operator=POSTFIX_INCR
$this: GET_VAR tmp0_array type=kotlin.IntArray operator=null
index: CONST Int type=kotlin.Int value='0'
index: GET_VAR tmp1_index0 type=kotlin.Int operator=null
CALL .set type=kotlin.Unit operator=POSTFIX_INCR
$this: GET_VAR tmp0_array type=kotlin.IntArray operator=null
index: CONST Int type=kotlin.Int value='0'
index: GET_VAR tmp1_index0 type=kotlin.Int operator=null
value: CALL .inc type=kotlin.Int operator=POSTFIX_INCR
$this: GET_VAR tmp1 type=kotlin.Int operator=null
GET_VAR tmp1 type=kotlin.Int operator=null
$this: GET_VAR tmp2 type=kotlin.Int operator=null
GET_VAR tmp2 type=kotlin.Int operator=null
@@ -6,12 +6,16 @@ FILE /arrayAugmentedAssignment2.kt
FUN public fun IB.test(/*0*/ a: IA): kotlin.Unit
BLOCK_BODY
BLOCK type=kotlin.Unit operator=PLUSEQ
VAR val tmp0_array: IA
GET_VAR a type=IA operator=null
VAR val tmp1_index0: kotlin.String
CONST String type=kotlin.String value=''
CALL .set type=kotlin.Unit operator=PLUSEQ
$this: $RECEIVER of: test type=IB
$receiver: GET_VAR a type=IA operator=null
index: CONST String type=kotlin.String value=''
$receiver: GET_VAR tmp0_array type=IA operator=null
index: GET_VAR tmp1_index0 type=kotlin.String operator=null
value: CALL .plus type=kotlin.Int operator=PLUSEQ
$this: CALL .get type=kotlin.Int operator=PLUSEQ
$this: GET_VAR a type=IA operator=null
index: CONST String type=kotlin.String value=''
$this: GET_VAR tmp0_array type=IA operator=null
index: GET_VAR tmp1_index0 type=kotlin.String operator=null
other: CONST Int type=kotlin.Int value='42'
+19 -13
View File
@@ -2,24 +2,30 @@ FILE /bangbang.kt
FUN public fun test1(/*0*/ a: kotlin.Any?): kotlin.Any
BLOCK_BODY
RETURN type=kotlin.Nothing from=test1
WHEN type=kotlin.Any operator=null
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR a type=kotlin.Any? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null'
then: CALL .THROW_NPE type=kotlin.Nothing operator=EXCLEXCL
else: GET_VAR a type=kotlin.Any? operator=null
BLOCK type=kotlin.Any operator=EXCLEXCL
VAR val tmp0_notnull: kotlin.Any?
GET_VAR a type=kotlin.Any? operator=null
WHEN type=kotlin.Any operator=null
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR tmp0_notnull type=kotlin.Any? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null'
then: CALL .THROW_NPE type=kotlin.Nothing operator=EXCLEXCL
else: GET_VAR tmp0_notnull type=kotlin.Any? operator=null
FUN public fun test2(/*0*/ a: kotlin.Any?): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from=test2
BLOCK type=kotlin.Int operator=EXCLEXCL
VAR val tmp1_notnull: kotlin.Int?
WHEN type=kotlin.Int? operator=SAFE_CALL
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR a type=kotlin.Any? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null'
else: CALL .hashCode type=kotlin.Int operator=null
$this: GET_VAR a type=kotlin.Any? operator=null
BLOCK type=kotlin.Int? operator=SAFE_CALL
VAR val tmp0_safe_receiver: kotlin.Any?
GET_VAR a type=kotlin.Any? operator=null
WHEN type=kotlin.Int? operator=SAFE_CALL
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR tmp0_safe_receiver type=kotlin.Any? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null'
else: CALL .hashCode type=kotlin.Int operator=null
$this: GET_VAR tmp0_safe_receiver type=kotlin.Any? operator=null
WHEN type=kotlin.Int operator=null
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR tmp1_notnull type=kotlin.Int? operator=null
@@ -31,8 +31,10 @@ FILE /callWithReorderedArguments.kt
a: GET_VAR tmp1_a type=kotlin.Int operator=null
b: GET_VAR tmp0_b type=kotlin.Int operator=null
BLOCK type=kotlin.Unit operator=ARGUMENTS_REORDERING_FOR_CALL
VAR val tmp2_a: kotlin.Int
VAR val tmp2_b: kotlin.Int
CONST Int type=kotlin.Int value='1'
VAR val tmp3_a: kotlin.Int
CALL .reordered2 type=kotlin.Int operator=null
CALL .foo type=kotlin.Unit operator=null
a: GET_VAR tmp2_a type=kotlin.Int operator=null
b: CONST Int type=kotlin.Int value='1'
a: GET_VAR tmp3_a type=kotlin.Int operator=null
b: GET_VAR tmp2_b type=kotlin.Int operator=null
+31 -12
View File
@@ -14,20 +14,39 @@ FILE /chainOfSafeCalls.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from=test
BLOCK type=C? operator=SAFE_CALL
VAR val tmp2_safe_receiver: C?
WHEN type=C? operator=SAFE_CALL
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR nc type=C? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null'
else: CALL .bar type=C? operator=null
$this: CALL .foo type=C operator=null
$this: GET_VAR nc type=C? operator=null
VAR val tmp3_safe_receiver: C?
BLOCK type=C? operator=SAFE_CALL
VAR val tmp2_safe_receiver: C?
BLOCK type=C? operator=SAFE_CALL
VAR val tmp1_safe_receiver: C?
BLOCK type=C? operator=SAFE_CALL
VAR val tmp0_safe_receiver: C?
GET_VAR nc type=C? operator=null
WHEN type=C? operator=SAFE_CALL
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR tmp0_safe_receiver type=C? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null'
else: CALL .foo type=C operator=null
$this: GET_VAR tmp0_safe_receiver type=C? operator=null
WHEN type=C? operator=SAFE_CALL
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR tmp1_safe_receiver type=C? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null'
else: CALL .bar type=C? operator=null
$this: GET_VAR tmp1_safe_receiver type=C? operator=null
WHEN type=C? operator=SAFE_CALL
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR tmp2_safe_receiver type=C? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null'
else: CALL .foo type=C operator=null
$this: GET_VAR tmp2_safe_receiver type=C? operator=null
WHEN type=C? operator=SAFE_CALL
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR tmp2_safe_receiver type=C? operator=null
arg0: GET_VAR tmp3_safe_receiver type=C? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null'
else: CALL .foo type=C operator=null
$this: CALL .foo type=C operator=null
$this: GET_VAR tmp2_safe_receiver type=C? operator=null
$this: GET_VAR tmp3_safe_receiver type=C? operator=null
+10 -7
View File
@@ -7,10 +7,13 @@ FILE /dotQualified.kt
FUN public fun lengthN(/*0*/ s: kotlin.String?): kotlin.Int?
BLOCK_BODY
RETURN type=kotlin.Nothing from=lengthN
WHEN type=kotlin.Int? operator=SAFE_CALL
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR s type=kotlin.String? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null'
else: CALL .<get-length> type=kotlin.Int operator=GET_PROPERTY
$this: GET_VAR s type=kotlin.String? operator=null
BLOCK type=kotlin.Int? operator=SAFE_CALL
VAR val tmp0_safe_receiver: kotlin.String?
GET_VAR s type=kotlin.String? operator=null
WHEN type=kotlin.Int? operator=SAFE_CALL
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR tmp0_safe_receiver type=kotlin.String? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null'
else: CALL .<get-length> type=kotlin.Int operator=GET_PROPERTY
$this: GET_VAR tmp0_safe_receiver type=kotlin.String? operator=null
+12 -6
View File
@@ -10,22 +10,26 @@ FILE /elvis.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from=test1
BLOCK type=kotlin.Any operator=ELVIS
VAR val tmp0_elvis_lhs: kotlin.Any?
GET_VAR a type=kotlin.Any? operator=null
WHEN type=kotlin.Any operator=null
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR a type=kotlin.Any? operator=null
arg0: GET_VAR tmp0_elvis_lhs type=kotlin.Any? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null'
then: GET_VAR b type=kotlin.Any operator=null
else: GET_VAR a type=kotlin.Any? operator=null
else: GET_VAR tmp0_elvis_lhs type=kotlin.Any? operator=null
FUN public fun test2(/*0*/ a: kotlin.String?, /*1*/ b: kotlin.Any): kotlin.Any
BLOCK_BODY
RETURN type=kotlin.Nothing from=test2
BLOCK type=kotlin.Any operator=ELVIS
VAR val tmp0_elvis_lhs: kotlin.String?
GET_VAR a type=kotlin.String? operator=null
WHEN type=kotlin.Any operator=null
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR a type=kotlin.String? operator=null
arg0: GET_VAR tmp0_elvis_lhs type=kotlin.String? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null'
then: GET_VAR b type=kotlin.Any operator=null
else: GET_VAR a type=kotlin.String? operator=null
else: GET_VAR tmp0_elvis_lhs type=kotlin.String? operator=null
FUN public fun test3(/*0*/ a: kotlin.Any?, /*1*/ b: kotlin.Any?): kotlin.String
BLOCK_BODY
WHEN type=kotlin.Unit operator=IF
@@ -40,14 +44,16 @@ FILE /elvis.kt
CONST String type=kotlin.String value=''
RETURN type=kotlin.Nothing from=test3
BLOCK type=kotlin.String operator=ELVIS
VAR val tmp0_elvis_lhs: kotlin.Any?
GET_VAR a type=kotlin.Any? operator=null
WHEN type=kotlin.String operator=null
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR a type=kotlin.Any? operator=null
arg0: GET_VAR tmp0_elvis_lhs type=kotlin.Any? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null'
then: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.String
GET_VAR b type=kotlin.Any? operator=null
else: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.String
GET_VAR a type=kotlin.Any? operator=null
GET_VAR tmp0_elvis_lhs type=kotlin.Any? operator=null
FUN public fun test4(/*0*/ x: kotlin.Any): kotlin.Any
BLOCK_BODY
RETURN type=kotlin.Nothing from=test4
@@ -91,57 +91,65 @@ FILE /incrementDecrement.kt
BLOCK type=kotlin.Int operator=PREFIX_INCR
VAR val tmp0_array: kotlin.IntArray
CALL .<get-arr> type=kotlin.IntArray operator=GET_PROPERTY
VAR val tmp1: kotlin.Int
VAR val tmp1_index0: kotlin.Int
CONST Int type=kotlin.Int value='0'
VAR val tmp2: kotlin.Int
CALL .inc type=kotlin.Int operator=PREFIX_INCR
$this: CALL .get type=kotlin.Int operator=PREFIX_INCR
$this: GET_VAR tmp0_array type=kotlin.IntArray operator=null
index: CONST Int type=kotlin.Int value='0'
index: GET_VAR tmp1_index0 type=kotlin.Int operator=null
CALL .set type=kotlin.Unit operator=PREFIX_INCR
$this: GET_VAR tmp0_array type=kotlin.IntArray operator=null
index: CONST Int type=kotlin.Int value='0'
value: GET_VAR tmp1 type=kotlin.Int operator=null
GET_VAR tmp1 type=kotlin.Int operator=null
index: GET_VAR tmp1_index0 type=kotlin.Int operator=null
value: GET_VAR tmp2 type=kotlin.Int operator=null
GET_VAR tmp2 type=kotlin.Int operator=null
VAR val a2: kotlin.Int
BLOCK type=kotlin.Int operator=PREFIX_DECR
VAR val tmp2_array: kotlin.IntArray
VAR val tmp3_array: kotlin.IntArray
CALL .<get-arr> type=kotlin.IntArray operator=GET_PROPERTY
VAR val tmp3: kotlin.Int
VAR val tmp4_index0: kotlin.Int
CONST Int type=kotlin.Int value='0'
VAR val tmp5: kotlin.Int
CALL .dec type=kotlin.Int operator=PREFIX_DECR
$this: CALL .get type=kotlin.Int operator=PREFIX_DECR
$this: GET_VAR tmp2_array type=kotlin.IntArray operator=null
index: CONST Int type=kotlin.Int value='0'
$this: GET_VAR tmp3_array type=kotlin.IntArray operator=null
index: GET_VAR tmp4_index0 type=kotlin.Int operator=null
CALL .set type=kotlin.Unit operator=PREFIX_DECR
$this: GET_VAR tmp2_array type=kotlin.IntArray operator=null
index: CONST Int type=kotlin.Int value='0'
value: GET_VAR tmp3 type=kotlin.Int operator=null
GET_VAR tmp3 type=kotlin.Int operator=null
$this: GET_VAR tmp3_array type=kotlin.IntArray operator=null
index: GET_VAR tmp4_index0 type=kotlin.Int operator=null
value: GET_VAR tmp5 type=kotlin.Int operator=null
GET_VAR tmp5 type=kotlin.Int operator=null
FUN public fun testArrayPostfix(): kotlin.Unit
BLOCK_BODY
VAR val a1: kotlin.Int
BLOCK type=kotlin.Int operator=POSTFIX_INCR
VAR val tmp0_array: kotlin.IntArray
CALL .<get-arr> type=kotlin.IntArray operator=GET_PROPERTY
VAR val tmp1: kotlin.Int
VAR val tmp1_index0: kotlin.Int
CONST Int type=kotlin.Int value='0'
VAR val tmp2: kotlin.Int
CALL .get type=kotlin.Int operator=POSTFIX_INCR
$this: GET_VAR tmp0_array type=kotlin.IntArray operator=null
index: CONST Int type=kotlin.Int value='0'
index: GET_VAR tmp1_index0 type=kotlin.Int operator=null
CALL .set type=kotlin.Unit operator=POSTFIX_INCR
$this: GET_VAR tmp0_array type=kotlin.IntArray operator=null
index: CONST Int type=kotlin.Int value='0'
index: GET_VAR tmp1_index0 type=kotlin.Int operator=null
value: CALL .inc type=kotlin.Int operator=POSTFIX_INCR
$this: GET_VAR tmp1 type=kotlin.Int operator=null
GET_VAR tmp1 type=kotlin.Int operator=null
$this: GET_VAR tmp2 type=kotlin.Int operator=null
GET_VAR tmp2 type=kotlin.Int operator=null
VAR val a2: kotlin.Int
BLOCK type=kotlin.Int operator=POSTFIX_DECR
VAR val tmp2_array: kotlin.IntArray
VAR val tmp3_array: kotlin.IntArray
CALL .<get-arr> type=kotlin.IntArray operator=GET_PROPERTY
VAR val tmp3: kotlin.Int
VAR val tmp4_index0: kotlin.Int
CONST Int type=kotlin.Int value='0'
VAR val tmp5: kotlin.Int
CALL .get type=kotlin.Int operator=POSTFIX_DECR
$this: GET_VAR tmp2_array type=kotlin.IntArray operator=null
index: CONST Int type=kotlin.Int value='0'
$this: GET_VAR tmp3_array type=kotlin.IntArray operator=null
index: GET_VAR tmp4_index0 type=kotlin.Int operator=null
CALL .set type=kotlin.Unit operator=POSTFIX_DECR
$this: GET_VAR tmp2_array type=kotlin.IntArray operator=null
index: CONST Int type=kotlin.Int value='0'
$this: GET_VAR tmp3_array type=kotlin.IntArray operator=null
index: GET_VAR tmp4_index0 type=kotlin.Int operator=null
value: CALL .dec type=kotlin.Int operator=POSTFIX_DECR
$this: GET_VAR tmp3 type=kotlin.Int operator=null
GET_VAR tmp3 type=kotlin.Int operator=null
$this: GET_VAR tmp5 type=kotlin.Int operator=null
GET_VAR tmp5 type=kotlin.Int operator=null
@@ -0,0 +1,3 @@
fun test1() {
// System.out.println("test1")
}
@@ -12,13 +12,16 @@ FILE /safeCallWithIncrementDecrement.kt
FUN public operator fun kotlin.Int?.inc(): kotlin.Int?
BLOCK_BODY
RETURN type=kotlin.Nothing from=inc
WHEN type=kotlin.Int? operator=SAFE_CALL
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: $RECEIVER of: inc type=kotlin.Int?
arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null'
else: CALL .inc type=kotlin.Int operator=null
$this: $RECEIVER of: inc type=kotlin.Int?
BLOCK type=kotlin.Int? operator=SAFE_CALL
VAR val tmp0_safe_receiver: kotlin.Int?
$RECEIVER of: inc type=kotlin.Int?
WHEN type=kotlin.Int? operator=SAFE_CALL
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR tmp0_safe_receiver type=kotlin.Int? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null'
else: CALL .inc type=kotlin.Int operator=null
$this: GET_VAR tmp0_safe_receiver type=kotlin.Int? operator=null
FUN public operator fun kotlin.Int?.get(/*0*/ index: kotlin.Int): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from=get
@@ -27,38 +30,46 @@ FILE /safeCallWithIncrementDecrement.kt
BLOCK_BODY
FUN public fun testProperty(/*0*/ nc: test.C?): kotlin.Unit
BLOCK_BODY
WHEN type=kotlin.Int? operator=SAFE_CALL
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR nc type=test.C? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null'
else: BLOCK type=kotlin.Int operator=POSTFIX_INCR
VAR val tmp1: kotlin.Int
CALL .<get-p> type=kotlin.Int operator=POSTFIX_INCR
$this: GET_VAR nc type=test.C? operator=null
CALL .<set-p> type=kotlin.Unit operator=POSTFIX_INCR
$this: GET_VAR nc type=test.C? operator=null
value: CALL .inc type=kotlin.Int? operator=POSTFIX_INCR
$receiver: GET_VAR tmp1 type=kotlin.Int operator=null
GET_VAR tmp1 type=kotlin.Int operator=null
BLOCK type=kotlin.Int? operator=SAFE_CALL
VAR val tmp0_safe_receiver: test.C?
GET_VAR nc type=test.C? operator=null
WHEN type=kotlin.Int? operator=SAFE_CALL
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR tmp0_safe_receiver type=test.C? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null'
else: BLOCK type=kotlin.Int operator=POSTFIX_INCR
VAR val tmp1: kotlin.Int
CALL .<get-p> type=kotlin.Int operator=POSTFIX_INCR
$this: GET_VAR tmp0_safe_receiver type=test.C? operator=null
CALL .<set-p> type=kotlin.Unit operator=POSTFIX_INCR
$this: GET_VAR tmp0_safe_receiver type=test.C? operator=null
value: CALL .inc type=kotlin.Int? operator=POSTFIX_INCR
$receiver: GET_VAR tmp1 type=kotlin.Int operator=null
GET_VAR tmp1 type=kotlin.Int operator=null
FUN public fun testArrayAccess(/*0*/ nc: test.C?): kotlin.Unit
BLOCK_BODY
BLOCK type=kotlin.Int operator=POSTFIX_INCR
VAR val tmp3_array: kotlin.Int?
WHEN type=kotlin.Int? operator=SAFE_CALL
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR nc type=test.C? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null'
else: CALL .<get-p> type=kotlin.Int operator=GET_PROPERTY
$this: GET_VAR nc type=test.C? operator=null
VAR val tmp4: kotlin.Int
BLOCK type=kotlin.Int? operator=SAFE_CALL
VAR val tmp0_safe_receiver: test.C?
GET_VAR nc type=test.C? operator=null
WHEN type=kotlin.Int? operator=SAFE_CALL
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR tmp0_safe_receiver type=test.C? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null'
else: CALL .<get-p> type=kotlin.Int operator=GET_PROPERTY
$this: GET_VAR tmp0_safe_receiver type=test.C? operator=null
VAR val tmp4_index0: kotlin.Int
CONST Int type=kotlin.Int value='0'
VAR val tmp5: kotlin.Int
CALL .get type=kotlin.Int operator=POSTFIX_INCR
$receiver: GET_VAR tmp3_array type=kotlin.Int? operator=null
index: CONST Int type=kotlin.Int value='0'
index: GET_VAR tmp4_index0 type=kotlin.Int operator=null
CALL .set type=kotlin.Unit operator=POSTFIX_INCR
$receiver: GET_VAR tmp3_array type=kotlin.Int? operator=null
index: CONST Int type=kotlin.Int value='0'
index: GET_VAR tmp4_index0 type=kotlin.Int operator=null
value: CALL .inc type=kotlin.Int operator=POSTFIX_INCR
$this: GET_VAR tmp4 type=kotlin.Int operator=null
GET_VAR tmp4 type=kotlin.Int operator=null
$this: GET_VAR tmp5 type=kotlin.Int operator=null
GET_VAR tmp5 type=kotlin.Int operator=null
+53 -38
View File
@@ -16,52 +16,67 @@ FILE /safeCalls.kt
FUN public fun test1(/*0*/ x: kotlin.String?): kotlin.Int?
BLOCK_BODY
RETURN type=kotlin.Nothing from=test1
WHEN type=kotlin.Int? operator=SAFE_CALL
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR x type=kotlin.String? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null'
else: CALL .<get-length> type=kotlin.Int operator=GET_PROPERTY
$this: GET_VAR x type=kotlin.String? operator=null
BLOCK type=kotlin.Int? operator=SAFE_CALL
VAR val tmp0_safe_receiver: kotlin.String?
GET_VAR x type=kotlin.String? operator=null
WHEN type=kotlin.Int? operator=SAFE_CALL
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR tmp0_safe_receiver type=kotlin.String? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null'
else: CALL .<get-length> type=kotlin.Int operator=GET_PROPERTY
$this: GET_VAR tmp0_safe_receiver type=kotlin.String? operator=null
FUN public fun test2(/*0*/ x: kotlin.String?): kotlin.Int?
BLOCK_BODY
RETURN type=kotlin.Nothing from=test2
WHEN type=kotlin.Int? operator=SAFE_CALL
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR x type=kotlin.String? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null'
else: CALL .hashCode type=kotlin.Int operator=null
$this: GET_VAR x type=kotlin.String? operator=null
BLOCK type=kotlin.Int? operator=SAFE_CALL
VAR val tmp0_safe_receiver: kotlin.String?
GET_VAR x type=kotlin.String? operator=null
WHEN type=kotlin.Int? operator=SAFE_CALL
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR tmp0_safe_receiver type=kotlin.String? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null'
else: CALL .hashCode type=kotlin.Int operator=null
$this: GET_VAR tmp0_safe_receiver type=kotlin.String? operator=null
FUN public fun test3(/*0*/ x: kotlin.String?, /*1*/ y: kotlin.Any?): kotlin.Boolean?
BLOCK_BODY
RETURN type=kotlin.Nothing from=test3
WHEN type=kotlin.Boolean? operator=SAFE_CALL
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR x type=kotlin.String? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null'
else: CALL .equals type=kotlin.Boolean operator=null
$this: GET_VAR x type=kotlin.String? operator=null
other: GET_VAR y type=kotlin.Any? operator=null
BLOCK type=kotlin.Boolean? operator=SAFE_CALL
VAR val tmp0_safe_receiver: kotlin.String?
GET_VAR x type=kotlin.String? operator=null
WHEN type=kotlin.Boolean? operator=SAFE_CALL
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR tmp0_safe_receiver type=kotlin.String? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null'
else: CALL .equals type=kotlin.Boolean operator=null
$this: GET_VAR tmp0_safe_receiver type=kotlin.String? operator=null
other: GET_VAR y type=kotlin.Any? operator=null
FUN public fun test4(/*0*/ x: Ref?): kotlin.Unit
BLOCK_BODY
WHEN type=kotlin.Unit? operator=SAFE_CALL
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR x type=Ref? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null'
else: CALL .<set-value> type=kotlin.Unit operator=EQ
$this: GET_VAR x type=Ref? operator=null
<set-?>: CONST Int type=kotlin.Int value='0'
BLOCK type=kotlin.Unit? operator=SAFE_CALL
VAR val tmp0_safe_receiver: Ref?
GET_VAR x type=Ref? operator=null
WHEN type=kotlin.Unit? operator=SAFE_CALL
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR tmp0_safe_receiver type=Ref? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null'
else: CALL .<set-value> type=kotlin.Unit operator=EQ
$this: GET_VAR tmp0_safe_receiver type=Ref? operator=null
<set-?>: CONST Int type=kotlin.Int value='0'
FUN public fun IHost.test5(/*0*/ s: kotlin.String?): kotlin.Int?
BLOCK_BODY
RETURN type=kotlin.Nothing from=test5
WHEN type=kotlin.Int? operator=SAFE_CALL
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR s type=kotlin.String? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null'
else: CALL .extLength type=kotlin.Int operator=null
$this: $RECEIVER of: test5 type=IHost
$receiver: GET_VAR s type=kotlin.String? operator=null
BLOCK type=kotlin.Int? operator=SAFE_CALL
VAR val tmp0_safe_receiver: kotlin.String?
GET_VAR s type=kotlin.String? operator=null
WHEN type=kotlin.Int? operator=SAFE_CALL
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR tmp0_safe_receiver type=kotlin.String? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null'
else: CALL .extLength type=kotlin.Int operator=null
$this: $RECEIVER of: test5 type=IHost
$receiver: GET_VAR tmp0_safe_receiver type=kotlin.String? operator=null
@@ -16,10 +16,12 @@ FILE /smartCastsWithDestructuring.kt
GET_VAR x type=I1 operator=null
then: RETURN type=kotlin.Nothing from=test
BLOCK type=kotlin.Unit operator=DESTRUCTURING_DECLARATION
VAR val tmp0_container: I1
GET_VAR x type=I1 operator=null
VAR val c1: kotlin.Int
CALL .component1 type=kotlin.Int operator=COMPONENT_N(index=1)
$receiver: GET_VAR x type=I1 operator=null
$receiver: GET_VAR tmp0_container type=I1 operator=null
VAR val c2: kotlin.String
CALL .component2 type=kotlin.String operator=COMPONENT_N(index=2)
$receiver: TYPE_OP operator=IMPLICIT_CAST typeOperand=I2
GET_VAR x type=I1 operator=null
GET_VAR tmp0_container type=I1 operator=null
+17 -14
View File
@@ -2,23 +2,26 @@ FILE /stringPlus.kt
FUN public fun test1(/*0*/ a: kotlin.String, /*1*/ b: kotlin.Any): kotlin.String
BLOCK_BODY
RETURN type=kotlin.Nothing from=test1
STRING_CONCATENATION type=kotlin.String
GET_VAR a type=kotlin.String operator=null
GET_VAR b type=kotlin.Any operator=null
CALL .plus type=kotlin.String operator=PLUS
$this: GET_VAR a type=kotlin.String operator=null
other: GET_VAR b type=kotlin.Any operator=null
FUN public fun test2(/*0*/ a: kotlin.String, /*1*/ b: kotlin.Int): kotlin.String
BLOCK_BODY
RETURN type=kotlin.Nothing from=test2
STRING_CONCATENATION type=kotlin.String
GET_VAR a type=kotlin.String operator=null
CONST String type=kotlin.String value='+'
GET_VAR b type=kotlin.Int operator=null
CALL .plus type=kotlin.String operator=PLUS
$this: CALL .plus type=kotlin.String operator=PLUS
$this: GET_VAR a type=kotlin.String operator=null
other: CONST String type=kotlin.String value='+'
other: GET_VAR b type=kotlin.Int operator=null
FUN public fun test3(/*0*/ a: kotlin.String, /*1*/ b: kotlin.Int): kotlin.String
BLOCK_BODY
RETURN type=kotlin.Nothing from=test3
STRING_CONCATENATION type=kotlin.String
GET_VAR a type=kotlin.String operator=null
CONST String type=kotlin.String value='+'
CALL .plus type=kotlin.Int operator=PLUS
$this: GET_VAR b type=kotlin.Int operator=null
other: CONST Int type=kotlin.Int value='1'
GET_VAR a type=kotlin.String operator=null
CALL .plus type=kotlin.String operator=PLUS
$this: CALL .plus type=kotlin.String operator=PLUS
$this: CALL .plus type=kotlin.String operator=PLUS
$this: GET_VAR a type=kotlin.String operator=null
other: CONST String type=kotlin.String value='+'
other: CALL .plus type=kotlin.Int operator=PLUS
$this: GET_VAR b type=kotlin.Int operator=null
other: CONST Int type=kotlin.Int value='1'
other: GET_VAR a type=kotlin.String operator=null
@@ -28,11 +28,22 @@ FILE /variableAsFunctionCall.kt
FUN public fun test4(/*0*/ ns: kotlin.String?): kotlin.String?
BLOCK_BODY
RETURN type=kotlin.Nothing from=test4
WHEN type=kotlin.String? operator=SAFE_CALL
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR ns type=kotlin.String? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null'
else: CALL .invoke type=kotlin.String operator=null
$this: CALL .k type=() -> kotlin.String operator=null
$this: GET_VAR ns type=kotlin.String? operator=null
BLOCK type=kotlin.String? operator=SAFE_CALL
VAR val tmp1_safe_receiver: (() -> kotlin.String)?
BLOCK type=(() -> kotlin.String)? operator=SAFE_CALL
VAR val tmp0_safe_receiver: kotlin.String?
GET_VAR ns type=kotlin.String? operator=null
WHEN type=(() -> kotlin.String)? operator=SAFE_CALL
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR tmp0_safe_receiver type=kotlin.String? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null'
else: CALL .k type=() -> kotlin.String operator=null
$this: GET_VAR tmp0_safe_receiver type=kotlin.String? operator=null
WHEN type=kotlin.String? operator=SAFE_CALL
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR tmp1_safe_receiver type=(() -> kotlin.String)? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null'
else: CALL .invoke type=kotlin.String operator=null
$this: GET_VAR tmp1_safe_receiver type=(() -> kotlin.String)? operator=null