Wide visibility in ir common stuff
This commit is contained in:
@@ -66,7 +66,7 @@ fun IrMemberAccessExpression.getArguments(): List<Pair<ParameterDescriptor, IrEx
|
|||||||
* Binds the arguments explicitly represented in the IR to the parameters of the accessed function.
|
* Binds the arguments explicitly represented in the IR to the parameters of the accessed function.
|
||||||
* The arguments are to be evaluated in the same order as they appear in the resulting list.
|
* The arguments are to be evaluated in the same order as they appear in the resulting list.
|
||||||
*/
|
*/
|
||||||
internal fun IrFunctionAccessExpression.getArgumentsWithSymbols(): List<Pair<IrValueParameterSymbol, IrExpression>> {
|
fun IrFunctionAccessExpression.getArgumentsWithSymbols(): List<Pair<IrValueParameterSymbol, IrExpression>> {
|
||||||
val res = mutableListOf<Pair<IrValueParameterSymbol, IrExpression>>()
|
val res = mutableListOf<Pair<IrValueParameterSymbol, IrExpression>>()
|
||||||
val irFunction = symbol.owner as IrFunction
|
val irFunction = symbol.owner as IrFunction
|
||||||
|
|
||||||
@@ -91,7 +91,7 @@ internal fun IrFunctionAccessExpression.getArgumentsWithSymbols(): List<Pair<IrV
|
|||||||
/**
|
/**
|
||||||
* Sets arguments that are specified by given mapping of parameters.
|
* Sets arguments that are specified by given mapping of parameters.
|
||||||
*/
|
*/
|
||||||
internal fun IrMemberAccessExpression.addArguments(args: Map<ParameterDescriptor, IrExpression>) {
|
fun IrMemberAccessExpression.addArguments(args: Map<ParameterDescriptor, IrExpression>) {
|
||||||
descriptor.dispatchReceiverParameter?.let {
|
descriptor.dispatchReceiverParameter?.let {
|
||||||
val arg = args[it]
|
val arg = args[it]
|
||||||
if (arg != null) {
|
if (arg != null) {
|
||||||
@@ -114,10 +114,10 @@ internal fun IrMemberAccessExpression.addArguments(args: Map<ParameterDescriptor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal fun IrMemberAccessExpression.addArguments(args: List<Pair<ParameterDescriptor, IrExpression>>) =
|
fun IrMemberAccessExpression.addArguments(args: List<Pair<ParameterDescriptor, IrExpression>>) =
|
||||||
this.addArguments(args.toMap())
|
this.addArguments(args.toMap())
|
||||||
|
|
||||||
internal fun IrExpression.isNullConst() = this is IrConst<*> && this.kind == IrConstKind.Null
|
fun IrExpression.isNullConst() = this is IrConst<*> && this.kind == IrConstKind.Null
|
||||||
|
|
||||||
fun IrCall.usesDefaultArguments(): Boolean =
|
fun IrCall.usesDefaultArguments(): Boolean =
|
||||||
this.descriptor.valueParameters.any { this.getValueArgument(it) == null }
|
this.descriptor.valueParameters.any { this.getValueArgument(it) == null }
|
||||||
|
|||||||
Reference in New Issue
Block a user