[Native] Drop irCall from IrUtils2
We can reuse the same function from common `ExpressionHelpers`
This commit is contained in:
@@ -12,10 +12,7 @@ import org.jetbrains.kotlin.ir.expressions.impl.*
|
||||
import org.jetbrains.kotlin.ir.symbols.*
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
import org.jetbrains.kotlin.ir.types.typeWith
|
||||
import org.jetbrains.kotlin.ir.util.isImmutable
|
||||
import org.jetbrains.kotlin.ir.util.parentAsClass
|
||||
import org.jetbrains.kotlin.ir.util.primaryConstructor
|
||||
import org.jetbrains.kotlin.ir.util.render
|
||||
import org.jetbrains.kotlin.ir.util.*
|
||||
|
||||
val IrBuilderWithScope.parent get() = scope.getLocalDeclarationParent()
|
||||
|
||||
@@ -294,6 +291,15 @@ fun IrBuilderWithScope.irCall(callee: IrFunction, origin: IrStatementOrigin? = n
|
||||
origin, superQualifierSymbol
|
||||
)
|
||||
|
||||
fun IrBuilderWithScope.irCallWithSubstitutedType(callee: IrFunction, typeArguments: List<IrType>): IrMemberAccessExpression<*> {
|
||||
val argsMap = callee.typeParameters.map { it.symbol }.zip(typeArguments).toMap()
|
||||
return irCall(callee.symbol, callee.returnType.substitute(argsMap), typeArguments)
|
||||
}
|
||||
|
||||
fun IrBuilderWithScope.irCallWithSubstitutedType(callee: IrFunctionSymbol, typeArguments: List<IrType>): IrMemberAccessExpression<*> {
|
||||
return irCallWithSubstitutedType(callee.owner, typeArguments)
|
||||
}
|
||||
|
||||
fun IrBuilderWithScope.irDelegatingConstructorCall(callee: IrConstructor): IrDelegatingConstructorCall =
|
||||
IrDelegatingConstructorCallImpl(
|
||||
startOffset, endOffset, context.irBuiltIns.unitType, callee.symbol,
|
||||
|
||||
Reference in New Issue
Block a user