FIR2IR: change backing field visibility to private

This commit is contained in:
Mikhail Glukhikh
2019-08-29 14:22:24 +03:00
parent 271c15114c
commit bd5e1aeef5
141 changed files with 831 additions and 910 deletions
@@ -6,7 +6,7 @@ FILE fqName:<root> fileName:/objectReference.kt
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]'
PROPERTY name:counter visibility:public modality:FINAL [var]
FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public
FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private
EXPRESSION_BODY
CONST Int type=kotlin.Int value=0
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-counter> visibility:public modality:FINAL <> ($this:<root>.Z) returnType:kotlin.Int
@@ -14,14 +14,14 @@ FILE fqName:<root> fileName:/objectReference.kt
$this: VALUE_PARAMETER name:<this> type:<root>.Z
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-counter> (): kotlin.Int declared in <root>.Z'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Int origin=null
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Int origin=null
receiver: GET_VAR '<this>: <root>.Z declared in <root>.Z.<get-counter>' type=<root>.Z origin=null
FUN DEFAULT_PROPERTY_ACCESSOR name:<set-counter> visibility:public modality:FINAL <> ($this:<root>.Z, <set-?>:kotlin.Int) returnType:kotlin.Unit
correspondingProperty: PROPERTY name:counter visibility:public modality:FINAL [var]
$this: VALUE_PARAMETER name:<this> type:<root>.Z
VALUE_PARAMETER name:<set-?> index:0 type:kotlin.Int
BLOCK_BODY
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Unit origin=null
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null
receiver: GET_VAR '<this>: <root>.Z declared in <root>.Z.<set-counter>' type=<root>.Z origin=null
value: GET_VAR '<set-?>: kotlin.Int declared in <root>.Z.<set-counter>' type=kotlin.Int origin=null
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.Z) returnType:kotlin.Unit
@@ -30,12 +30,12 @@ FILE fqName:<root> fileName:/objectReference.kt
FUN name:bar visibility:public modality:FINAL <> ($this:<root>.Z) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.Z
BLOCK_BODY
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Unit origin=null
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null
receiver: GET_VAR '<this>: <root>.Z declared in <root>.Z' type=<root>.Z origin=null
value: CONST Int type=kotlin.Int value=1
CALL 'public final fun foo (): kotlin.Unit declared in <root>.Z' type=kotlin.Unit origin=null
$this: GET_VAR '<this>: <root>.Z declared in <root>.Z' type=<root>.Z origin=null
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Unit origin=null
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null
receiver: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.Z
value: CONST Int type=kotlin.Int value=1
CALL 'public final fun foo (): kotlin.Unit declared in <root>.Z' type=kotlin.Unit origin=null
@@ -48,12 +48,12 @@ FILE fqName:<root> fileName:/objectReference.kt
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Nested modality:FINAL visibility:public superTypes:[kotlin.Any]'
ANONYMOUS_INITIALIZER isStatic=false
BLOCK_BODY
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Unit origin=null
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null
receiver: GET_VAR '<this>: <root>.Z declared in <root>.Z' type=<root>.Z origin=null
value: CONST Int type=kotlin.Int value=1
CALL 'public final fun foo (): kotlin.Unit declared in <root>.Z' type=kotlin.Unit origin=null
$this: GET_VAR '<this>: <root>.Z declared in <root>.Z' type=<root>.Z origin=null
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Unit origin=null
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null
receiver: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.Z
value: CONST Int type=kotlin.Int value=1
CALL 'public final fun foo (): kotlin.Unit declared in <root>.Z' type=kotlin.Unit origin=null
@@ -61,12 +61,12 @@ FILE fqName:<root> fileName:/objectReference.kt
FUN name:test visibility:public modality:FINAL <> ($this:<root>.Z.Nested) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.Z.Nested
BLOCK_BODY
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Unit origin=null
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null
receiver: GET_VAR '<this>: <root>.Z declared in <root>.Z' type=<root>.Z origin=null
value: CONST Int type=kotlin.Int value=1
CALL 'public final fun foo (): kotlin.Unit declared in <root>.Z' type=kotlin.Unit origin=null
$this: GET_VAR '<this>: <root>.Z declared in <root>.Z' type=<root>.Z origin=null
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Unit origin=null
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null
receiver: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.Z
value: CONST Int type=kotlin.Int value=1
CALL 'public final fun foo (): kotlin.Unit declared in <root>.Z' type=kotlin.Unit origin=null
@@ -85,18 +85,18 @@ FILE fqName:<root> fileName:/objectReference.kt
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
PROPERTY name:aLambda visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:aLambda type:kotlin.Function0<kotlin.Unit> visibility:public [final]
FIELD PROPERTY_BACKING_FIELD name:aLambda type:kotlin.Function0<kotlin.Unit> visibility:private [final]
EXPRESSION_BODY
FUN_EXPR type=kotlin.Function0<kotlin.Unit> origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($this:<root>.Z) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.Z
BLOCK_BODY
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Unit origin=null
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null
receiver: GET_VAR '<this>: <root>.Z declared in <root>.Z' type=<root>.Z origin=null
value: CONST Int type=kotlin.Int value=1
CALL 'public final fun foo (): kotlin.Unit declared in <root>.Z' type=kotlin.Unit origin=null
$this: GET_VAR '<this>: <root>.Z declared in <root>.Z' type=<root>.Z origin=null
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Unit origin=null
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null
receiver: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.Z
value: CONST Int type=kotlin.Int value=1
CALL 'public final fun foo (): kotlin.Unit declared in <root>.Z' type=kotlin.Unit origin=null
@@ -106,10 +106,10 @@ FILE fqName:<root> fileName:/objectReference.kt
$this: VALUE_PARAMETER name:<this> type:<root>.Z
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-aLambda> (): kotlin.Function0<kotlin.Unit> declared in <root>.Z'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:aLambda type:kotlin.Function0<kotlin.Unit> visibility:public [final]' type=kotlin.Function0<kotlin.Unit> origin=null
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:aLambda type:kotlin.Function0<kotlin.Unit> visibility:private [final]' type=kotlin.Function0<kotlin.Unit> origin=null
receiver: GET_VAR '<this>: <root>.Z declared in <root>.Z.<get-aLambda>' type=<root>.Z origin=null
PROPERTY name:anObject visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:anObject type:kotlin.Any visibility:public [final]
FIELD PROPERTY_BACKING_FIELD name:anObject type:kotlin.Any visibility:private [final]
EXPRESSION_BODY
BLOCK type=<root>.Z.anObject.<no name provided> origin=OBJECT_LITERAL
CLASS OBJECT name:<no name provided> modality:FINAL visibility:local superTypes:[kotlin.Any]
@@ -120,12 +120,12 @@ FILE fqName:<root> fileName:/objectReference.kt
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:<no name provided> modality:FINAL visibility:local superTypes:[kotlin.Any]'
ANONYMOUS_INITIALIZER isStatic=false
BLOCK_BODY
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Unit origin=null
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null
receiver: GET_VAR '<this>: <root>.Z declared in <root>.Z' type=<root>.Z origin=null
value: CONST Int type=kotlin.Int value=1
CALL 'public final fun foo (): kotlin.Unit declared in <root>.Z' type=kotlin.Unit origin=null
$this: GET_VAR '<this>: <root>.Z declared in <root>.Z' type=<root>.Z origin=null
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Unit origin=null
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null
receiver: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.Z
value: CONST Int type=kotlin.Int value=1
CALL 'public final fun foo (): kotlin.Unit declared in <root>.Z' type=kotlin.Unit origin=null
@@ -133,12 +133,12 @@ FILE fqName:<root> fileName:/objectReference.kt
FUN name:test visibility:public modality:FINAL <> ($this:<root>.Z.anObject.<no name provided>) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.Z.anObject.<no name provided>
BLOCK_BODY
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Unit origin=null
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null
receiver: GET_VAR '<this>: <root>.Z declared in <root>.Z' type=<root>.Z origin=null
value: CONST Int type=kotlin.Int value=1
CALL 'public final fun foo (): kotlin.Unit declared in <root>.Z' type=kotlin.Unit origin=null
$this: GET_VAR '<this>: <root>.Z declared in <root>.Z' type=<root>.Z origin=null
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Unit origin=null
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null
receiver: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.Z
value: CONST Int type=kotlin.Int value=1
CALL 'public final fun foo (): kotlin.Unit declared in <root>.Z' type=kotlin.Unit origin=null
@@ -149,7 +149,7 @@ FILE fqName:<root> fileName:/objectReference.kt
$this: VALUE_PARAMETER name:<this> type:<root>.Z
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-anObject> (): kotlin.Any declared in <root>.Z'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:anObject type:kotlin.Any visibility:public [final]' type=kotlin.Any origin=null
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:anObject type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null
receiver: GET_VAR '<this>: <root>.Z declared in <root>.Z.<get-anObject>' type=<root>.Z origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
overridden:
@@ -167,12 +167,12 @@ FILE fqName:<root> fileName:/objectReference.kt
FUN name:test visibility:public modality:FINAL <> ($receiver:<root>.Z) returnType:kotlin.Unit
$receiver: VALUE_PARAMETER name:<this> type:<root>.Z
BLOCK_BODY
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Unit origin=null
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null
receiver: GET_VAR '<this>: <root>.Z declared in <root>.Z' type=<root>.Z origin=null
value: CONST Int type=kotlin.Int value=1
CALL 'public final fun foo (): kotlin.Unit declared in <root>.Z' type=kotlin.Unit origin=null
$this: GET_VAR '<this>: <root>.Z declared in <root>.Z' type=<root>.Z origin=null
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Unit origin=null
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null
receiver: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.Z
value: CONST Int type=kotlin.Int value=1
CALL 'public final fun foo (): kotlin.Unit declared in <root>.Z' type=kotlin.Unit origin=null