Ir Transformer
abstract class IrTransformer(context: IrPluginContext, messageCollector: MessageCollector) : IrElementTransformerVoidWithContext, FileLoweringPass, HasContext, KnowsCurrentFile
Content copied to clipboard
Functions
as Const
Link copied to clipboard
open fun Boolean.asConst(type: IrType = context.irBuiltIns.booleanType, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrConst<Boolean>
Content copied to clipboard
open fun Byte.asConst(type: IrType = context.irBuiltIns.byteType, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrConst<Byte>
Content copied to clipboard
open fun Char.asConst(type: IrType = context.irBuiltIns.charType, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrConst<Char>
Content copied to clipboard
open fun Double.asConst(type: IrType = context.irBuiltIns.doubleType, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrConst<Double>
Content copied to clipboard
open fun Float.asConst(type: IrType = context.irBuiltIns.floatType, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrConst<Float>
Content copied to clipboard
open fun Int.asConst(type: IrType = context.irBuiltIns.intType, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrConst<Int>
Content copied to clipboard
open fun Long.asConst(type: IrType = context.irBuiltIns.longType, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrConst<Long>
Content copied to clipboard
build Lambda
Link copied to clipboard
open fun IrBuilderWithScope.buildLambda(returnType: IrType?, funBuilder: IrFunctionBuilder.() -> Unit = {}, funApply: IrSimpleFunction.() -> Unit): IrSimpleFunction
Content copied to clipboard
Builds a local function to be used as a lambda, likely with lambdaArgument Return type must be specified at some point, but may be passed as null and specified later. Will be automatically set if the lambda has an expression body and it wasn't set in funBuilder or funApply
build Statement
Link copied to clipboard
create Ir Builder
Link copied to clipboard
open fun createIrBuilder(symbol: IrSymbol, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): DeclarationIrBuilder
Content copied to clipboard
create Ir Builder At
Link copied to clipboard
ir Call
Link copied to clipboard
open fun IrBuilderWithScope.irCall(funcRef: FunctionRef, type: IrType): IrCall
Content copied to clipboard
is Subclass Of
Link copied to clipboard
lambda Argument
Link copied to clipboard
open fun lambdaArgument(lambda: IrSimpleFunction, type: IrType = run {
//TODO workaround for https://youtrack.jetbrains.com/issue/KT-46896
val base = if (lambda.isSuspend)
context.referenceClass(
StandardNames.getSuspendFunctionClassId(lambda.allParameters.size).asSingleFqName()
)
?: error("suspend function type not found")
else
context.referenceClass(StandardNames.getFunctionClassId(lambda.allParameters.size).asSingleFqName())
?: error("function type not found")
base.typeWith(lambda.allParameters.map { it.type } + lambda.returnType)
}, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrFunctionExpression
Content copied to clipboard
Creates a IrFunctionExpressionImpl from the given function, auto-inferring the type if not specified
message Location
Link copied to clipboard
Get the message location for an element
report Error
Link copied to clipboard
open fun MessageCollector.reportError(message: String, location: CompilerMessageSourceLocation?)
Content copied to clipboard
open fun MessageCollector.reportError(message: String, location: IrElement)
Content copied to clipboard
report Info
Link copied to clipboard
open fun MessageCollector.reportInfo(message: String, location: CompilerMessageSourceLocation?)
Content copied to clipboard
open fun MessageCollector.reportInfo(message: String, location: IrElement)
Content copied to clipboard
report Warning
Link copied to clipboard
open fun MessageCollector.reportWarning(message: String, location: CompilerMessageSourceLocation?)
Content copied to clipboard
open fun MessageCollector.reportWarning(message: String, location: IrElement)
Content copied to clipboard
resolve Or Null
Link copied to clipboard
resolve Type With
Link copied to clipboard
open fun ClassRef.resolveTypeWith(vararg arguments: IrType): IrSimpleType
Content copied to clipboard
visit Anonymous Initializer
Link copied to clipboard
override fun visitAnonymousInitializer(declaration: IrAnonymousInitializer): IrStatement
Content copied to clipboard
override fun visitAnonymousInitializer(declaration: IrAnonymousInitializer, data: Nothing?): IrStatement
Content copied to clipboard
visit Anonymous Initializer New
Link copied to clipboard
open fun visitAnonymousInitializerNew(declaration: IrAnonymousInitializer): IrStatement
Content copied to clipboard
visit Block
Link copied to clipboard
override fun visitBlock(expression: IrBlock, data: Nothing?): IrExpression
Content copied to clipboard
visit Block Body
Link copied to clipboard
visit Branch
Link copied to clipboard
visit Break
Link copied to clipboard
visit Break Continue
Link copied to clipboard
override fun visitBreakContinue(jump: IrBreakContinue, data: Nothing?): IrExpression
Content copied to clipboard
visit Callable Reference
Link copied to clipboard
open fun visitCallableReference(expression: IrCallableReference<*>): IrExpression
Content copied to clipboard
override fun visitCallableReference(expression: IrCallableReference<*>, data: Nothing?): IrExpression
Content copied to clipboard
visit Catch
Link copied to clipboard
visit Class
Link copied to clipboard
override fun visitClass(declaration: IrClass, data: Nothing?): IrStatement
Content copied to clipboard
visit Class New
Link copied to clipboard
visit Class Reference
Link copied to clipboard
override fun visitClassReference(expression: IrClassReference, data: Nothing?): IrExpression
Content copied to clipboard
visit Composite
Link copied to clipboard
override fun visitComposite(expression: IrComposite, data: Nothing?): IrExpression
Content copied to clipboard
visit Const
Link copied to clipboard
override fun <T> visitConst(expression: IrConst<T>, data: Nothing?): IrExpression
Content copied to clipboard
visit Constructor
Link copied to clipboard
override fun visitConstructor(declaration: IrConstructor, data: Nothing?): IrStatement
Content copied to clipboard
visit Constructor Call
Link copied to clipboard
open fun visitConstructorCall(expression: IrConstructorCall): IrExpression
Content copied to clipboard
override fun visitConstructorCall(expression: IrConstructorCall, data: Nothing?): IrExpression
Content copied to clipboard
visit Container Expression
Link copied to clipboard
open fun visitContainerExpression(expression: IrContainerExpression): IrExpression
Content copied to clipboard
override fun visitContainerExpression(expression: IrContainerExpression, data: Nothing?): IrExpression
Content copied to clipboard
visit Continue
Link copied to clipboard
override fun visitContinue(jump: IrContinue, data: Nothing?): IrExpression
Content copied to clipboard
visit Declaration
Link copied to clipboard
override fun visitDeclaration(declaration: IrDeclarationBase, data: Nothing?): IrStatement
Content copied to clipboard
visit Declaration Reference
Link copied to clipboard
open fun visitDeclarationReference(expression: IrDeclarationReference): IrExpression
Content copied to clipboard
override fun visitDeclarationReference(expression: IrDeclarationReference, data: Nothing?): IrExpression
Content copied to clipboard
visit Delegating Constructor Call
Link copied to clipboard
open fun visitDelegatingConstructorCall(expression: IrDelegatingConstructorCall): IrExpression
Content copied to clipboard
override fun visitDelegatingConstructorCall(expression: IrDelegatingConstructorCall, data: Nothing?): IrExpression
Content copied to clipboard
visit Do While Loop
Link copied to clipboard
override fun visitDoWhileLoop(loop: IrDoWhileLoop, data: Nothing?): IrExpression
Content copied to clipboard
visit Dynamic Expression
Link copied to clipboard
open fun visitDynamicExpression(expression: IrDynamicExpression): IrExpression
Content copied to clipboard
override fun visitDynamicExpression(expression: IrDynamicExpression, data: Nothing?): IrExpression
Content copied to clipboard
visit Dynamic Member Expression
Link copied to clipboard
open fun visitDynamicMemberExpression(expression: IrDynamicMemberExpression): IrExpression
Content copied to clipboard
override fun visitDynamicMemberExpression(expression: IrDynamicMemberExpression, data: Nothing?): IrExpression
Content copied to clipboard
visit Dynamic Operator Expression
Link copied to clipboard
open fun visitDynamicOperatorExpression(expression: IrDynamicOperatorExpression): IrExpression
Content copied to clipboard
override fun visitDynamicOperatorExpression(expression: IrDynamicOperatorExpression, data: Nothing?): IrExpression
Content copied to clipboard
visit Element
Link copied to clipboard
visit Else Branch
Link copied to clipboard
override fun visitElseBranch(branch: IrElseBranch, data: Nothing?): IrElseBranch
Content copied to clipboard
visit Enum Constructor Call
Link copied to clipboard
open fun visitEnumConstructorCall(expression: IrEnumConstructorCall): IrExpression
Content copied to clipboard
override fun visitEnumConstructorCall(expression: IrEnumConstructorCall, data: Nothing?): IrExpression
Content copied to clipboard
visit Enum Entry
Link copied to clipboard
override fun visitEnumEntry(declaration: IrEnumEntry, data: Nothing?): IrStatement
Content copied to clipboard
visit Error Call Expression
Link copied to clipboard
open fun visitErrorCallExpression(expression: IrErrorCallExpression): IrExpression
Content copied to clipboard
override fun visitErrorCallExpression(expression: IrErrorCallExpression, data: Nothing?): IrExpression
Content copied to clipboard
visit Error Declaration
Link copied to clipboard
open fun visitErrorDeclaration(declaration: IrErrorDeclaration): IrStatement
Content copied to clipboard
override fun visitErrorDeclaration(declaration: IrErrorDeclaration, data: Nothing?): IrStatement
Content copied to clipboard
visit Error Expression
Link copied to clipboard
open fun visitErrorExpression(expression: IrErrorExpression): IrExpression
Content copied to clipboard
override fun visitErrorExpression(expression: IrErrorExpression, data: Nothing?): IrExpression
Content copied to clipboard
visit Expression
Link copied to clipboard
override fun visitExpression(expression: IrExpression, data: Nothing?): IrExpression
Content copied to clipboard
visit Expression Body
Link copied to clipboard
override fun visitExpressionBody(body: IrExpressionBody, data: Nothing?): IrBody
Content copied to clipboard
visit External Package Fragment
Link copied to clipboard
open fun visitExternalPackageFragment(declaration: IrExternalPackageFragment): IrExternalPackageFragment
Content copied to clipboard
override fun visitExternalPackageFragment(declaration: IrExternalPackageFragment, data: Nothing?): IrExternalPackageFragment
Content copied to clipboard
visit Field
Link copied to clipboard
override fun visitField(declaration: IrField, data: Nothing?): IrStatement
Content copied to clipboard
visit Field Access
Link copied to clipboard
open fun visitFieldAccess(expression: IrFieldAccessExpression): IrExpression
Content copied to clipboard
override fun visitFieldAccess(expression: IrFieldAccessExpression, data: Nothing?): IrExpression
Content copied to clipboard
visit Field New
Link copied to clipboard
visit File New
Link copied to clipboard
visit Function
Link copied to clipboard
override fun visitFunction(declaration: IrFunction, data: Nothing?): IrStatement
Content copied to clipboard
visit Function Access
Link copied to clipboard
open fun visitFunctionAccess(expression: IrFunctionAccessExpression): IrExpression
Content copied to clipboard
override fun visitFunctionAccess(expression: IrFunctionAccessExpression, data: Nothing?): IrExpression
Content copied to clipboard
visit Function Expression
Link copied to clipboard
open fun visitFunctionExpression(expression: IrFunctionExpression): IrExpression
Content copied to clipboard
override fun visitFunctionExpression(expression: IrFunctionExpression, data: Nothing?): IrElement
Content copied to clipboard
visit Function New
Link copied to clipboard
visit Function Reference
Link copied to clipboard
open fun visitFunctionReference(expression: IrFunctionReference): IrExpression
Content copied to clipboard
override fun visitFunctionReference(expression: IrFunctionReference, data: Nothing?): IrElement
Content copied to clipboard
visit Get Class
Link copied to clipboard
override fun visitGetClass(expression: IrGetClass, data: Nothing?): IrExpression
Content copied to clipboard
visit Get Enum Value
Link copied to clipboard
override fun visitGetEnumValue(expression: IrGetEnumValue, data: Nothing?): IrExpression
Content copied to clipboard
visit Get Field
Link copied to clipboard
override fun visitGetField(expression: IrGetField, data: Nothing?): IrExpression
Content copied to clipboard
visit Get Object Value
Link copied to clipboard
override fun visitGetObjectValue(expression: IrGetObjectValue, data: Nothing?): IrExpression
Content copied to clipboard
visit Get Value
Link copied to clipboard
override fun visitGetValue(expression: IrGetValue, data: Nothing?): IrExpression
Content copied to clipboard
visit Instance Initializer Call
Link copied to clipboard
open fun visitInstanceInitializerCall(expression: IrInstanceInitializerCall): IrExpression
Content copied to clipboard
override fun visitInstanceInitializerCall(expression: IrInstanceInitializerCall, data: Nothing?): IrExpression
Content copied to clipboard
visit Local Delegated Property
Link copied to clipboard
open fun visitLocalDelegatedProperty(declaration: IrLocalDelegatedProperty): IrStatement
Content copied to clipboard
override fun visitLocalDelegatedProperty(declaration: IrLocalDelegatedProperty, data: Nothing?): IrStatement
Content copied to clipboard
visit Local Delegated Property Reference
Link copied to clipboard
open fun visitLocalDelegatedPropertyReference(expression: IrLocalDelegatedPropertyReference): IrExpression
Content copied to clipboard
override fun visitLocalDelegatedPropertyReference(expression: IrLocalDelegatedPropertyReference, data: Nothing?): IrExpression
Content copied to clipboard
visit Member Access
Link copied to clipboard
open fun visitMemberAccess(expression: IrMemberAccessExpression<*>): IrExpression
Content copied to clipboard
override fun visitMemberAccess(expression: IrMemberAccessExpression<*>, data: Nothing?): IrExpression
Content copied to clipboard
visit Module Fragment
Link copied to clipboard
open fun visitModuleFragment(declaration: IrModuleFragment): IrModuleFragment
Content copied to clipboard
override fun visitModuleFragment(declaration: IrModuleFragment, data: Nothing?): IrModuleFragment
Content copied to clipboard
visit Package Fragment
Link copied to clipboard
open override fun visitPackageFragment(declaration: IrPackageFragment): IrPackageFragment
Content copied to clipboard
override fun visitPackageFragment(declaration: IrPackageFragment, data: Nothing?): IrElement
Content copied to clipboard
visit Property
Link copied to clipboard
override fun visitProperty(declaration: IrProperty, data: Nothing?): IrStatement
Content copied to clipboard
visit Property New
Link copied to clipboard
visit Property Reference
Link copied to clipboard
open fun visitPropertyReference(expression: IrPropertyReference): IrExpression
Content copied to clipboard
override fun visitPropertyReference(expression: IrPropertyReference, data: Nothing?): IrElement
Content copied to clipboard
visit Raw Function Reference
Link copied to clipboard
open fun visitRawFunctionReference(expression: IrRawFunctionReference): IrExpression
Content copied to clipboard
override fun visitRawFunctionReference(expression: IrRawFunctionReference, data: Nothing?): IrExpression
Content copied to clipboard
visit Return
Link copied to clipboard
override fun visitReturn(expression: IrReturn, data: Nothing?): IrExpression
Content copied to clipboard
visit Script
Link copied to clipboard
override fun visitScript(declaration: IrScript, data: Nothing?): IrStatement
Content copied to clipboard
visit Script New
Link copied to clipboard
visit Set Field
Link copied to clipboard
override fun visitSetField(expression: IrSetField, data: Nothing?): IrExpression
Content copied to clipboard
visit Set Value
Link copied to clipboard
override fun visitSetValue(expression: IrSetValue, data: Nothing?): IrExpression
Content copied to clipboard
visit Simple Function
Link copied to clipboard
override fun visitSimpleFunction(declaration: IrSimpleFunction, data: Nothing?): IrStatement
Content copied to clipboard
visit Singleton Reference
Link copied to clipboard
open fun visitSingletonReference(expression: IrGetSingletonValue): IrExpression
Content copied to clipboard
override fun visitSingletonReference(expression: IrGetSingletonValue, data: Nothing?): IrExpression
Content copied to clipboard
visit Spread Element
Link copied to clipboard
override fun visitSpreadElement(spread: IrSpreadElement, data: Nothing?): IrSpreadElement
Content copied to clipboard
visit String Concatenation
Link copied to clipboard
open fun visitStringConcatenation(expression: IrStringConcatenation): IrExpression
Content copied to clipboard
override fun visitStringConcatenation(expression: IrStringConcatenation, data: Nothing?): IrExpression
Content copied to clipboard
visit Suspendable Expression
Link copied to clipboard
open fun visitSuspendableExpression(expression: IrSuspendableExpression): IrExpression
Content copied to clipboard
override fun visitSuspendableExpression(expression: IrSuspendableExpression, data: Nothing?): IrExpression
Content copied to clipboard
visit Suspension Point
Link copied to clipboard
open fun visitSuspensionPoint(expression: IrSuspensionPoint): IrExpression
Content copied to clipboard
override fun visitSuspensionPoint(expression: IrSuspensionPoint, data: Nothing?): IrExpression
Content copied to clipboard
visit Synthetic Body
Link copied to clipboard
override fun visitSyntheticBody(body: IrSyntheticBody, data: Nothing?): IrBody
Content copied to clipboard
visit Throw
Link copied to clipboard
override fun visitThrow(expression: IrThrow, data: Nothing?): IrExpression
Content copied to clipboard
visit Type Alias
Link copied to clipboard
override fun visitTypeAlias(declaration: IrTypeAlias, data: Nothing?): IrStatement
Content copied to clipboard
visit Type Operator
Link copied to clipboard
override fun visitTypeOperator(expression: IrTypeOperatorCall, data: Nothing?): IrExpression
Content copied to clipboard
visit Type Parameter
Link copied to clipboard
override fun visitTypeParameter(declaration: IrTypeParameter, data: Nothing?): IrStatement
Content copied to clipboard
visit Value Access
Link copied to clipboard
open fun visitValueAccess(expression: IrValueAccessExpression): IrExpression
Content copied to clipboard
override fun visitValueAccess(expression: IrValueAccessExpression, data: Nothing?): IrExpression
Content copied to clipboard
visit Value Parameter
Link copied to clipboard
override fun visitValueParameter(declaration: IrValueParameter): IrStatement
Content copied to clipboard
override fun visitValueParameter(declaration: IrValueParameter, data: Nothing?): IrStatement
Content copied to clipboard
visit Value Parameter New
Link copied to clipboard
open fun visitValueParameterNew(declaration: IrValueParameter): IrStatement
Content copied to clipboard
visit Vararg
Link copied to clipboard
override fun visitVararg(expression: IrVararg, data: Nothing?): IrExpression
Content copied to clipboard
visit Variable
Link copied to clipboard
override fun visitVariable(declaration: IrVariable, data: Nothing?): IrStatement
Content copied to clipboard
visit While Loop
Link copied to clipboard
override fun visitWhileLoop(loop: IrWhileLoop, data: Nothing?): IrExpression
Content copied to clipboard
with Builder
Link copied to clipboard
open fun <T> IrSymbolOwner.withBuilder(block: DeclarationIrBuilder.() -> T): T
Content copied to clipboard
Properties
kotlin
Link copied to clipboard
messageCollector
Link copied to clipboard
stdlib
Link copied to clipboard
typeSystem
Link copied to clipboard
Sources
jvm source
Link copied to clipboard