Files
kotlin-fork/compiler/testData/ir/irText/expressions/kt28456b.fir.txt
T
Mark Punzalan a2a4d94834 [FIR] Capture array and indices for postfix/prefix increment/decrement
of array element (including overloaded indexed access operators, e.g.,
`a[b, c]++`).

This prevents double-evaluation of the array and indices expressions,
which may have side-effects.
2020-10-02 12:08:03 +03:00

89 lines
6.6 KiB
Plaintext
Vendored

FILE fqName:<root> fileName:/kt28456b.kt
CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.A
CONSTRUCTOR visibility:public <> () returnType:<root>.A [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]'
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN name:get visibility:public modality:FINAL <> ($receiver:<root>.A, i:kotlin.Int, a:kotlin.Int, b:kotlin.Int, c:kotlin.Int, d:kotlin.Int) returnType:kotlin.Int [operator]
$receiver: VALUE_PARAMETER name:<this> type:<root>.A
VALUE_PARAMETER name:i index:0 type:kotlin.Int
VALUE_PARAMETER name:a index:1 type:kotlin.Int
EXPRESSION_BODY
CONST Int type=kotlin.Int value=1
VALUE_PARAMETER name:b index:2 type:kotlin.Int
EXPRESSION_BODY
CONST Int type=kotlin.Int value=2
VALUE_PARAMETER name:c index:3 type:kotlin.Int
EXPRESSION_BODY
CONST Int type=kotlin.Int value=3
VALUE_PARAMETER name:d index:4 type:kotlin.Int
EXPRESSION_BODY
CONST Int type=kotlin.Int value=4
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun get (i: kotlin.Int, a: kotlin.Int, b: kotlin.Int, c: kotlin.Int, d: kotlin.Int): kotlin.Int [operator] declared in <root>'
CONST Int type=kotlin.Int value=0
FUN name:set visibility:public modality:FINAL <> ($receiver:<root>.A, i:kotlin.Int, j:kotlin.Int, v:kotlin.Int) returnType:kotlin.Unit [operator]
$receiver: VALUE_PARAMETER name:<this> type:<root>.A
VALUE_PARAMETER name:i index:0 type:kotlin.Int
VALUE_PARAMETER name:j index:1 type:kotlin.Int
EXPRESSION_BODY
CONST Int type=kotlin.Int value=42
VALUE_PARAMETER name:v index:2 type:kotlin.Int
BLOCK_BODY
FUN name:testSimpleAssignment visibility:public modality:FINAL <> (a:<root>.A) returnType:kotlin.Unit
VALUE_PARAMETER name:a index:0 type:<root>.A
BLOCK_BODY
CALL 'public final fun set (i: kotlin.Int, j: kotlin.Int, v: kotlin.Int): kotlin.Unit [operator] declared in <root>' type=kotlin.Unit origin=null
$receiver: GET_VAR 'a: <root>.A declared in <root>.testSimpleAssignment' type=<root>.A origin=null
i: CONST Int type=kotlin.Int value=1
v: CONST Int type=kotlin.Int value=0
FUN name:testPostfixIncrement visibility:public modality:FINAL <> (a:<root>.A) returnType:kotlin.Int
VALUE_PARAMETER name:a index:0 type:<root>.A
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun testPostfixIncrement (a: <root>.A): kotlin.Int declared in <root>'
BLOCK type=kotlin.Int origin=null
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:<root>.A [val]
GET_VAR 'a: <root>.A declared in <root>.testPostfixIncrement' type=<root>.A origin=null
VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Int [val]
CONST Int type=kotlin.Int value=1
VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.Int [val]
CALL 'public final fun get (i: kotlin.Int, a: kotlin.Int, b: kotlin.Int, c: kotlin.Int, d: kotlin.Int): kotlin.Int [operator] declared in <root>' type=kotlin.Int origin=null
$receiver: GET_VAR 'val tmp_0: <root>.A [val] declared in <root>.testPostfixIncrement' type=<root>.A origin=null
i: GET_VAR 'val tmp_1: kotlin.Int [val] declared in <root>.testPostfixIncrement' type=kotlin.Int origin=null
CALL 'public final fun set (i: kotlin.Int, j: kotlin.Int, v: kotlin.Int): kotlin.Unit [operator] declared in <root>' type=kotlin.Unit origin=null
$receiver: GET_VAR 'val tmp_0: <root>.A [val] declared in <root>.testPostfixIncrement' type=<root>.A origin=null
i: GET_VAR 'val tmp_1: kotlin.Int [val] declared in <root>.testPostfixIncrement' type=kotlin.Int origin=null
v: CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
$this: GET_VAR 'val tmp_2: kotlin.Int [val] declared in <root>.testPostfixIncrement' type=kotlin.Int origin=null
GET_VAR 'val tmp_2: kotlin.Int [val] declared in <root>.testPostfixIncrement' type=kotlin.Int origin=null
FUN name:testCompoundAssignment visibility:public modality:FINAL <> (a:<root>.A) returnType:kotlin.Unit
VALUE_PARAMETER name:a index:0 type:<root>.A
BLOCK_BODY
BLOCK type=kotlin.Unit origin=null
VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:<root>.A [val]
GET_VAR 'a: <root>.A declared in <root>.testCompoundAssignment' type=<root>.A origin=null
VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.Int [val]
CONST Int type=kotlin.Int value=1
CALL 'public final fun set (i: kotlin.Int, j: kotlin.Int, v: kotlin.Int): kotlin.Unit [operator] declared in <root>' type=kotlin.Unit origin=null
$receiver: GET_VAR 'val tmp_3: <root>.A [val] declared in <root>.testCompoundAssignment' type=<root>.A origin=null
i: GET_VAR 'val tmp_4: kotlin.Int [val] declared in <root>.testCompoundAssignment' type=kotlin.Int origin=null
v: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
$this: CALL 'public final fun get (i: kotlin.Int, a: kotlin.Int, b: kotlin.Int, c: kotlin.Int, d: kotlin.Int): kotlin.Int [operator] declared in <root>' type=kotlin.Int origin=null
$receiver: GET_VAR 'val tmp_3: <root>.A [val] declared in <root>.testCompoundAssignment' type=<root>.A origin=null
i: GET_VAR 'val tmp_4: kotlin.Int [val] declared in <root>.testCompoundAssignment' type=kotlin.Int origin=null
other: CONST Int type=kotlin.Int value=10