From 8fd7970119b24b7dd467e12a20e34e747a3cb0ed Mon Sep 17 00:00:00 2001 From: Vasily Levchenko Date: Mon, 3 Dec 2018 14:32:54 +0300 Subject: [PATCH] [kotlin compiler][update] 1.3.20-dev-2191 cherry-picked from 7a6a47ce3 --- .../cli/bc/K2NativeCompilerArguments.kt | 9 ----- .../jetbrains/kotlin/backend/konan/Boxing.kt | 7 +--- .../jetbrains/kotlin/backend/konan/Context.kt | 4 +- .../konan/EnumSpecialDescriptorsFactory.kt | 8 +++- .../kotlin/backend/konan/lower/Autoboxing.kt | 4 +- .../backend/konan/lower/BridgesBuilding.kt | 5 +-- .../konan/lower/CallableReferenceLowering.kt | 12 +++--- .../lower/DeepCopyIrTreeWithDescriptors.kt | 16 ++++---- .../backend/konan/lower/EnumClassLowering.kt | 9 ++--- .../konan/lower/InitializersLowering.kt | 3 +- .../backend/konan/lower/InteropLowering.kt | 9 ++--- .../konan/lower/SuspendFunctionsLowering.kt | 38 +++++++++---------- .../backend/konan/lower/TestProcessor.kt | 31 +++++++-------- .../konan/serialization/SerializeIr.kt | 5 +-- .../org/jetbrains/kotlin/ir/util/IrUtils2.kt | 8 ++-- backend.native/tests/build.gradle | 2 +- gradle.properties | 6 +-- 17 files changed, 75 insertions(+), 101 deletions(-) diff --git a/backend.native/cli.bc/src/org/jetbrains/kotlin/cli/bc/K2NativeCompilerArguments.kt b/backend.native/cli.bc/src/org/jetbrains/kotlin/cli/bc/K2NativeCompilerArguments.kt index 8eb36dab728..4a07bf8b431 100644 --- a/backend.native/cli.bc/src/org/jetbrains/kotlin/cli/bc/K2NativeCompilerArguments.kt +++ b/backend.native/cli.bc/src/org/jetbrains/kotlin/cli/bc/K2NativeCompilerArguments.kt @@ -96,9 +96,6 @@ class K2NativeCompilerArguments : CommonCompilerArguments() { @Argument(value="-Xcompatible-compiler-version", valueDescription = "", description = "Assume the given compiler version to be binary compatible") var compatibleCompilerVersions: Array? = null - @Argument(value = "-Xdisable", deprecatedName = "--disable", valueDescription = "", description = "Disable backend phase") - var disablePhases: Array? = null - @Argument(value = EMBED_BITCODE_FLAG, description = "Embed LLVM IR bitcode as data") var embedBitcode: Boolean = false @@ -116,9 +113,6 @@ class K2NativeCompilerArguments : CommonCompilerArguments() { ) var exportedLibraries: Array? = null - @Argument(value= "-Xlist-phases", deprecatedName = "--list_phases", description = "List all backend phases") - var listPhases: Boolean = false - @Argument(value = "-Xprint-bitcode", deprecatedName = "--print_bitcode", description = "Print llvm bitcode") var printBitCode: Boolean = false @@ -146,9 +140,6 @@ class K2NativeCompilerArguments : CommonCompilerArguments() { @Argument(value = "-Xtime", deprecatedName = "--time", description = "Report execution time for compiler phases") var timePhases: Boolean = false - @Argument(value = "-Xverbose", deprecatedName = "--verbose", valueDescription = "", description = "Trace phase execution") - var verbosePhases: Array? = null - @Argument(value = "-Xverify-bitcode", deprecatedName = "--verify_bitcode", description = "Verify llvm bitcode after each method") var verifyBitCode: Boolean = false diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/Boxing.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/Boxing.kt index 004eebff475..f942546729a 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/Boxing.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/Boxing.kt @@ -102,8 +102,7 @@ internal val Context.getBoxFunction: (IrClass) -> IrSimpleFunction by Context.la val startOffset = inlinedClass.startOffset val endOffset = inlinedClass.endOffset - IrFunctionImpl(startOffset, endOffset, IrDeclarationOrigin.DEFINED, descriptor).apply { - this.returnType = returnType + IrFunctionImpl(startOffset, endOffset, IrDeclarationOrigin.DEFINED, descriptor, returnType).apply { this.valueParameters.add(IrValueParameterImpl( startOffset, endOffset, @@ -164,9 +163,7 @@ internal val Context.getUnboxFunction: (IrClass) -> IrSimpleFunction by Context. val startOffset = inlinedClass.startOffset val endOffset = inlinedClass.endOffset - IrFunctionImpl(startOffset, endOffset, IrDeclarationOrigin.DEFINED, descriptor).apply { - this.returnType = returnType - + IrFunctionImpl(startOffset, endOffset, IrDeclarationOrigin.DEFINED, descriptor, returnType).apply { this.valueParameters.add(IrValueParameterImpl( startOffset, endOffset, diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/Context.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/Context.kt index f0cbecdc5e6..bc71ccf9fa0 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/Context.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/Context.kt @@ -167,9 +167,9 @@ internal class SpecialDeclarationsFactory(val context: Context) { function.startOffset, function.endOffset, DECLARATION_ORIGIN_BRIDGE_METHOD(function), - bridgeDescriptor + bridgeDescriptor, + returnType ).apply { - this.returnType = returnType this.parent = function.parent } diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/EnumSpecialDescriptorsFactory.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/EnumSpecialDescriptorsFactory.kt index 18feee52661..ca99b3a1c71 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/EnumSpecialDescriptorsFactory.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/EnumSpecialDescriptorsFactory.kt @@ -52,8 +52,12 @@ internal class EnumSpecialDeclarationsFactory(val context: Context) { val valuesField = IrFieldImpl(startOffset, endOffset, DECLARATION_ORIGIN_ENUM, valuesProperty, valuesType) val valuesGetterDescriptor = createValuesGetterDescriptor(enumClassDescriptor, implObjectDescriptor) - val valuesGetter = IrFunctionImpl(startOffset, endOffset, DECLARATION_ORIGIN_ENUM, valuesGetterDescriptor).also { - it.returnType = valuesType + val valuesGetter = IrFunctionImpl( + startOffset, endOffset, + DECLARATION_ORIGIN_ENUM, + valuesGetterDescriptor, + valuesType + ).also { it.parent = implObject it.createDispatchReceiverParameter() } diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/Autoboxing.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/Autoboxing.kt index 7cff5804126..c4faed039dc 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/Autoboxing.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/Autoboxing.kt @@ -461,10 +461,10 @@ private val Context.getLoweredInlineClassConstructor: (IrConstructor) -> IrSimpl irConstructor.startOffset, irConstructor.endOffset, IrDeclarationOrigin.DEFINED, - descriptor + descriptor, + irConstructor.returnType ).apply { parent = irConstructor.parent - returnType = irConstructor.returnType irConstructor.valueParameters.mapTo(this.valueParameters) { it.copy(this.descriptor.valueParameters[it.index]) } diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/BridgesBuilding.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/BridgesBuilding.kt index 5d4a45af67f..2135ba5a41a 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/BridgesBuilding.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/BridgesBuilding.kt @@ -101,10 +101,9 @@ internal class WorkersBridgesBuilding(val context: Context) : DeclarationContain jobFunction.startOffset, jobFunction.endOffset, IrDeclarationOrigin.DEFINED, - runtimeJobDescriptor + runtimeJobDescriptor, + context.irBuiltIns.anyNType ).also { - it.returnType = context.irBuiltIns.anyNType - it.valueParameters += IrValueParameterImpl( it.startOffset, it.endOffset, diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/CallableReferenceLowering.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/CallableReferenceLowering.kt index 6d30c933be5..98be4a171da 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/CallableReferenceLowering.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/CallableReferenceLowering.kt @@ -285,9 +285,9 @@ internal class CallableReferenceLowering(val context: Context): FileLoweringPass startOffset = startOffset, endOffset = endOffset, origin = DECLARATION_ORIGIN_FUNCTION_REFERENCE_IMPL, - symbol = symbol).apply { - - returnType = functionReferenceClass.defaultType + symbol = symbol, + returnType = functionReferenceClass.defaultType + ).apply { val irBuilder = context.createIrBuilder(this.symbol, startOffset, endOffset) @@ -369,9 +369,9 @@ internal class CallableReferenceLowering(val context: Context): FileLoweringPass startOffset = startOffset, endOffset = endOffset, origin = DECLARATION_ORIGIN_FUNCTION_REFERENCE_IMPL, - symbol = ourSymbol).apply { - - returnType = superFunctionSymbol.owner.returnType // FIXME: substitute + symbol = ourSymbol, + returnType = superFunctionSymbol.owner.returnType // FIXME: substitute + ).apply { val function = this val irBuilder = context.createIrBuilder(function.symbol, startOffset, endOffset) diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/DeepCopyIrTreeWithDescriptors.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/DeepCopyIrTreeWithDescriptors.kt index a7f2e0ee6b5..d99a0c4cde6 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/DeepCopyIrTreeWithDescriptors.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/DeepCopyIrTreeWithDescriptors.kt @@ -685,11 +685,10 @@ internal class DeepCopyIrTreeWithDescriptors(val targetDescriptor: FunctionDescr startOffset = declaration.startOffset, endOffset = declaration.endOffset, origin = mapDeclarationOrigin(declaration.origin), - descriptor = descriptor + descriptor = descriptor, + returnType = context.ir.translateErased(descriptor.returnType!!), + body = declaration.body?.transform(this, null) ).also { - it.returnType = context.ir.translateErased(descriptor.returnType!!) - it.body = declaration.body?.transform(this, null) - it.setOverrides(context.ir.symbols.symbolTable) }.transformParameters1(declaration) } @@ -700,11 +699,10 @@ internal class DeepCopyIrTreeWithDescriptors(val targetDescriptor: FunctionDescr startOffset = declaration.startOffset, endOffset = declaration.endOffset, origin = mapDeclarationOrigin(declaration.origin), - descriptor = descriptor - ).also { - it.returnType = context.ir.translateErased(descriptor.returnType) - it.body = declaration.body?.transform(this, null) - }.transformParameters1(declaration) + descriptor = descriptor, + returnType = context.ir.translateErased(descriptor.returnType), + body = declaration.body?.transform(this, null) + ).transformParameters1(declaration) } private fun FunctionDescriptor.getTypeParametersToTransform() = diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/EnumClassLowering.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/EnumClassLowering.kt index 31cce20835d..ba468a77bcd 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/EnumClassLowering.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/EnumClassLowering.kt @@ -520,11 +520,10 @@ internal class EnumClassLowering(val context: Context) : ClassLoweringPass { loweredConstructorDescriptor.returnType = enumConstructor.descriptor.returnType val loweredEnumConstructor = IrConstructorImpl( enumConstructor.startOffset, enumConstructor.endOffset, enumConstructor.origin, - loweredConstructorDescriptor - ).apply { - returnType = enumConstructor.returnType - body = enumConstructor.body!! // will be transformed later - } + loweredConstructorDescriptor, + enumConstructor.returnType, + enumConstructor.body!! + ) loweredEnumConstructor.valueParameters += valueParameters loweredEnumConstructor.parent = enumConstructor.parent diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/InitializersLowering.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/InitializersLowering.kt index 25c7d5da72e..0fcd2b2dcfe 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/InitializersLowering.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/InitializersLowering.kt @@ -105,9 +105,8 @@ internal class InitializersLowering(val context: CommonBackendContext) : ClassLo val startOffset = irClass.startOffset val endOffset = irClass.endOffset val initializer = IrFunctionImpl(startOffset, endOffset, DECLARATION_ORIGIN_ANONYMOUS_INITIALIZER, - initializerMethodDescriptor) + initializerMethodDescriptor, context.irBuiltIns.unitType) - initializer.returnType = context.irBuiltIns.unitType initializer.body = IrBlockBodyImpl(startOffset, endOffset, initializers) initializer.parent = irClass diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/InteropLowering.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/InteropLowering.kt index d4a7d3c4c57..94419a4fe24 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/InteropLowering.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/InteropLowering.kt @@ -197,9 +197,9 @@ internal class InteropLoweringPart1(val context: Context) : IrBuildingTransforme return IrFunctionImpl( constructor.startOffset, constructor.endOffset, OVERRIDING_INITIALIZER_BY_CONSTRUCTOR, - resultDescriptor + resultDescriptor, + irClass.defaultType ).also { result -> - result.returnType = irClass.defaultType result.parent = irClass result.createDispatchReceiverParameter() result.valueParameters += valueParameters @@ -366,10 +366,9 @@ internal class InteropLoweringPart1(val context: Context) : IrBuildingTransforme val newFunction = IrFunctionImpl( function.startOffset, function.endOffset, IrDeclarationOrigin.DEFINED, - newDescriptor + newDescriptor, + function.returnType ).apply { - this.returnType = function.returnType - parameterTypes.mapIndexedTo(this.valueParameters) { index, it -> IrValueParameterImpl( startOffset, diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/SuspendFunctionsLowering.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/SuspendFunctionsLowering.kt index cdb2f7c97ed..cb45d91965b 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/SuspendFunctionsLowering.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/SuspendFunctionsLowering.kt @@ -445,9 +445,9 @@ internal class SuspendFunctionsLowering(val context: Context): FileLoweringPass startOffset = startOffset, endOffset = endOffset, origin = DECLARATION_ORIGIN_COROUTINE_IMPL, - symbol = symbol).apply { - - returnType = coroutineClass.defaultType + symbol = symbol, + returnType = coroutineClass.defaultType + ).apply { this.valueParameters += constructorParameters @@ -509,9 +509,9 @@ internal class SuspendFunctionsLowering(val context: Context): FileLoweringPass startOffset = startOffset, endOffset = endOffset, origin = DECLARATION_ORIGIN_COROUTINE_IMPL, - symbol = symbol).apply { - - returnType = coroutineClass.defaultType + symbol = symbol, + returnType = coroutineClass.defaultType + ).apply { this.valueParameters += constructorParameters @@ -580,9 +580,9 @@ internal class SuspendFunctionsLowering(val context: Context): FileLoweringPass startOffset = startOffset, endOffset = endOffset, origin = DECLARATION_ORIGIN_COROUTINE_IMPL, - symbol = symbol).apply { - - returnType = coroutineClass.defaultType + symbol = symbol, + returnType = coroutineClass.defaultType + ).apply { parent = coroutineClass this.valueParameters += parameters @@ -660,9 +660,9 @@ internal class SuspendFunctionsLowering(val context: Context): FileLoweringPass startOffset = startOffset, endOffset = endOffset, origin = DECLARATION_ORIGIN_COROUTINE_IMPL, - symbol = symbol).apply { - - returnType = irFunction.returnType + symbol = symbol, + returnType = irFunction.returnType + ).apply { parent = coroutineClass valueParameters += parameters @@ -719,9 +719,9 @@ internal class SuspendFunctionsLowering(val context: Context): FileLoweringPass startOffset = startOffset, endOffset = endOffset, origin = DECLARATION_ORIGIN_COROUTINE_IMPL, - symbol = symbol).apply { - - returnType = context.irBuiltIns.anyNType + symbol = symbol, + returnType = context.irBuiltIns.anyNType + ).apply { parent = coroutineClass this.createDispatchReceiverParameter() @@ -946,9 +946,7 @@ internal class SuspendFunctionsLowering(val context: Context): FileLoweringPass CallableMemberDescriptor.Kind.SYNTHESIZED, SourceElement.NO_SOURCE).apply { initialize(null, null, emptyList(), emptyList(), context.builtIns.unitType, Modality.ABSTRACT, Visibilities.PRIVATE) - }).apply { - returnType = context.irBuiltIns.unitType - } + }, context.irBuiltIns.unitType) private val restoreState = IrFunctionImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, IrDeclarationOrigin.DEFINED, SimpleFunctionDescriptorImpl.create( @@ -958,9 +956,7 @@ internal class SuspendFunctionsLowering(val context: Context): FileLoweringPass CallableMemberDescriptor.Kind.SYNTHESIZED, SourceElement.NO_SOURCE).apply { initialize(null, null, emptyList(), emptyList(), context.builtIns.unitType, Modality.ABSTRACT, Visibilities.PRIVATE) - }).apply { - returnType = context.irBuiltIns.unitType - } + }, context.irBuiltIns.unitType) private inner class ExpressionSlicer(val suspensionPointIdType: IrType): IrElementTransformerVoid() { // TODO: optimize - it has square complexity. diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/TestProcessor.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/TestProcessor.kt index 4b137e6f5b4..5a3b45b4eb9 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/TestProcessor.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/TestProcessor.kt @@ -317,13 +317,11 @@ internal class TestProcessor (val context: KonanBackendContext) { : GetterBuilder(objectSymbol.typeWithoutArguments, testSuite, getterName) { override fun buildIr(): IrFunction = IrFunctionImpl( - UNDEFINED_OFFSET, - UNDEFINED_OFFSET, + UNDEFINED_OFFSET, UNDEFINED_OFFSET, TEST_SUITE_GENERATED_MEMBER, - symbol).apply { - - this.returnType = this@ObjectGetterBuilder.returnType - + symbol, + this@ObjectGetterBuilder.returnType + ).apply { val builder = context.createIrBuilder(symbol) createParameterDeclarations(context.ir.symbols.symbolTable) body = builder.irBlockBody { @@ -342,13 +340,11 @@ internal class TestProcessor (val context: KonanBackendContext) { : GetterBuilder(classSymbol.typeWithStarProjections, testSuite, getterName) { override fun buildIr() = IrFunctionImpl( - startOffset = UNDEFINED_OFFSET, - endOffset = UNDEFINED_OFFSET, - origin = TEST_SUITE_GENERATED_MEMBER, - symbol = symbol).apply { - - this.returnType = this@InstanceGetterBuilder.returnType - + UNDEFINED_OFFSET, UNDEFINED_OFFSET, + TEST_SUITE_GENERATED_MEMBER, + symbol, + this@InstanceGetterBuilder.returnType + ).apply { val builder = context.createIrBuilder(symbol) createParameterDeclarations(context.ir.symbols.symbolTable) body = builder.irBlockBody { @@ -377,12 +373,11 @@ internal class TestProcessor (val context: KonanBackendContext) { .single(predicate)) override fun buildIr() = IrConstructorImpl( - UNDEFINED_OFFSET, - UNDEFINED_OFFSET, + UNDEFINED_OFFSET, UNDEFINED_OFFSET, TEST_SUITE_GENERATED_MEMBER, - symbol).apply { - - returnType = testSuite.typeWithStarProjections + symbol, + testSuite.typeWithStarProjections + ).apply { createParameterDeclarations(context.ir.symbols.symbolTable) diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/serialization/SerializeIr.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/serialization/SerializeIr.kt index 0d8a2b72d1b..b4f53124b02 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/serialization/SerializeIr.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/serialization/SerializeIr.kt @@ -1205,10 +1205,7 @@ internal class IrDeserializer(val context: Context, start: Int, end: Int, origin: IrDeclarationOrigin): IrFunction { val body = deserializeStatement(proto.body) - val function = IrFunctionImpl(start, end, origin, descriptor) - - function.returnType = descriptor.returnType!!.ir - function.body = body as IrBody + val function = IrFunctionImpl(start, end, origin, descriptor, descriptor.returnType!!.ir, body as IrBody) function.createParameterDeclarations(context.ir.symbols.symbolTable) function.setOverrides(context.ir.symbols.symbolTable) diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/ir/util/IrUtils2.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/ir/util/IrUtils2.kt index 4b412dff5e0..0061201d650 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/ir/util/IrUtils2.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/ir/util/IrUtils2.kt @@ -106,9 +106,10 @@ private fun createFakeOverride( fun FunctionDescriptor.createFunction(): IrSimpleFunction = IrFunctionImpl( startOffset, endOffset, - IrDeclarationOrigin.FAKE_OVERRIDE, this + IrDeclarationOrigin.FAKE_OVERRIDE, + this, + symbolTable.translateErased(this@createFunction.returnType!!) ).apply { - returnType = symbolTable.translateErased(this@createFunction.returnType!!) createParameterDeclarations(symbolTable) } @@ -162,9 +163,8 @@ private fun createFakeOverride( // TODO: this function doesn't substitute types. fun IrSimpleFunction.copyFake(descriptor: FunctionDescriptor): IrSimpleFunction = IrFunctionImpl( - irClass.startOffset, irClass.endOffset, IrDeclarationOrigin.FAKE_OVERRIDE, descriptor + irClass.startOffset, irClass.endOffset, IrDeclarationOrigin.FAKE_OVERRIDE, descriptor, returnType ).also { - it.returnType = returnType it.parent = irClass it.createDispatchReceiverParameter() diff --git a/backend.native/tests/build.gradle b/backend.native/tests/build.gradle index 58835da96b4..fc7afe4aa16 100644 --- a/backend.native/tests/build.gradle +++ b/backend.native/tests/build.gradle @@ -1547,7 +1547,7 @@ task sort1(type: RunKonanTest) { // when KT-26315 is fixed. task sortWith(type: RunStandaloneKonanTest) { source = "runtime/collections/SortWith.kt" - flags = ['-tr', '--disable', 'devirtualization'] + flags = ['-tr', '-Xdisable=devirtualization'] arguments = ['--ktest_logger=SILENT'] } diff --git a/gradle.properties b/gradle.properties index ee3e02e42ec..d6a3acbbc62 100644 --- a/gradle.properties +++ b/gradle.properties @@ -18,9 +18,9 @@ buildKotlinVersion=1.3.0-rc-116 buildKotlinCompilerRepo=https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_130_CompilerAllPlugins),number:1.3.0-rc-116,tag:kotlin-native,pinned:true/artifacts/content/maven remoteRoot=konan_tests -kotlinCompilerRepo=https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_dev_CompilerAllPlugins),number:1.3.20-dev-2050,tag:kotlin-native,pinned:true/artifacts/content/maven -kotlinVersion=1.3.20-dev-2050 -testKotlinVersion=1.3.20-dev-2050 +kotlinCompilerRepo=https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_dev_CompilerAllPlugins),number:1.3.20-dev-2191,tag:kotlin-native,pinned:true/artifacts/content/maven +kotlinVersion=1.3.20-dev-2191 +testKotlinVersion=1.3.20-dev-2191 konanVersion=1.1.0 org.gradle.jvmargs='-Dfile.encoding=UTF-8' org.gradle.workers.max=4