Standardize context receiver parameter names

Previously, FIR used `_context_receiver_n` while FE10 used `<this>` for
all context receiver parameters. This commit changes the code in FE10
to follow the convention from FIR.
This commit is contained in:
Steven Schäfer
2022-10-04 15:19:30 +02:00
committed by Alexander Udalov
parent 5cf1a88c42
commit 21fef70367
80 changed files with 544 additions and 1728 deletions
@@ -111,18 +111,18 @@ FILE fqName:<root> fileName:/arrayAccessCompositeOperators.kt
BLOCK_BODY
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null
value: GET_VAR '<set-?>: kotlin.Int declared in <root>.<set-operationScore>' type=kotlin.Int origin=null
FUN name:get visibility:public modality:FINAL <> ($receiver:<root>.MyContainer, <this>:kotlin.Int, index:kotlin.Int) returnType:kotlin.Int [operator]
FUN name:get visibility:public modality:FINAL <> ($receiver:<root>.MyContainer, _context_receiver_0:kotlin.Int, index:kotlin.Int) returnType:kotlin.Int [operator]
contextReceiverParametersCount: 1
$receiver: VALUE_PARAMETER name:<this> type:<root>.MyContainer
VALUE_PARAMETER name:<this> index:0 type:kotlin.Int
VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int
VALUE_PARAMETER name:index index:1 type:kotlin.Int
BLOCK_BODY
BLOCK type=kotlin.Unit origin=PLUSEQ
CALL 'public final fun <set-operationScore> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=PLUSEQ
<set-?>: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ
$this: CALL 'public final fun <get-operationScore> (): kotlin.Int declared in <root>' type=kotlin.Int origin=PLUSEQ
other: GET_VAR '<this>: kotlin.Int declared in <root>.get' type=kotlin.Int origin=null
RETURN type=kotlin.Nothing from='public final fun get (<this>: kotlin.Int, index: kotlin.Int): kotlin.Int [operator] declared in <root>'
other: GET_VAR '_context_receiver_0: kotlin.Int declared in <root>.get' type=kotlin.Int origin=null
RETURN type=kotlin.Nothing from='public final fun get (_context_receiver_0: kotlin.Int, index: kotlin.Int): kotlin.Int [operator] declared in <root>'
WHEN type=kotlin.Int origin=IF
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
@@ -133,17 +133,17 @@ FILE fqName:<root> fileName:/arrayAccessCompositeOperators.kt
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Int type=kotlin.Int value=-1
FUN name:plusAssign visibility:public modality:FINAL <> ($receiver:<root>.MyContainer, <this>:kotlin.Int, other:<root>.MyContainer) returnType:kotlin.Unit [operator]
FUN name:plusAssign visibility:public modality:FINAL <> ($receiver:<root>.MyContainer, _context_receiver_0:kotlin.Int, other:<root>.MyContainer) returnType:kotlin.Unit [operator]
contextReceiverParametersCount: 1
$receiver: VALUE_PARAMETER name:<this> type:<root>.MyContainer
VALUE_PARAMETER name:<this> index:0 type:kotlin.Int
VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int
VALUE_PARAMETER name:other index:1 type:<root>.MyContainer
BLOCK_BODY
BLOCK type=kotlin.Unit origin=PLUSEQ
CALL 'public final fun <set-operationScore> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=PLUSEQ
<set-?>: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ
$this: CALL 'public final fun <get-operationScore> (): kotlin.Int declared in <root>' type=kotlin.Int origin=PLUSEQ
other: GET_VAR '<this>: kotlin.Int declared in <root>.plusAssign' type=kotlin.Int origin=null
other: GET_VAR '_context_receiver_0: kotlin.Int declared in <root>.plusAssign' type=kotlin.Int origin=null
BLOCK type=kotlin.Unit origin=PLUSEQ
VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:<root>.MyContainer [val]
GET_VAR '<this>: <root>.MyContainer declared in <root>.plusAssign' type=<root>.MyContainer origin=null
@@ -154,17 +154,17 @@ FILE fqName:<root> fileName:/arrayAccessCompositeOperators.kt
$this: GET_VAR 'val tmp_1: <root>.MyContainer [val] declared in <root>.plusAssign' type=<root>.MyContainer origin=null
other: CALL 'public final fun <get-i> (): kotlin.Int declared in <root>.MyContainer' type=kotlin.Int origin=GET_PROPERTY
$this: GET_VAR 'other: <root>.MyContainer declared in <root>.plusAssign' type=<root>.MyContainer origin=null
FUN name:inc visibility:public modality:FINAL <> ($receiver:<root>.MyContainer, <this>:kotlin.Int) returnType:<root>.MyContainer [operator]
FUN name:inc visibility:public modality:FINAL <> ($receiver:<root>.MyContainer, _context_receiver_0:kotlin.Int) returnType:<root>.MyContainer [operator]
contextReceiverParametersCount: 1
$receiver: VALUE_PARAMETER name:<this> type:<root>.MyContainer
VALUE_PARAMETER name:<this> index:0 type:kotlin.Int
VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int
BLOCK_BODY
BLOCK type=kotlin.Unit origin=PLUSEQ
CALL 'public final fun <set-operationScore> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=PLUSEQ
<set-?>: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ
$this: CALL 'public final fun <get-operationScore> (): kotlin.Int declared in <root>' type=kotlin.Int origin=PLUSEQ
other: GET_VAR '<this>: kotlin.Int declared in <root>.inc' type=kotlin.Int origin=null
RETURN type=kotlin.Nothing from='public final fun inc (<this>: kotlin.Int): <root>.MyContainer [operator] declared in <root>'
other: GET_VAR '_context_receiver_0: kotlin.Int declared in <root>.inc' type=kotlin.Int origin=null
RETURN type=kotlin.Nothing from='public final fun inc (_context_receiver_0: kotlin.Int): <root>.MyContainer [operator] declared in <root>'
CONSTRUCTOR_CALL 'public constructor <init> (i: kotlin.Int) [primary] declared in <root>.MyContainer' type=<root>.MyContainer origin=null
i: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUS
$this: CALL 'public final fun <get-i> (): kotlin.Int declared in <root>.MyContainer' type=kotlin.Int origin=GET_PROPERTY
@@ -183,20 +183,20 @@ FILE fqName:<root> fileName:/arrayAccessCompositeOperators.kt
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:kotlin.Int) returnType:kotlin.Unit
$receiver: VALUE_PARAMETER name:$this$with type:kotlin.Int
BLOCK_BODY
CALL 'public final fun plusAssign (<this>: kotlin.Int, other: <root>.MyContainer): kotlin.Unit [operator] declared in <root>' type=kotlin.Unit origin=PLUSEQ
CALL 'public final fun plusAssign (_context_receiver_0: kotlin.Int, other: <root>.MyContainer): kotlin.Unit [operator] declared in <root>' type=kotlin.Unit origin=PLUSEQ
$receiver: GET_VAR 'var myContainer: <root>.MyContainer [var] declared in <root>.box' type=<root>.MyContainer origin=PLUSEQ
<this>: GET_VAR '$this$with: kotlin.Int declared in <root>.box.<anonymous>' type=kotlin.Int origin=null
_context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in <root>.box.<anonymous>' type=kotlin.Int origin=null
other: CONSTRUCTOR_CALL 'public constructor <init> (i: kotlin.Int) [primary] declared in <root>.MyContainer' type=<root>.MyContainer origin=null
i: CALL 'public final fun get (<this>: kotlin.Int, index: kotlin.Int): kotlin.Int [operator] declared in <root>' type=kotlin.Int origin=GET_ARRAY_ELEMENT
i: CALL 'public final fun get (_context_receiver_0: kotlin.Int, index: kotlin.Int): kotlin.Int [operator] declared in <root>' type=kotlin.Int origin=GET_ARRAY_ELEMENT
$receiver: BLOCK type=<root>.MyContainer origin=POSTFIX_INCR
VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:<root>.MyContainer [val]
GET_VAR 'var myContainer: <root>.MyContainer [var] declared in <root>.box' type=<root>.MyContainer origin=POSTFIX_INCR
SET_VAR 'var myContainer: <root>.MyContainer [var] declared in <root>.box' type=kotlin.Unit origin=POSTFIX_INCR
CALL 'public final fun inc (<this>: kotlin.Int): <root>.MyContainer [operator] declared in <root>' type=<root>.MyContainer origin=POSTFIX_INCR
CALL 'public final fun inc (_context_receiver_0: kotlin.Int): <root>.MyContainer [operator] declared in <root>' type=<root>.MyContainer origin=POSTFIX_INCR
$receiver: GET_VAR 'val tmp_2: <root>.MyContainer [val] declared in <root>.box.<anonymous>' type=<root>.MyContainer origin=null
<this>: GET_VAR '$this$with: kotlin.Int declared in <root>.box.<anonymous>' type=kotlin.Int origin=null
_context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in <root>.box.<anonymous>' type=kotlin.Int origin=null
GET_VAR 'val tmp_2: <root>.MyContainer [val] declared in <root>.box.<anonymous>' type=<root>.MyContainer origin=null
<this>: GET_VAR '$this$with: kotlin.Int declared in <root>.box.<anonymous>' type=kotlin.Int origin=null
_context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in <root>.box.<anonymous>' type=kotlin.Int origin=null
index: CONST Int type=kotlin.Int value=0
RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
WHEN type=kotlin.String origin=IF