Collections Builders
class CollectionsBuilders(stdlib: StdlibBuilders, builder: IrBuilderWithScope, context: IrPluginContext) : MethodBuilder
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
empty Mutable List
Link copied to clipboard
fun emptyMutableList(elementType: IrType, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrCall
Content copied to clipboard
empty Mutable Map
Link copied to clipboard
fun emptyMutableMap(keyType: IrType, valueType: IrType, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrCall
Content copied to clipboard
empty Mutable Set
Link copied to clipboard
fun emptyMutableSet(elementType: IrType, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrCall
Content 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
list Of Not Null
Link copied to clipboard
fun listOfNotNull(elementType: IrType, items: Iterable<IrExpression>, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrCall
Content copied to clipboard
list Of Vararg
Link copied to clipboard
fun listOfVararg(items: IrVararg, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrCall
Content copied to clipboard
fun listOfVararg(elementType: IrType, items: IrVararg, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrCall
Content copied to clipboard
mutable List Of
Link copied to clipboard
fun mutableListOf(elementType: IrType, items: Iterable<IrExpression>, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrCall
Content copied to clipboard
mutable Map Of
Link copied to clipboard
fun mutableMapOf(keyType: IrType, valueType: IrType, items: Map<IrExpression, IrExpression>, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrCall
Content copied to clipboard
mutable Set Of
Link copied to clipboard
fun mutableSetOf(elementType: IrType, items: Iterable<IrExpression>, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrCall
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
set Of Not Null
Link copied to clipboard
fun setOfNotNull(elementType: IrType, items: Iterable<IrExpression>, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrCall
Content copied to clipboard
with Builder
Link copied to clipboard
open fun <T> IrSymbolOwner.withBuilder(block: DeclarationIrBuilder.() -> T): T
Content copied to clipboard
Properties
Collection
Link copied to clipboard
Iterable
Link copied to clipboard
kotlin
Link copied to clipboard
List
Link copied to clipboard
Map
Link copied to clipboard
MutableList
Link copied to clipboard
MutableMap
Link copied to clipboard
MutableSet
Link copied to clipboard
Set
Link copied to clipboard
stdlib
Link copied to clipboard
Sources
jvm source
Link copied to clipboard