FIR2IR: don't create synthetic class for enum entry w/o members

This commit is contained in:
Jinseong Jeon
2020-07-12 10:30:48 +03:00
committed by Mikhail Glukhikh
parent 2ea3579281
commit 1a861b2df9
11 changed files with 85 additions and 805 deletions
@@ -29,66 +29,20 @@ FILE fqName:<root> fileName:/temporaryInEnumEntryInitializer.kt
receiver: GET_VAR '<this>: <root>.En declared in <root>.En.<get-x>' type=<root>.En origin=null
ENUM_ENTRY name:ENTRY
init: EXPRESSION_BODY
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.En.ENTRY'
class: CLASS ENUM_ENTRY name:ENTRY modality:FINAL visibility:private superTypes:[<root>.En]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.En.ENTRY
CONSTRUCTOR visibility:private <> () returnType:<root>.En.ENTRY [primary]
BLOCK_BODY
ENUM_CONSTRUCTOR_CALL 'private constructor <init> (x: kotlin.String?) [primary] declared in <root>.En'
x: BLOCK type=kotlin.String? origin=SAFE_CALL
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Any? [val]
CALL 'public final fun <get-n> (): kotlin.Any? declared in <root>' type=kotlin.Any? origin=GET_PROPERTY
WHEN type=kotlin.String? origin=null
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
arg0: GET_VAR 'val tmp_0: kotlin.Any? [val] declared in <root>.En.ENTRY.<init>' type=kotlin.Any? origin=null
arg1: CONST Null type=kotlin.Nothing? value=null
then: CONST Null type=kotlin.Nothing? value=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=null
$this: GET_VAR 'val tmp_0: kotlin.Any? [val] declared in <root>.En.ENTRY.<init>' type=kotlin.Any? origin=null
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ENTRY modality:FINAL visibility:private superTypes:[<root>.En]'
PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val]
FUN FAKE_OVERRIDE name:<get-x> visibility:public modality:FINAL <> ($this:<root>.En) returnType:kotlin.String? [fake_override]
correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val]
overridden:
public final fun <get-x> (): kotlin.String? declared in <root>.En
$this: VALUE_PARAMETER name:<this> type:<root>.En
FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum<E of kotlin.Enum>) returnType:kotlin.Any [fake_override]
overridden:
protected final fun clone (): kotlin.Any declared in kotlin.Enum
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<E of kotlin.Enum>
FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:<root>.En, other:<root>.En) returnType:kotlin.Int [fake_override,operator]
overridden:
public final fun compareTo (other: E of kotlin.Enum): kotlin.Int [operator] declared in kotlin.Enum
$this: VALUE_PARAMETER name:<this> type:<root>.En
VALUE_PARAMETER name:other index:0 type:<root>.En
FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<E of kotlin.Enum>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public final fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Enum
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<E of kotlin.Enum>
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<E of kotlin.Enum>) returnType:kotlin.Int [fake_override]
overridden:
public final fun hashCode (): kotlin.Int declared in kotlin.Enum
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<E of kotlin.Enum>
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<E of kotlin.Enum>) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in kotlin.Enum
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<E of kotlin.Enum>
PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val]
FUN FAKE_OVERRIDE name:<get-name> visibility:public modality:FINAL <> ($this:kotlin.Enum<E of kotlin.Enum>) returnType:kotlin.String [fake_override]
correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val]
overridden:
public final fun <get-name> (): kotlin.String declared in kotlin.Enum
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<E of kotlin.Enum>
PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val]
FUN FAKE_OVERRIDE name:<get-ordinal> visibility:public modality:FINAL <> ($this:kotlin.Enum<E of kotlin.Enum>) returnType:kotlin.Int [fake_override]
correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val]
overridden:
public final fun <get-ordinal> (): kotlin.Int declared in kotlin.Enum
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<E of kotlin.Enum>
ENUM_CONSTRUCTOR_CALL 'private constructor <init> (x: kotlin.String?) [primary] declared in <root>.En'
x: BLOCK type=kotlin.String? origin=SAFE_CALL
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Any? [val]
CALL 'public final fun <get-n> (): kotlin.Any? declared in <root>' type=kotlin.Any? origin=GET_PROPERTY
WHEN type=kotlin.String? origin=null
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
arg0: GET_VAR 'val tmp_0: kotlin.Any? [val] declared in <root>.En' type=kotlin.Any? origin=null
arg1: CONST Null type=kotlin.Nothing? value=null
then: CONST Null type=kotlin.Nothing? value=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=null
$this: GET_VAR 'val tmp_0: kotlin.Any? [val] declared in <root>.En' type=kotlin.Any? origin=null
FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<<root>.En>
SYNTHETIC_BODY kind=ENUM_VALUES
FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:<root>.En