IR: annotations are represented as IrConstructorCall elements

Also, they are rendered somewhat nicer
This commit is contained in:
Dmitry Petrov
2019-03-26 13:11:04 +03:00
parent db7bcb6464
commit e3fd74a580
66 changed files with 540 additions and 643 deletions
+3 -3
View File
@@ -2,15 +2,15 @@ FILE fqName:<root> fileName:/extensionLambda.kt
FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test1 (): kotlin.Int declared in <root>'
CALL 'public final fun run <T, R> (block: @[CALL 'public constructor <init> () [primary] declared in kotlin.ExtensionFunctionType' type=kotlin.ExtensionFunctionType origin=null] kotlin.Function1<T of kotlin.run, R of kotlin.run>): R of kotlin.run [inline] declared in kotlin' type=kotlin.Int origin=null
CALL 'public final fun run <T, R> (block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.run, R of kotlin.run>): R of kotlin.run [inline] declared in kotlin' type=kotlin.Int origin=null
<T>: kotlin.String
<R>: kotlin.Int
$receiver: CONST String type=kotlin.String value="42"
block: BLOCK type=@[CALL 'public constructor <init> () [primary] declared in kotlin.ExtensionFunctionType' type=kotlin.ExtensionFunctionType origin=null] kotlin.Function1<kotlin.String, kotlin.Int> origin=LAMBDA
block: BLOCK type=@[ExtensionFunctionType] kotlin.Function1<kotlin.String, kotlin.Int> origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:kotlin.String) returnType:kotlin.Int
$receiver: VALUE_PARAMETER name:<this> type:kotlin.String
BLOCK_BODY
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): kotlin.Int declared in <root>.test1'
CALL 'public open fun <get-length> (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=GET_PROPERTY
$this: GET_VAR '<this>: kotlin.String declared in <root>.test1.<anonymous>' type=kotlin.String origin=null
FUNCTION_REFERENCE 'local final fun <anonymous> (): kotlin.Int declared in <root>.test1' type=@[CALL 'public constructor <init> () [primary] declared in kotlin.ExtensionFunctionType' type=kotlin.ExtensionFunctionType origin=null] kotlin.Function1<kotlin.String, kotlin.Int> origin=LAMBDA
FUNCTION_REFERENCE 'local final fun <anonymous> (): kotlin.Int declared in <root>.test1' type=@[ExtensionFunctionType] kotlin.Function1<kotlin.String, kotlin.Int> origin=LAMBDA
@@ -86,29 +86,29 @@ FILE fqName:<root> fileName:/multipleImplicitReceivers.kt
VALUE_PARAMETER name:invokeImpl index:1 type:<root>.IInvoke
BLOCK_BODY
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
CALL 'public final fun with <T, R> (receiver: T of kotlin.with, block: @[CALL 'public constructor <init> () [primary] declared in kotlin.ExtensionFunctionType' type=kotlin.ExtensionFunctionType origin=null] kotlin.Function1<T of kotlin.with, R of kotlin.with>): R of kotlin.with [inline] declared in kotlin' type=kotlin.Int origin=null
CALL 'public final fun with <T, R> (receiver: T of kotlin.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.with, R of kotlin.with>): R of kotlin.with [inline] declared in kotlin' type=kotlin.Int origin=null
<T>: <root>.A
<R>: kotlin.Int
receiver: GET_OBJECT 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.A
block: BLOCK type=@[CALL 'public constructor <init> () [primary] declared in kotlin.ExtensionFunctionType' type=kotlin.ExtensionFunctionType origin=null] kotlin.Function1<<root>.A, kotlin.Int> origin=LAMBDA
block: BLOCK type=@[ExtensionFunctionType] kotlin.Function1<<root>.A, kotlin.Int> origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:<root>.A) returnType:kotlin.Int
$receiver: VALUE_PARAMETER name:<this> type:<root>.A
BLOCK_BODY
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): kotlin.Int declared in <root>.test'
CALL 'public final fun with <T, R> (receiver: T of kotlin.with, block: @[CALL 'public constructor <init> () [primary] declared in kotlin.ExtensionFunctionType' type=kotlin.ExtensionFunctionType origin=null] kotlin.Function1<T of kotlin.with, R of kotlin.with>): R of kotlin.with [inline] declared in kotlin' type=kotlin.Int origin=null
CALL 'public final fun with <T, R> (receiver: T of kotlin.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.with, R of kotlin.with>): R of kotlin.with [inline] declared in kotlin' type=kotlin.Int origin=null
<T>: <root>.IFoo
<R>: kotlin.Int
receiver: GET_VAR 'fooImpl: <root>.IFoo declared in <root>.test' type=<root>.IFoo origin=null
block: BLOCK type=@[CALL 'public constructor <init> () [primary] declared in kotlin.ExtensionFunctionType' type=kotlin.ExtensionFunctionType origin=null] kotlin.Function1<<root>.IFoo, kotlin.Int> origin=LAMBDA
block: BLOCK type=@[ExtensionFunctionType] kotlin.Function1<<root>.IFoo, kotlin.Int> origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:<root>.IFoo) returnType:kotlin.Int
$receiver: VALUE_PARAMETER name:<this> type:<root>.IFoo
BLOCK_BODY
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): kotlin.Int declared in <root>.test.<anonymous>'
CALL 'public final fun with <T, R> (receiver: T of kotlin.with, block: @[CALL 'public constructor <init> () [primary] declared in kotlin.ExtensionFunctionType' type=kotlin.ExtensionFunctionType origin=null] kotlin.Function1<T of kotlin.with, R of kotlin.with>): R of kotlin.with [inline] declared in kotlin' type=kotlin.Int origin=null
CALL 'public final fun with <T, R> (receiver: T of kotlin.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.with, R of kotlin.with>): R of kotlin.with [inline] declared in kotlin' type=kotlin.Int origin=null
<T>: <root>.IInvoke
<R>: kotlin.Int
receiver: GET_VAR 'invokeImpl: <root>.IInvoke declared in <root>.test' type=<root>.IInvoke origin=null
block: BLOCK type=@[CALL 'public constructor <init> () [primary] declared in kotlin.ExtensionFunctionType' type=kotlin.ExtensionFunctionType origin=null] kotlin.Function1<<root>.IInvoke, kotlin.Int> origin=LAMBDA
block: BLOCK type=@[ExtensionFunctionType] kotlin.Function1<<root>.IInvoke, kotlin.Int> origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:<root>.IInvoke) returnType:kotlin.Int
$receiver: VALUE_PARAMETER name:<this> type:<root>.IInvoke
BLOCK_BODY
@@ -118,6 +118,6 @@ FILE fqName:<root> fileName:/multipleImplicitReceivers.kt
$receiver: CALL 'public open fun <get-foo> (): <root>.B declared in <root>.IFoo' type=<root>.B origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.IFoo declared in <root>.test.<anonymous>.<anonymous>' type=<root>.IFoo origin=null
$receiver: GET_VAR '<this>: <root>.A declared in <root>.test.<anonymous>' type=<root>.A origin=null
FUNCTION_REFERENCE 'local final fun <anonymous> (): kotlin.Int declared in <root>.test.<anonymous>.<anonymous>' type=@[CALL 'public constructor <init> () [primary] declared in kotlin.ExtensionFunctionType' type=kotlin.ExtensionFunctionType origin=null] kotlin.Function1<<root>.IInvoke, kotlin.Int> origin=LAMBDA
FUNCTION_REFERENCE 'local final fun <anonymous> (): kotlin.Int declared in <root>.test.<anonymous>' type=@[CALL 'public constructor <init> () [primary] declared in kotlin.ExtensionFunctionType' type=kotlin.ExtensionFunctionType origin=null] kotlin.Function1<<root>.IFoo, kotlin.Int> origin=LAMBDA
FUNCTION_REFERENCE 'local final fun <anonymous> (): kotlin.Int declared in <root>.test' type=@[CALL 'public constructor <init> () [primary] declared in kotlin.ExtensionFunctionType' type=kotlin.ExtensionFunctionType origin=null] kotlin.Function1<<root>.A, kotlin.Int> origin=LAMBDA
FUNCTION_REFERENCE 'local final fun <anonymous> (): kotlin.Int declared in <root>.test.<anonymous>.<anonymous>' type=@[ExtensionFunctionType] kotlin.Function1<<root>.IInvoke, kotlin.Int> origin=LAMBDA
FUNCTION_REFERENCE 'local final fun <anonymous> (): kotlin.Int declared in <root>.test.<anonymous>' type=@[ExtensionFunctionType] kotlin.Function1<<root>.IFoo, kotlin.Int> origin=LAMBDA
FUNCTION_REFERENCE 'local final fun <anonymous> (): kotlin.Int declared in <root>.test' type=@[ExtensionFunctionType] kotlin.Function1<<root>.A, kotlin.Int> origin=LAMBDA