MutableMapBuilders

open class MutableMapBuilders(collections: CollectionsBuilders, builder: IrBuilderWithScope, context: IrPluginContext) : MapBuilders

Functions

asConst
Link copied to clipboard
open fun Boolean.asConst(type: IrType = context.irBuiltIns.booleanType, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrConst<Boolean>
open fun Byte.asConst(type: IrType = context.irBuiltIns.byteType, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrConst<Byte>
open fun Char.asConst(type: IrType = context.irBuiltIns.charType, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrConst<Char>
open fun Double.asConst(type: IrType = context.irBuiltIns.doubleType, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrConst<Double>
open fun Float.asConst(type: IrType = context.irBuiltIns.floatType, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrConst<Float>
open fun Int.asConst(type: IrType = context.irBuiltIns.intType, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrConst<Int>
open fun Long.asConst(type: IrType = context.irBuiltIns.longType, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrConst<Long>
open fun Short.asConst(type: IrType = context.irBuiltIns.shortType, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrConst<Short>
open fun String.asConst(type: IrType = context.irBuiltIns.stringType, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrConst<String>
buildLambda
Link copied to clipboard
open fun IrBuilderWithScope.buildLambda(returnType: IrType?, funBuilder: IrFunctionBuilder.() -> Unit = {}, funApply: IrSimpleFunction.() -> Unit): IrSimpleFunction

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

buildStatement
Link copied to clipboard
inline fun <T : IrElement> buildStatement(startOffset: Int, endOffset: Int, block: IrSingleStatementBuilder.() -> T): T

Build a statement using the underlying builder. Should only be used for extensions.

open fun <T : IrElement> IrSymbolOwner.buildStatement(startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET, origin: IrStatementOrigin? = null, block: IrSingleStatementBuilder.() -> T): T
clear
Link copied to clipboard
fun clear(receiver: IrExpression, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrCall
containsKey
Link copied to clipboard
fun containsKey(receiver: IrExpression, key: IrExpression, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrCall
containsValue
Link copied to clipboard
fun containsValue(receiver: IrExpression, value: IrExpression, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrCall
createIrBuilder
Link copied to clipboard
open fun createIrBuilder(symbol: IrSymbol, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): DeclarationIrBuilder
createIrBuilderAt
Link copied to clipboard
open fun IrSymbolOwner.createIrBuilderAt(): DeclarationIrBuilder
entries
Link copied to clipboard
fun entries(receiver: IrExpression, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrFunctionAccessExpression
get
Link copied to clipboard
fun get(receiver: IrExpression, key: IrExpression, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrCall
getOrDefault
Link copied to clipboard
fun getOrDefault(receiver: IrExpression, key: IrExpression, default: IrExpression, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrCall
getOrElse
Link copied to clipboard
fun getOrElse(receiver: IrExpression, key: IrExpression, valueType: IrType = receiver.type.raiseToOrNull { it.isClassifierOf(Kotlin.Collections.Map) } ?.safeAs<IrSimpleType>()?.arguments?.get(1)?.typeOrNull ?: error("Can't auto-detect value type, must specify"), startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET, otherwise: IrBlockBodyBuilder.() -> Unit): IrCall
getOrElseExpr
Link copied to clipboard
fun getOrElseExpr(receiver: IrExpression, key: IrExpression, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET, otherwise: IrBuilderWithScope.() -> IrExpression): IrCall
getOrPut
Link copied to clipboard
fun getOrPut(receiver: IrExpression, key: IrExpression, valueType: IrType = receiver.type.raiseToOrNull { it.isClassifierOf(Kotlin.Collections.MutableMap) } ?.safeAs<IrSimpleType>()?.arguments?.get(1)?.typeOrNull ?: error("Can't auto-detect value type, must specify"), startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET, otherwise: IrBlockBodyBuilder.() -> Unit): IrCall
getOrPutExpr
Link copied to clipboard
fun getOrPutExpr(receiver: IrExpression, key: IrExpression, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET, otherwise: IrBuilderWithScope.() -> IrExpression): IrCall
getValue
Link copied to clipboard
fun getValue(receiver: IrExpression, key: IrExpression, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrCall
invoke
Link copied to clipboard
open operator fun <R : IrBindableSymbol<*, *>> Reference<R>.invoke(): R
open operator fun TypeRef.invoke(): IrType
irCall
Link copied to clipboard
open fun IrBuilderWithScope.irCall(funcRef: FunctionRef): IrCall
open fun IrBuilderWithScope.irCall(funcRef: FunctionRef, type: IrType): IrCall
isEmpty
Link copied to clipboard
fun isEmpty(receiver: IrExpression, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrCall
isSubclassOf
Link copied to clipboard
open fun IrClass.isSubclassOf(klass: ClassRef): Boolean
open fun IrType.isSubclassOf(klass: ClassRef): Boolean
keys
Link copied to clipboard
fun keys(receiver: IrExpression, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrFunctionAccessExpression
lambdaArgument
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

Creates a IrFunctionExpressionImpl from the given function, auto-inferring the type if not specified

minusIterableKeys
Link copied to clipboard
fun minusIterableKeys(receiver: IrExpression, keys: IrExpression, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrCall
minusKey
Link copied to clipboard
fun minusKey(receiver: IrExpression, other: IrExpression, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrCall
nullConst
Link copied to clipboard
open fun nullConst(type: IrType, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrConst<Nothing?>
plusElementPair
Link copied to clipboard
fun plusElementPair(receiver: IrExpression, other: IrExpression, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrCall
plusElementPairOf
Link copied to clipboard
fun plusElementPairOf(receiver: IrExpression, key: IrExpression, value: IrExpression, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrCall
plusIterablePairs
Link copied to clipboard
fun plusIterablePairs(receiver: IrExpression, other: IrExpression, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrCall
plusMap
Link copied to clipboard
fun plusMap(receiver: IrExpression, other: IrExpression, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrCall
put
Link copied to clipboard
fun put(receiver: IrExpression, key: IrExpression, value: IrExpression, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrCall
putAll
Link copied to clipboard
fun putAll(receiver: IrExpression, items: IrExpression, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrCall
fun putAll(receiver: IrExpression, itemsMap: Map<IrExpression, IrExpression>, itemsKeyType: IrType, itemsValueType: IrType, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrCall
putAllIterable
Link copied to clipboard
fun putAllIterable(receiver: IrExpression, items: IrExpression, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrCall
remove
Link copied to clipboard
fun remove(receiver: IrExpression, key: IrExpression, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrCall
resolve
Link copied to clipboard
open fun <R : IrBindableSymbol<*, *>> Reference<R>.resolve(): R
open fun TypeRef.resolve(): IrType
resolveOrNull
Link copied to clipboard
open fun <R : IrBindableSymbol<*, *>> Reference<R>.resolveOrNull(): R?
resolveTypeWith
Link copied to clipboard
open fun ClassRef.resolveTypeWith(vararg arguments: IrType): IrSimpleType
size
Link copied to clipboard
fun size(receiver: IrExpression, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrFunctionAccessExpression
toIr
Link copied to clipboard
open fun KotlinType.toIr(): IrType
toList
Link copied to clipboard
fun toList(receiver: IrExpression, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrCall
values
Link copied to clipboard
fun values(receiver: IrExpression, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrFunctionAccessExpression
withBuilder
Link copied to clipboard
open fun <T> IrSymbolOwner.withBuilder(block: DeclarationIrBuilder.() -> T): T

Properties

context
Link copied to clipboard
open override val context: IrPluginContext
factory
Link copied to clipboard
open val factory: IrFactory
kotlin
Link copied to clipboard
open val IrBuilderWithScope.kotlin: StdlibBuilders

Get the standard library builders

stdlib
Link copied to clipboard
open val IrBuilderWithScope.stdlib: StdlibBuilders

Get the standard library builders

Sources

jvm source
Link copied to clipboard