IrCall.fromSymbolDescriptor
(cherry picked from commit a1d3e915465ea3c5f35657fe2dcc81f9e7b6a28e)
This commit is contained in:
committed by
Vasily Levchenko
parent
d67067a49e
commit
3087bdea22
-1
@@ -66,7 +66,6 @@ internal class KonanSharedVariablesManager(val context: KonanBackendContext) : S
|
|||||||
IrCallImpl(initializer.startOffset, initializer.endOffset,
|
IrCallImpl(initializer.startOffset, initializer.endOffset,
|
||||||
context.irBuiltIns.unitType, elementProperty.setter!!.symbol,
|
context.irBuiltIns.unitType, elementProperty.setter!!.symbol,
|
||||||
elementProperty.setter!!.typeParameters.size, elementProperty.setter!!.valueParameters.size)
|
elementProperty.setter!!.typeParameters.size, elementProperty.setter!!.valueParameters.size)
|
||||||
|
|
||||||
sharedVariableInitialization.dispatchReceiver =
|
sharedVariableInitialization.dispatchReceiver =
|
||||||
IrGetValueImpl(initializer.startOffset, initializer.endOffset,
|
IrGetValueImpl(initializer.startOffset, initializer.endOffset,
|
||||||
sharedVariableDeclaration.type, sharedVariableDeclaration.symbol)
|
sharedVariableDeclaration.type, sharedVariableDeclaration.symbol)
|
||||||
|
|||||||
+1
-1
@@ -93,7 +93,7 @@ private class AutoboxingTransformer(val context: Context) : AbstractValueUsageTr
|
|||||||
override fun IrExpression.useAs(type: IrType): IrExpression {
|
override fun IrExpression.useAs(type: IrType): IrExpression {
|
||||||
if (this.isNullConst() && type.isNullablePointer()) {
|
if (this.isNullConst() && type.isNullablePointer()) {
|
||||||
// TODO: consider using IrConst with proper type.
|
// TODO: consider using IrConst with proper type.
|
||||||
return IrCallImpl(
|
return IrCallImpl.fromSymbolDescriptor(
|
||||||
startOffset,
|
startOffset,
|
||||||
endOffset,
|
endOffset,
|
||||||
symbols.getNativeNullPtr.owner.returnType,
|
symbols.getNativeNullPtr.owner.returnType,
|
||||||
|
|||||||
+1
-1
@@ -234,7 +234,7 @@ private fun Context.buildBridge(startOffset: Int, endOffset: Int,
|
|||||||
val typeSafeBarrierDescription = BuiltinMethodsWithSpecialGenericSignature.getDefaultValueForOverriddenBuiltinFunction(overriddenFunction.overriddenFunction.descriptor)
|
val typeSafeBarrierDescription = BuiltinMethodsWithSpecialGenericSignature.getDefaultValueForOverriddenBuiltinFunction(overriddenFunction.overriddenFunction.descriptor)
|
||||||
typeSafeBarrierDescription?.let { buildTypeSafeBarrier(bridge, overriddenFunction.function, it) }
|
typeSafeBarrierDescription?.let { buildTypeSafeBarrier(bridge, overriddenFunction.function, it) }
|
||||||
|
|
||||||
val delegatingCall = IrCallImpl(
|
val delegatingCall = IrCallImpl.fromSymbolDescriptor(
|
||||||
startOffset,
|
startOffset,
|
||||||
endOffset,
|
endOffset,
|
||||||
targetSymbol.owner.returnType,
|
targetSymbol.owner.returnType,
|
||||||
|
|||||||
+2
-1
@@ -56,7 +56,8 @@ internal class BuiltinOperatorLowering(val context: Context) : FileLoweringPass,
|
|||||||
|
|
||||||
irBuiltins.checkNotNullSymbol -> lowerCheckNotNull(expression)
|
irBuiltins.checkNotNullSymbol -> lowerCheckNotNull(expression)
|
||||||
|
|
||||||
irBuiltins.noWhenBranchMatchedExceptionSymbol -> IrCallImpl(expression.startOffset, expression.endOffset,
|
irBuiltins.noWhenBranchMatchedExceptionSymbol -> IrCallImpl.fromSymbolDescriptor(
|
||||||
|
expression.startOffset, expression.endOffset,
|
||||||
context.ir.symbols.throwNoWhenBranchMatchedException.owner.returnType,
|
context.ir.symbols.throwNoWhenBranchMatchedException.owner.returnType,
|
||||||
context.ir.symbols.throwNoWhenBranchMatchedException,
|
context.ir.symbols.throwNoWhenBranchMatchedException,
|
||||||
context.ir.symbols.throwNoWhenBranchMatchedException.owner.typeParameters.size,
|
context.ir.symbols.throwNoWhenBranchMatchedException.owner.typeParameters.size,
|
||||||
|
|||||||
+1
-1
@@ -110,7 +110,7 @@ internal class EnumUsageLowering(val context: Context)
|
|||||||
private fun loadEnumEntry(startOffset: Int, endOffset: Int, enumClass: IrClass, name: Name): IrExpression {
|
private fun loadEnumEntry(startOffset: Int, endOffset: Int, enumClass: IrClass, name: Name): IrExpression {
|
||||||
val loweredEnum = context.specialDeclarationsFactory.getLoweredEnum(enumClass)
|
val loweredEnum = context.specialDeclarationsFactory.getLoweredEnum(enumClass)
|
||||||
val ordinal = loweredEnum.entriesMap.getValue(name)
|
val ordinal = loweredEnum.entriesMap.getValue(name)
|
||||||
return IrCallImpl(
|
return IrCallImpl.fromSymbolDescriptor(
|
||||||
startOffset, endOffset, enumClass.defaultType,
|
startOffset, endOffset, enumClass.defaultType,
|
||||||
loweredEnum.itemGetterSymbol.owner.symbol,
|
loweredEnum.itemGetterSymbol.owner.symbol,
|
||||||
typeArgumentsCount = 0,
|
typeArgumentsCount = 0,
|
||||||
|
|||||||
+1
-1
@@ -256,4 +256,4 @@ internal class RedundantCoercionsCleaner(val context: Context) : FileLoweringPas
|
|||||||
else -> PossiblyFoldedExpression(expression.transformIfAsked(), false)
|
else -> PossiblyFoldedExpression(expression.transformIfAsked(), false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -332,7 +332,7 @@ internal class ModuleDFGBuilder(val context: Context, val irModule: IrModuleFrag
|
|||||||
|
|
||||||
if (expression is IrCall && expression.symbol == executeImplSymbol) {
|
if (expression is IrCall && expression.symbol == executeImplSymbol) {
|
||||||
// Producer and job of executeImpl are called externally, we need to reflect this somehow.
|
// Producer and job of executeImpl are called externally, we need to reflect this somehow.
|
||||||
val producerInvocation = IrCallImpl(expression.startOffset, expression.endOffset,
|
val producerInvocation = IrCallImpl.fromSymbolDescriptor(expression.startOffset, expression.endOffset,
|
||||||
executeImplProducerInvoke.returnType,
|
executeImplProducerInvoke.returnType,
|
||||||
executeImplProducerInvoke.symbol,
|
executeImplProducerInvoke.symbol,
|
||||||
executeImplProducerInvoke.symbol.owner.typeParameters.size,
|
executeImplProducerInvoke.symbol.owner.typeParameters.size,
|
||||||
@@ -343,7 +343,7 @@ internal class ModuleDFGBuilder(val context: Context, val irModule: IrModuleFrag
|
|||||||
|
|
||||||
val jobFunctionReference = expression.getValueArgument(3) as? IrFunctionReference
|
val jobFunctionReference = expression.getValueArgument(3) as? IrFunctionReference
|
||||||
?: error("A function reference expected")
|
?: error("A function reference expected")
|
||||||
val jobInvocation = IrCallImpl(expression.startOffset, expression.endOffset,
|
val jobInvocation = IrCallImpl.fromSymbolDescriptor(expression.startOffset, expression.endOffset,
|
||||||
jobFunctionReference.symbol.owner.returnType,
|
jobFunctionReference.symbol.owner.returnType,
|
||||||
jobFunctionReference.symbol as IrSimpleFunctionSymbol,
|
jobFunctionReference.symbol as IrSimpleFunctionSymbol,
|
||||||
jobFunctionReference.symbol.owner.typeParameters.size,
|
jobFunctionReference.symbol.owner.typeParameters.size,
|
||||||
@@ -357,7 +357,7 @@ internal class ModuleDFGBuilder(val context: Context, val irModule: IrModuleFrag
|
|||||||
// See ObjC instanceOf code generation for details.
|
// See ObjC instanceOf code generation for details.
|
||||||
if (expression is IrTypeOperatorCall && expression.operator.callsInstanceOf()
|
if (expression is IrTypeOperatorCall && expression.operator.callsInstanceOf()
|
||||||
&& expression.typeOperand.isObjCObjectType()) {
|
&& expression.typeOperand.isObjCObjectType()) {
|
||||||
val objcObjGetter = IrCallImpl(expression.startOffset, expression.endOffset,
|
val objcObjGetter = IrCallImpl.fromSymbolDescriptor(expression.startOffset, expression.endOffset,
|
||||||
objCObjectRawValueGetter.owner.returnType,
|
objCObjectRawValueGetter.owner.returnType,
|
||||||
objCObjectRawValueGetter,
|
objCObjectRawValueGetter,
|
||||||
objCObjectRawValueGetter.owner.typeParameters.size,
|
objCObjectRawValueGetter.owner.typeParameters.size,
|
||||||
|
|||||||
+1
-1
@@ -239,7 +239,7 @@ fun IrBuilderWithScope.irCall(irFunction: IrFunction, typeArguments: List<IrType
|
|||||||
irCall(irFunction.symbol, typeArguments)
|
irCall(irFunction.symbol, typeArguments)
|
||||||
|
|
||||||
internal fun irCall(startOffset: Int, endOffset: Int, irFunction: IrSimpleFunction, typeArguments: List<IrType>): IrCall =
|
internal fun irCall(startOffset: Int, endOffset: Int, irFunction: IrSimpleFunction, typeArguments: List<IrType>): IrCall =
|
||||||
IrCallImpl(
|
IrCallImpl.fromSymbolDescriptor(
|
||||||
startOffset, endOffset, irFunction.substitutedReturnType(typeArguments),
|
startOffset, endOffset, irFunction.substitutedReturnType(typeArguments),
|
||||||
irFunction.symbol, typeArguments.size, irFunction.valueParameters.size
|
irFunction.symbol, typeArguments.size, irFunction.valueParameters.size
|
||||||
).apply {
|
).apply {
|
||||||
|
|||||||
Reference in New Issue
Block a user