diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrClassifierStorage.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrClassifierStorage.kt index 630ff095666..f268f055feb 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrClassifierStorage.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrClassifierStorage.kt @@ -8,6 +8,7 @@ package org.jetbrains.kotlin.fir.backend import org.jetbrains.kotlin.descriptors.* import org.jetbrains.kotlin.fir.declarations.* import org.jetbrains.kotlin.fir.resolve.firProvider +import org.jetbrains.kotlin.fir.symbols.StandardClassIds import org.jetbrains.kotlin.fir.symbols.impl.FirClassSymbol import org.jetbrains.kotlin.fir.symbols.impl.FirTypeParameterSymbol import org.jetbrains.kotlin.fir.types.FirTypeRef @@ -243,7 +244,7 @@ class Fir2IrClassifierStorage( } if (index < 0) { val parent = simpleCachedParameter.parent - if (parent !is IrSimpleFunction || parent.returnType == typeConverter.unitType) { + if (parent !is IrSimpleFunction || parent.returnType == irBuiltIns.unitType) { return simpleCachedParameter } } @@ -328,6 +329,14 @@ class Fir2IrClassifierStorage( fun getIrClassSymbol(firClassSymbol: FirClassSymbol<*>): IrClassSymbol { val firClass = firClassSymbol.fir getCachedIrClass(firClass)?.let { return symbolTable.referenceClass(it.descriptor) } + val builtinClassSymbol = when (firClassSymbol.classId) { + StandardClassIds.Any -> irBuiltIns.anyClass + else -> null + } + if (builtinClassSymbol != null && firClass is FirRegularClass) { + classCache[firClass] = builtinClassSymbol.owner + return symbolTable.referenceClass(builtinClassSymbol.descriptor) + } // TODO: remove all this code and change to unbound symbol creation val irClass = createIrClass(firClass) if (firClass is FirAnonymousObject || firClass is FirRegularClass && firClass.visibility == Visibilities.LOCAL) { diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrConverter.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrConverter.kt index 9d13cf573e2..2dcae9e6ec7 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrConverter.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrConverter.kt @@ -40,7 +40,7 @@ class Fir2IrConverter( processClassMembers(regularClass, irClass) } - fun registerFileAndClasses(file: FirFile) { + fun registerFileAndClasses(file: FirFile): IrFile { val irFile = IrFileImpl( sourceManager.getOrCreateFileEntry(file.psi as KtFile), moduleDescriptor.getPackage(file.packageFqName).fragments.first() @@ -51,6 +51,7 @@ class Fir2IrConverter( registerClassAndNestedClasses(it, irFile) } } + return irFile } fun processClassHeaders(file: FirFile) { @@ -175,13 +176,17 @@ class Fir2IrConverter( components.declarationStorage = declarationStorage components.classifierStorage = classifierStorage components.typeConverter = typeConverter - typeConverter.initBuiltinTypes() val irFiles = mutableListOf() val converter = Fir2IrConverter(moduleDescriptor, sourceManager, components) for (firFile in firFiles) { - converter.registerFileAndClasses(firFile) + irFiles += converter.registerFileAndClasses(firFile) } + val irModuleFragment = IrModuleFragmentImpl(moduleDescriptor, builtIns, irFiles) + val externalDependenciesGenerator = ExternalDependenciesGenerator( + symbolTable, generateTypicalIrProviderList(irModuleFragment.descriptor, builtIns, symbolTable) + ) + externalDependenciesGenerator.generateUnboundSymbolsAsDependencies() for (firFile in firFiles) { converter.processClassHeaders(firFile) } @@ -194,22 +199,10 @@ class Fir2IrConverter( val irFile = firFile.accept(fir2irVisitor, null) as IrFile val fileEntry = sourceManager.getOrCreateFileEntry(firFile.psi as KtFile) sourceManager.putFileEntry(irFile, fileEntry) - irFiles += irFile } - val irModuleFragment = IrModuleFragmentImpl(moduleDescriptor, builtIns, irFiles) - generateUnboundSymbolsAsDependencies(irModuleFragment, symbolTable, builtIns) + externalDependenciesGenerator.generateUnboundSymbolsAsDependencies() return Fir2IrResult(irModuleFragment, symbolTable, sourceManager) } - - private fun generateUnboundSymbolsAsDependencies( - irModule: IrModuleFragment, - symbolTable: SymbolTable, - builtIns: IrBuiltIns - ) { - // TODO: provide StubGeneratorExtensions for correct lazy stub IR generation on JVM - ExternalDependenciesGenerator(symbolTable, generateTypicalIrProviderList(irModule.descriptor, builtIns, symbolTable)) - .generateUnboundSymbolsAsDependencies() - } } } \ No newline at end of file diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt index 1bb975df05c..7d5199dcf5f 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt @@ -19,6 +19,7 @@ import org.jetbrains.kotlin.fir.render import org.jetbrains.kotlin.fir.resolve.* import org.jetbrains.kotlin.fir.scopes.impl.FirClassSubstitutionScope import org.jetbrains.kotlin.fir.symbols.FirBasedSymbol +import org.jetbrains.kotlin.fir.symbols.StandardClassIds import org.jetbrains.kotlin.fir.symbols.impl.* import org.jetbrains.kotlin.fir.types.ConeKotlinType import org.jetbrains.kotlin.fir.types.FirTypeRef @@ -33,6 +34,7 @@ import org.jetbrains.kotlin.ir.expressions.impl.IrErrorExpressionImpl import org.jetbrains.kotlin.ir.expressions.impl.IrExpressionBodyImpl import org.jetbrains.kotlin.ir.symbols.* import org.jetbrains.kotlin.ir.types.IrType +import org.jetbrains.kotlin.ir.util.constructors import org.jetbrains.kotlin.name.ClassId import org.jetbrains.kotlin.name.FqName import org.jetbrains.kotlin.name.Name @@ -431,7 +433,7 @@ class Fir2IrDeclarationStorage( propertyAccessor?.psi?.endOffset ?: endOffset, origin, descriptor ) { symbol -> - val accessorReturnType = if (isSetter) typeConverter.unitType else propertyType + val accessorReturnType = if (isSetter) irBuiltIns.unitType else propertyType IrFunctionImpl( startOffset, endOffset, origin, symbol, Name.special("<$prefix-${correspondingProperty.name}>"), @@ -650,6 +652,16 @@ class Fir2IrDeclarationStorage( fun getIrConstructorSymbol(firConstructorSymbol: FirConstructorSymbol): IrConstructorSymbol { val firConstructor = firConstructorSymbol.fir getCachedIrConstructor(firConstructor)?.let { return symbolTable.referenceConstructor(it.descriptor) } + val builtinParent = when (firConstructorSymbol.callableId.classId) { + StandardClassIds.Any -> irBuiltIns.anyClass + else -> null + } + if (builtinParent != null) { + val constructorSymbol = builtinParent.constructors.first() + constructorCache[firConstructor] = constructorSymbol.owner + return symbolTable.referenceConstructor(constructorSymbol.descriptor) + } + val irParent = findIrParent(firConstructor) as IrClass val parentOrigin = (irParent as? IrDeclaration)?.origin ?: IrDeclarationOrigin.DEFINED val irDeclaration = createIrConstructor(firConstructor, irParent, origin = parentOrigin).apply { diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrTypeConverter.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrTypeConverter.kt index 8b354bb3276..499240700a9 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrTypeConverter.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrTypeConverter.kt @@ -8,7 +8,8 @@ package org.jetbrains.kotlin.fir.backend import org.jetbrains.kotlin.fir.resolve.toSymbol import org.jetbrains.kotlin.fir.symbols.StandardClassIds import org.jetbrains.kotlin.fir.types.* -import org.jetbrains.kotlin.ir.symbols.IrClassifierSymbol +import org.jetbrains.kotlin.fir.types.impl.* +import org.jetbrains.kotlin.ir.symbols.IrClassSymbol import org.jetbrains.kotlin.ir.types.IrType import org.jetbrains.kotlin.ir.types.IrTypeArgument import org.jetbrains.kotlin.ir.types.impl.IrSimpleTypeImpl @@ -20,30 +21,59 @@ import org.jetbrains.kotlin.types.Variance class Fir2IrTypeConverter( private val components: Fir2IrComponents ) : Fir2IrComponents by components { - lateinit var nothingType: IrType - lateinit var unitType: IrType - lateinit var booleanType: IrType - lateinit var stringType: IrType + private val classIdToSymbolMap = mapOf( + StandardClassIds.Nothing to irBuiltIns.nothingClass, + StandardClassIds.Unit to irBuiltIns.unitClass, + StandardClassIds.Boolean to irBuiltIns.booleanClass, + StandardClassIds.String to irBuiltIns.stringClass, + StandardClassIds.Any to irBuiltIns.anyClass, + StandardClassIds.Long to irBuiltIns.longClass, + StandardClassIds.Int to irBuiltIns.intClass, + StandardClassIds.Short to irBuiltIns.shortClass, + StandardClassIds.Byte to irBuiltIns.byteClass, + StandardClassIds.Float to irBuiltIns.floatClass, + StandardClassIds.Double to irBuiltIns.doubleClass, + StandardClassIds.Char to irBuiltIns.charClass, + StandardClassIds.Array to irBuiltIns.arrayClass + ) - fun initBuiltinTypes() { - nothingType = session.builtinTypes.nothingType.toIrType() - unitType = session.builtinTypes.unitType.toIrType() - booleanType = session.builtinTypes.booleanType.toIrType() - stringType = session.builtinTypes.stringType.toIrType() - } + private val classIdToTypeMap = mapOf( + StandardClassIds.Nothing to irBuiltIns.nothingType, + StandardClassIds.Unit to irBuiltIns.unitType, + StandardClassIds.Boolean to irBuiltIns.booleanType, + StandardClassIds.String to irBuiltIns.stringType, + StandardClassIds.Any to irBuiltIns.anyType, + StandardClassIds.Long to irBuiltIns.longType, + StandardClassIds.Int to irBuiltIns.intType, + StandardClassIds.Short to irBuiltIns.shortType, + StandardClassIds.Byte to irBuiltIns.byteType, + StandardClassIds.Float to irBuiltIns.floatType, + StandardClassIds.Double to irBuiltIns.doubleType, + StandardClassIds.Char to irBuiltIns.charType + ) fun FirTypeRef.toIrType(typeContext: ConversionTypeContext = ConversionTypeContext.DEFAULT): IrType { - if (this !is FirResolvedTypeRef) { - return createErrorType() + return when (this) { + !is FirResolvedTypeRef -> createErrorType() + !is FirImplicitBuiltinTypeRef -> type.toIrType(typeContext) + is FirImplicitNothingTypeRef -> irBuiltIns.nothingType + is FirImplicitUnitTypeRef -> irBuiltIns.unitType + is FirImplicitBooleanTypeRef -> irBuiltIns.booleanType + is FirImplicitStringTypeRef -> irBuiltIns.stringType + is FirImplicitAnyTypeRef -> irBuiltIns.anyType + is FirImplicitIntTypeRef -> irBuiltIns.intType + is FirImplicitNullableAnyTypeRef -> irBuiltIns.anyNType + is FirImplicitNullableNothingTypeRef -> irBuiltIns.nothingNType + else -> type.toIrType(typeContext) } - return type.toIrType(typeContext) } fun ConeKotlinType.toIrType(typeContext: ConversionTypeContext = ConversionTypeContext.DEFAULT): IrType { return when (this) { is ConeKotlinErrorType -> createErrorType() is ConeLookupTagBasedType -> { - val irSymbol = getArrayType(this.classId) ?: run { + val classId = this.classId + val irSymbol = getBuiltInClassSymbol(classId) ?: run { val firSymbol = this.lookupTag.toSymbol(session) ?: return createErrorType() firSymbol.toSymbol(session, classifierStorage, typeContext) } @@ -91,22 +121,14 @@ class Fir2IrTypeConverter( } } - private fun getArrayType(classId: ClassId?): IrClassifierSymbol? { - if (classId == StandardClassIds.Array) { - return irBuiltIns.arrayClass - } + private fun getArrayClassSymbol(classId: ClassId?): IrClassSymbol? { val primitiveId = StandardClassIds.elementTypeByPrimitiveArrayType[classId] ?: return null - val irType = when (primitiveId) { - StandardClassIds.Boolean -> irBuiltIns.booleanType - StandardClassIds.Byte -> irBuiltIns.byteType - StandardClassIds.Char -> irBuiltIns.charType - StandardClassIds.Double -> irBuiltIns.doubleType - StandardClassIds.Float -> irBuiltIns.floatType - StandardClassIds.Int -> irBuiltIns.intType - StandardClassIds.Long -> irBuiltIns.longType - StandardClassIds.Short -> irBuiltIns.shortType - else -> throw AssertionError("Strange primitiveId $primitiveId from array: $classId") - } - return irBuiltIns.primitiveArrayForType.getValue(irType) + val irType = classIdToTypeMap[primitiveId] + return irBuiltIns.primitiveArrayForType[irType] + ?: throw AssertionError("Strange primitiveId $primitiveId from array: $classId") + } + + private fun getBuiltInClassSymbol(classId: ClassId?): IrClassSymbol? { + return classIdToSymbolMap[classId] ?: getArrayClassSymbol(classId) } } \ No newline at end of file diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt index 6175d2f9fc3..42f174650df 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt @@ -234,7 +234,7 @@ class Fir2IrVisitor( val result = returnExpression.result val descriptor = irTarget.descriptor IrReturnImpl( - startOffset, endOffset, typeConverter.nothingType, + startOffset, endOffset, irBuiltIns.nothingType, when (descriptor) { is ClassConstructorDescriptor -> symbolTable.referenceConstructor(descriptor) else -> symbolTable.referenceSimpleFunction(descriptor) @@ -396,7 +396,7 @@ class Fir2IrVisitor( is FirBlock -> expression.convertToIrExpressionOrBlock() is FirUnitExpression -> expression.convertWithOffsets { startOffset, endOffset -> IrGetObjectValueImpl( - startOffset, endOffset, this.typeConverter.unitType, + startOffset, endOffset, irBuiltIns.unitType, this.symbolTable.referenceClass(this.irBuiltIns.builtIns.unit) ) } @@ -434,7 +434,7 @@ class Fir2IrVisitor( startOffset, endOffset, if (irStatements.isNotEmpty()) { irStatements.filterNotNull().takeIf { it.isNotEmpty() } - ?: listOf(IrBlockImpl(startOffset, endOffset, this.typeConverter.unitType, null, emptyList())) + ?: listOf(IrBlockImpl(startOffset, endOffset, irBuiltIns.unitType, null, emptyList())) } else { emptyList() } @@ -450,7 +450,7 @@ class Fir2IrVisitor( } } val type = - (statements.lastOrNull() as? FirExpression)?.typeRef?.toIrType() ?: typeConverter.unitType + (statements.lastOrNull() as? FirExpression)?.typeRef?.toIrType() ?: irBuiltIns.unitType return convertWithOffsets { startOffset, endOffset -> IrBlockImpl( startOffset, endOffset, type, origin, @@ -522,7 +522,7 @@ class Fir2IrVisitor( val condition = whenBranch.condition val irResult = convertToIrExpression(whenBranch.result) if (condition is FirElseIfTrueCondition) { - IrElseBranchImpl(IrConstImpl.boolean(irResult.startOffset, irResult.endOffset, typeConverter.booleanType, true), irResult) + IrElseBranchImpl(IrConstImpl.boolean(irResult.startOffset, irResult.endOffset, irBuiltIns.booleanType, true), irResult) } else { IrBranchImpl(startOffset, endOffset, convertToIrExpression(condition), irResult) } @@ -541,7 +541,7 @@ class Fir2IrVisitor( override fun visitDoWhileLoop(doWhileLoop: FirDoWhileLoop, data: Any?): IrElement { return doWhileLoop.convertWithOffsets { startOffset, endOffset -> IrDoWhileLoopImpl( - startOffset, endOffset, typeConverter.unitType, + startOffset, endOffset, irBuiltIns.unitType, IrStatementOrigin.DO_WHILE_LOOP ).apply { loopMap[doWhileLoop] = this @@ -557,7 +557,7 @@ class Fir2IrVisitor( return whileLoop.convertWithOffsets { startOffset, endOffset -> val origin = if (whileLoop.psi is KtForExpression) IrStatementOrigin.FOR_LOOP_INNER_WHILE else IrStatementOrigin.WHILE_LOOP - IrWhileLoopImpl(startOffset, endOffset, typeConverter.unitType, origin).apply { + IrWhileLoopImpl(startOffset, endOffset, irBuiltIns.unitType, origin).apply { loopMap[whileLoop] = this label = whileLoop.label?.name condition = convertToIrExpression(whileLoop.condition) @@ -574,7 +574,7 @@ class Fir2IrVisitor( val firLoop = target.labeledElement val irLoop = loopMap[firLoop] if (irLoop == null) { - IrErrorExpressionImpl(startOffset, endOffset, typeConverter.nothingType, "Unbound loop: ${render()}") + IrErrorExpressionImpl(startOffset, endOffset, irBuiltIns.nothingType, "Unbound loop: ${render()}") } else { f(startOffset, endOffset, irLoop).apply { label = irLoop.label.takeIf { target.labelName != null } @@ -585,19 +585,19 @@ class Fir2IrVisitor( override fun visitBreakExpression(breakExpression: FirBreakExpression, data: Any?): IrElement { return breakExpression.convertJumpWithOffsets { startOffset, endOffset, irLoop -> - IrBreakImpl(startOffset, endOffset, typeConverter.nothingType, irLoop) + IrBreakImpl(startOffset, endOffset, irBuiltIns.nothingType, irLoop) } } override fun visitContinueExpression(continueExpression: FirContinueExpression, data: Any?): IrElement { return continueExpression.convertJumpWithOffsets { startOffset, endOffset, irLoop -> - IrContinueImpl(startOffset, endOffset, typeConverter.nothingType, irLoop) + IrContinueImpl(startOffset, endOffset, irBuiltIns.nothingType, irLoop) } } override fun visitThrowExpression(throwExpression: FirThrowExpression, data: Any?): IrElement { return throwExpression.convertWithOffsets { startOffset, endOffset -> - IrThrowImpl(startOffset, endOffset, typeConverter.nothingType, convertToIrExpression(throwExpression.exception)) + IrThrowImpl(startOffset, endOffset, irBuiltIns.nothingType, convertToIrExpression(throwExpression.exception)) } } @@ -638,7 +638,7 @@ class Fir2IrVisitor( return primitiveOp2( startOffset, endOffset, symbol!!, - typeConverter.booleanType, + irBuiltIns.booleanType, origin, visitFunctionCall(comparisonExpression.compareToCall, null), IrConstImpl.int(startOffset, endOffset, irBuiltIns.intType, 0) @@ -666,7 +666,7 @@ class Fir2IrVisitor( val (symbol, origin) = getSymbolAndOriginForComparison(operation, simpleType.classifierOrFail) return primitiveOp2( - startOffset, endOffset, symbol!!, typeConverter.booleanType, origin, + startOffset, endOffset, symbol!!, irBuiltIns.booleanType, origin, convertToIrExpression(comparisonExpression.left), convertToIrExpression(comparisonExpression.right) ) } @@ -688,11 +688,11 @@ class Fir2IrVisitor( startOffset: Int, endOffset: Int, operation: FirOperation, arguments: List ): IrExpression { val (type, symbol, origin) = when (operation) { - FirOperation.EQ -> Triple(typeConverter.booleanType, irBuiltIns.eqeqSymbol, IrStatementOrigin.EQEQ) - FirOperation.NOT_EQ -> Triple(typeConverter.booleanType, irBuiltIns.eqeqSymbol, IrStatementOrigin.EXCLEQ) - FirOperation.IDENTITY -> Triple(typeConverter.booleanType, irBuiltIns.eqeqeqSymbol, IrStatementOrigin.EQEQEQ) - FirOperation.NOT_IDENTITY -> Triple(typeConverter.booleanType, irBuiltIns.eqeqeqSymbol, IrStatementOrigin.EXCLEQEQ) - FirOperation.EXCL -> Triple(typeConverter.booleanType, irBuiltIns.booleanNotSymbol, IrStatementOrigin.EXCL) + FirOperation.EQ -> Triple(irBuiltIns.booleanType, irBuiltIns.eqeqSymbol, IrStatementOrigin.EQEQ) + FirOperation.NOT_EQ -> Triple(irBuiltIns.booleanType, irBuiltIns.eqeqSymbol, IrStatementOrigin.EXCLEQ) + FirOperation.IDENTITY -> Triple(irBuiltIns.booleanType, irBuiltIns.eqeqeqSymbol, IrStatementOrigin.EQEQEQ) + FirOperation.NOT_IDENTITY -> Triple(irBuiltIns.booleanType, irBuiltIns.eqeqeqSymbol, IrStatementOrigin.EXCLEQEQ) + FirOperation.EXCL -> Triple(irBuiltIns.booleanType, irBuiltIns.booleanNotSymbol, IrStatementOrigin.EXCL) FirOperation.LT, FirOperation.GT, FirOperation.LT_EQ, FirOperation.GT_EQ, FirOperation.OTHER, FirOperation.ASSIGN, FirOperation.PLUS_ASSIGN, @@ -713,7 +713,7 @@ class Fir2IrVisitor( ) } if (operation !in NEGATED_OPERATIONS) return result - return primitiveOp1(startOffset, endOffset, irBuiltIns.booleanNotSymbol, typeConverter.booleanType, origin, result) + return primitiveOp1(startOffset, endOffset, irBuiltIns.booleanNotSymbol, irBuiltIns.booleanType, origin, result) } override fun visitOperatorCall(operatorCall: FirOperatorCall, data: Any?): IrElement { @@ -725,7 +725,7 @@ class Fir2IrVisitor( override fun visitStringConcatenationCall(stringConcatenationCall: FirStringConcatenationCall, data: Any?): IrElement { return stringConcatenationCall.convertWithOffsets { startOffset, endOffset -> IrStringConcatenationImpl( - startOffset, endOffset, typeConverter.stringType, + startOffset, endOffset, irBuiltIns.stringType, stringConcatenationCall.arguments.map { convertToIrExpression(it) } ) } @@ -735,8 +735,8 @@ class Fir2IrVisitor( return typeOperatorCall.convertWithOffsets { startOffset, endOffset -> val irTypeOperand = typeOperatorCall.conversionTypeRef.toIrType() val (irType, irTypeOperator) = when (typeOperatorCall.operation) { - FirOperation.IS -> typeConverter.booleanType to IrTypeOperator.INSTANCEOF - FirOperation.NOT_IS -> typeConverter.booleanType to IrTypeOperator.NOT_INSTANCEOF + FirOperation.IS -> irBuiltIns.booleanType to IrTypeOperator.INSTANCEOF + FirOperation.NOT_IS -> irBuiltIns.booleanType to IrTypeOperator.NOT_INSTANCEOF FirOperation.AS -> irTypeOperand to IrTypeOperator.CAST FirOperation.SAFE_AS -> irTypeOperand.makeNullable() to IrTypeOperator.SAFE_CAST else -> TODO("Should not be here: ${typeOperatorCall.operation} in type operator call") @@ -794,7 +794,7 @@ class Fir2IrVisitor( override fun visitAugmentedArraySetCall(augmentedArraySetCall: FirAugmentedArraySetCall, data: Any?): IrElement { return augmentedArraySetCall.convertWithOffsets { startOffset, endOffset -> IrErrorCallExpressionImpl( - startOffset, endOffset, typeConverter.unitType, + startOffset, endOffset, irBuiltIns.unitType, "FirArraySetCall (resolve isn't supported yet)" ) } diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallGenerator.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallGenerator.kt index 53cac546cb2..ff6dc55bc71 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallGenerator.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallGenerator.kt @@ -87,7 +87,7 @@ internal class CallGenerator( } fun convertToIrSetCall(variableAssignment: FirVariableAssignment): IrExpression { - val type = typeConverter.unitType + val type = irBuiltIns.unitType val calleeReference = variableAssignment.calleeReference val symbol = calleeReference.toSymbol(session, classifierStorage, declarationStorage) val origin = IrStatementOrigin.EQ diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/ClassMemberGenerator.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/ClassMemberGenerator.kt index fd0849550c6..42b9a6ed35f 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/ClassMemberGenerator.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/ClassMemberGenerator.kt @@ -215,13 +215,13 @@ internal class ClassMemberGenerator( startOffset, endOffset, listOf( if (isSetter) { - IrSetFieldImpl(startOffset, endOffset, fieldSymbol, typeConverter.unitType).apply { + IrSetFieldImpl(startOffset, endOffset, fieldSymbol, irBuiltIns.unitType).apply { setReceiver(declaration) value = IrGetValueImpl(startOffset, endOffset, propertyType, valueParameters.first().symbol) } } else { IrReturnImpl( - startOffset, endOffset, typeConverter.nothingType, symbol, + startOffset, endOffset, irBuiltIns.nothingType, symbol, IrGetFieldImpl(startOffset, endOffset, fieldSymbol, propertyType).setReceiver(declaration) ) } diff --git a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/LowerUtils.kt b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/LowerUtils.kt index 960c141469b..08ece5dbeee 100644 --- a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/LowerUtils.kt +++ b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/LowerUtils.kt @@ -185,7 +185,7 @@ fun IrConstructor.callsSuper(irBuiltIns: IrBuiltIns): Boolean { else if (delegatingClass.descriptor != constructedClass.descriptor) throw AssertionError( "Expected either call to another constructor of the class being constructed or" + - " call to super class constructor. But was: $delegatingClass" + " call to super class constructor. But was: $delegatingClass with '${delegatingClass.name}' name" ) } }) diff --git a/compiler/testData/codegen/box/assert/alwaysDisable.kt b/compiler/testData/codegen/box/assert/alwaysDisable.kt index 1c9c2e96078..b3039412e24 100644 --- a/compiler/testData/codegen/box/assert/alwaysDisable.kt +++ b/compiler/testData/codegen/box/assert/alwaysDisable.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: NATIVE // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS diff --git a/compiler/testData/codegen/box/assert/alwaysEnable.kt b/compiler/testData/codegen/box/assert/alwaysEnable.kt index f328151fb13..68555d9a859 100644 --- a/compiler/testData/codegen/box/assert/alwaysEnable.kt +++ b/compiler/testData/codegen/box/assert/alwaysEnable.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS // KOTLIN_CONFIGURATION_FLAGS: ASSERTIONS_MODE=always-enable diff --git a/compiler/testData/codegen/box/callableReference/bound/captureVarInInitBlock.kt b/compiler/testData/codegen/box/callableReference/bound/captureVarInInitBlock.kt index 1d5e72d770f..2f443a31dca 100644 --- a/compiler/testData/codegen/box/callableReference/bound/captureVarInInitBlock.kt +++ b/compiler/testData/codegen/box/callableReference/bound/captureVarInInitBlock.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR fun bar(b: ()-> Unit) { b() } diff --git a/compiler/testData/codegen/box/callableReference/bound/captureVarInPropertyInit.kt b/compiler/testData/codegen/box/callableReference/bound/captureVarInPropertyInit.kt index 60a1ca79a5c..7a29b25c7e3 100644 --- a/compiler/testData/codegen/box/callableReference/bound/captureVarInPropertyInit.kt +++ b/compiler/testData/codegen/box/callableReference/bound/captureVarInPropertyInit.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR fun bar(b: ()-> Unit) { b() } diff --git a/compiler/testData/codegen/box/casts/as.kt b/compiler/testData/codegen/box/casts/as.kt index 44f1e1f0954..d3bb682236b 100644 --- a/compiler/testData/codegen/box/casts/as.kt +++ b/compiler/testData/codegen/box/casts/as.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/casts/asSafe.kt b/compiler/testData/codegen/box/casts/asSafe.kt index 5bf72a98bca..2622e460551 100644 --- a/compiler/testData/codegen/box/casts/asSafe.kt +++ b/compiler/testData/codegen/box/casts/asSafe.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/casts/is.kt b/compiler/testData/codegen/box/casts/is.kt index 397bb001dba..54cda6f6af6 100644 --- a/compiler/testData/codegen/box/casts/is.kt +++ b/compiler/testData/codegen/box/casts/is.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/casts/notIs.kt b/compiler/testData/codegen/box/casts/notIs.kt index f806aa1d435..a2c6110adcb 100644 --- a/compiler/testData/codegen/box/casts/notIs.kt +++ b/compiler/testData/codegen/box/casts/notIs.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/classes/kt1120.kt b/compiler/testData/codegen/box/classes/kt1120.kt index c8d315ceffb..d5b5a8685a6 100644 --- a/compiler/testData/codegen/box/classes/kt1120.kt +++ b/compiler/testData/codegen/box/classes/kt1120.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // Won't ever work with JS backend. // TODO: Consider rewriting this test without using threads, since the issue is not about threads at all. diff --git a/compiler/testData/codegen/box/classes/kt1157.kt b/compiler/testData/codegen/box/classes/kt1157.kt index cd78bd9209e..126889d5110 100644 --- a/compiler/testData/codegen/box/classes/kt1157.kt +++ b/compiler/testData/codegen/box/classes/kt1157.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR public object SomeClass { private val work = object : Runnable { override fun run() { diff --git a/compiler/testData/codegen/box/classes/kt1578.kt b/compiler/testData/codegen/box/classes/kt1578.kt index 45115b8ddad..e485684b4da 100644 --- a/compiler/testData/codegen/box/classes/kt1578.kt +++ b/compiler/testData/codegen/box/classes/kt1578.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR fun box() : String { var i = 0 { diff --git a/compiler/testData/codegen/box/classes/kt2532.kt b/compiler/testData/codegen/box/classes/kt2532.kt index d06b6d2e020..24d12e9f884 100644 --- a/compiler/testData/codegen/box/classes/kt2532.kt +++ b/compiler/testData/codegen/box/classes/kt2532.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR package foo interface B { diff --git a/compiler/testData/codegen/box/closures/captureInSuperConstructorCall/localCapturedInAnonymousObjectInLocalClass.kt b/compiler/testData/codegen/box/closures/captureInSuperConstructorCall/localCapturedInAnonymousObjectInLocalClass.kt index 8e6ff6bdb34..b2670e3b1eb 100644 --- a/compiler/testData/codegen/box/closures/captureInSuperConstructorCall/localCapturedInAnonymousObjectInLocalClass.kt +++ b/compiler/testData/codegen/box/closures/captureInSuperConstructorCall/localCapturedInAnonymousObjectInLocalClass.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR interface Callback { fun invoke(): String } diff --git a/compiler/testData/codegen/box/closures/captureInSuperConstructorCall/localCapturedInAnonymousObjectInLocalClass2.kt b/compiler/testData/codegen/box/closures/captureInSuperConstructorCall/localCapturedInAnonymousObjectInLocalClass2.kt index 57336b36a26..566809f3cb3 100644 --- a/compiler/testData/codegen/box/closures/captureInSuperConstructorCall/localCapturedInAnonymousObjectInLocalClass2.kt +++ b/compiler/testData/codegen/box/closures/captureInSuperConstructorCall/localCapturedInAnonymousObjectInLocalClass2.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR interface Callback { fun invoke(): String } diff --git a/compiler/testData/codegen/box/closures/captureOuterProperty/kt4656.kt b/compiler/testData/codegen/box/closures/captureOuterProperty/kt4656.kt index 17fc0572471..c3b93ff7efd 100644 --- a/compiler/testData/codegen/box/closures/captureOuterProperty/kt4656.kt +++ b/compiler/testData/codegen/box/closures/captureOuterProperty/kt4656.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR //KT-4656 Wrong capturing a function literal variable fun box(): String { diff --git a/compiler/testData/codegen/box/closures/capturedVarsOptimization/capturedInInlineOnlyIncrDecr.kt b/compiler/testData/codegen/box/closures/capturedVarsOptimization/capturedInInlineOnlyIncrDecr.kt index fef68b2665d..c8d5c31083e 100644 --- a/compiler/testData/codegen/box/closures/capturedVarsOptimization/capturedInInlineOnlyIncrDecr.kt +++ b/compiler/testData/codegen/box/closures/capturedVarsOptimization/capturedInInlineOnlyIncrDecr.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME fun box(): String { diff --git a/compiler/testData/codegen/box/closures/capturedVarsOptimization/capturedVarsOfSize2.kt b/compiler/testData/codegen/box/closures/capturedVarsOptimization/capturedVarsOfSize2.kt index 2044cc2c58a..10f31cbc43a 100644 --- a/compiler/testData/codegen/box/closures/capturedVarsOptimization/capturedVarsOfSize2.kt +++ b/compiler/testData/codegen/box/closures/capturedVarsOptimization/capturedVarsOfSize2.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME fun box(): String { diff --git a/compiler/testData/codegen/box/closures/capturedVarsOptimization/kt17200.kt b/compiler/testData/codegen/box/closures/capturedVarsOptimization/kt17200.kt index c437cb2fbff..0d223fc9f97 100644 --- a/compiler/testData/codegen/box/closures/capturedVarsOptimization/kt17200.kt +++ b/compiler/testData/codegen/box/closures/capturedVarsOptimization/kt17200.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR inline fun inlineCall(action: () -> Unit) { action() } diff --git a/compiler/testData/codegen/box/closures/capturedVarsOptimization/sharedSlotsWithCapturedVars.kt b/compiler/testData/codegen/box/closures/capturedVarsOptimization/sharedSlotsWithCapturedVars.kt index f5da4c81b7b..09ed429ede5 100644 --- a/compiler/testData/codegen/box/closures/capturedVarsOptimization/sharedSlotsWithCapturedVars.kt +++ b/compiler/testData/codegen/box/closures/capturedVarsOptimization/sharedSlotsWithCapturedVars.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME fun box(): String { diff --git a/compiler/testData/codegen/box/closures/closureOnTopLevel1.kt b/compiler/testData/codegen/box/closures/closureOnTopLevel1.kt index c760579db0f..16013731c04 100644 --- a/compiler/testData/codegen/box/closures/closureOnTopLevel1.kt +++ b/compiler/testData/codegen/box/closures/closureOnTopLevel1.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS diff --git a/compiler/testData/codegen/box/closures/closureOnTopLevel2.kt b/compiler/testData/codegen/box/closures/closureOnTopLevel2.kt index 73b5b3f11b2..c8ec18dab8f 100644 --- a/compiler/testData/codegen/box/closures/closureOnTopLevel2.kt +++ b/compiler/testData/codegen/box/closures/closureOnTopLevel2.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS diff --git a/compiler/testData/codegen/box/closures/refsAreSerializable.kt b/compiler/testData/codegen/box/closures/refsAreSerializable.kt index f41ebd3d701..05c2060bada 100644 --- a/compiler/testData/codegen/box/closures/refsAreSerializable.kt +++ b/compiler/testData/codegen/box/closures/refsAreSerializable.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM import java.io.* diff --git a/compiler/testData/codegen/box/constructorCall/nonLocalReturnInConstructorArguments.kt b/compiler/testData/codegen/box/constructorCall/nonLocalReturnInConstructorArguments.kt index 56bd5bf0edb..a2c8602af59 100644 --- a/compiler/testData/codegen/box/constructorCall/nonLocalReturnInConstructorArguments.kt +++ b/compiler/testData/codegen/box/constructorCall/nonLocalReturnInConstructorArguments.kt @@ -1,5 +1,4 @@ // !LANGUAGE: -NormalizeConstructorCalls -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_RUNTIME // FILE: test.kt diff --git a/compiler/testData/codegen/box/contracts/exactlyOnceNotInline.kt b/compiler/testData/codegen/box/contracts/exactlyOnceNotInline.kt index 2830156b1be..f7b19d6e890 100644 --- a/compiler/testData/codegen/box/contracts/exactlyOnceNotInline.kt +++ b/compiler/testData/codegen/box/contracts/exactlyOnceNotInline.kt @@ -1,5 +1,4 @@ // !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: NATIVE import kotlin.contracts.* diff --git a/compiler/testData/codegen/box/controlStructures/kt2597.kt b/compiler/testData/codegen/box/controlStructures/kt2597.kt index 4c383b38fce..af5af144a86 100644 --- a/compiler/testData/codegen/box/controlStructures/kt2597.kt +++ b/compiler/testData/codegen/box/controlStructures/kt2597.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR fun box(): String { var i = 0 { diff --git a/compiler/testData/codegen/box/controlStructures/tryCatchInExpressions/expectException.kt b/compiler/testData/codegen/box/controlStructures/tryCatchInExpressions/expectException.kt index ea3e1f51116..63bd4900c12 100644 --- a/compiler/testData/codegen/box/controlStructures/tryCatchInExpressions/expectException.kt +++ b/compiler/testData/codegen/box/controlStructures/tryCatchInExpressions/expectException.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR public inline fun fails(block: () -> Unit): Throwable? { var thrown: Throwable? = null try { diff --git a/compiler/testData/codegen/box/controlStructures/tryCatchInExpressions/kt8608.kt b/compiler/testData/codegen/box/controlStructures/tryCatchInExpressions/kt8608.kt index 9da057f8400..1d0b92b2c09 100644 --- a/compiler/testData/codegen/box/controlStructures/tryCatchInExpressions/kt8608.kt +++ b/compiler/testData/codegen/box/controlStructures/tryCatchInExpressions/kt8608.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR interface Callable { fun call(b: Boolean) } diff --git a/compiler/testData/codegen/box/coroutines/kt31784.kt b/compiler/testData/codegen/box/coroutines/kt31784.kt index 1f79ae151cb..cfd75d5adb0 100644 --- a/compiler/testData/codegen/box/coroutines/kt31784.kt +++ b/compiler/testData/codegen/box/coroutines/kt31784.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +NewInference -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME @file:OptIn(ExperimentalTypeInference::class) diff --git a/compiler/testData/codegen/box/coroutines/multiModule/inlineWithJava.kt b/compiler/testData/codegen/box/coroutines/multiModule/inlineWithJava.kt index aa7c820ff98..733f95a6f2d 100644 --- a/compiler/testData/codegen/box/coroutines/multiModule/inlineWithJava.kt +++ b/compiler/testData/codegen/box/coroutines/multiModule/inlineWithJava.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_COROUTINES // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/delegatedProperty/local/capturedLocalVar.kt b/compiler/testData/codegen/box/delegatedProperty/local/capturedLocalVar.kt index c721ed2c946..d655e965ab1 100644 --- a/compiler/testData/codegen/box/delegatedProperty/local/capturedLocalVar.kt +++ b/compiler/testData/codegen/box/delegatedProperty/local/capturedLocalVar.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR package foo import kotlin.reflect.KProperty diff --git a/compiler/testData/codegen/box/delegatedProperty/local/capturedLocalVarNoInline.kt b/compiler/testData/codegen/box/delegatedProperty/local/capturedLocalVarNoInline.kt index 54b1ff1f3e1..8ac07a3f364 100644 --- a/compiler/testData/codegen/box/delegatedProperty/local/capturedLocalVarNoInline.kt +++ b/compiler/testData/codegen/box/delegatedProperty/local/capturedLocalVarNoInline.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR package foo import kotlin.reflect.KProperty diff --git a/compiler/testData/codegen/box/delegation/byMiddleInterface.kt b/compiler/testData/codegen/box/delegation/byMiddleInterface.kt index 1c600f4ad02..5f6256df741 100644 --- a/compiler/testData/codegen/box/delegation/byMiddleInterface.kt +++ b/compiler/testData/codegen/box/delegation/byMiddleInterface.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // SKIP_JDK6 // TARGET_BACKEND: JVM diff --git a/compiler/testData/codegen/box/delegation/diamond.kt b/compiler/testData/codegen/box/delegation/diamond.kt index 7d41b8609d3..8a60bda7ef8 100644 --- a/compiler/testData/codegen/box/delegation/diamond.kt +++ b/compiler/testData/codegen/box/delegation/diamond.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // SKIP_JDK6 // TARGET_BACKEND: JVM // FILE: Base.java diff --git a/compiler/testData/codegen/box/delegation/simple.kt b/compiler/testData/codegen/box/delegation/simple.kt index 149d52b5424..418cea053e1 100644 --- a/compiler/testData/codegen/box/delegation/simple.kt +++ b/compiler/testData/codegen/box/delegation/simple.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // SKIP_JDK6 // TARGET_BACKEND: JVM // FILE: Base.java diff --git a/compiler/testData/codegen/box/enum/kt20651b.kt b/compiler/testData/codegen/box/enum/kt20651b.kt index 2ca5b461c1a..477e3036569 100644 --- a/compiler/testData/codegen/box/enum/kt20651b.kt +++ b/compiler/testData/codegen/box/enum/kt20651b.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR interface Callback { fun invoke(): String } diff --git a/compiler/testData/codegen/box/functions/kt873.kt b/compiler/testData/codegen/box/functions/kt873.kt index 5382d4ea5ad..21c3dcd3338 100644 --- a/compiler/testData/codegen/box/functions/kt873.kt +++ b/compiler/testData/codegen/box/functions/kt873.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR fun box() : String { val fps : Double = 1.toDouble() var mspf : Long diff --git a/compiler/testData/codegen/box/functions/localFunction.kt b/compiler/testData/codegen/box/functions/localFunction.kt index 62d577603a0..b43377b6ab1 100644 --- a/compiler/testData/codegen/box/functions/localFunction.kt +++ b/compiler/testData/codegen/box/functions/localFunction.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR fun IntRange.forEach(body : (Int) -> Unit) { for(i in this) { body(i) diff --git a/compiler/testData/codegen/box/inlineClasses/kt28585.kt b/compiler/testData/codegen/box/inlineClasses/kt28585.kt index af35c3ef72c..feaab23ffa2 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt28585.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt28585.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // !LANGUAGE: +InlineClasses // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/instructions/swap/swapRefToSharedVarInt.kt b/compiler/testData/codegen/box/instructions/swap/swapRefToSharedVarInt.kt index ca4415b28e0..619bfd3a800 100644 --- a/compiler/testData/codegen/box/instructions/swap/swapRefToSharedVarInt.kt +++ b/compiler/testData/codegen/box/instructions/swap/swapRefToSharedVarInt.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR fun box(): String { var a: Int a = 12 diff --git a/compiler/testData/codegen/box/instructions/swap/swapRefToSharedVarLong.kt b/compiler/testData/codegen/box/instructions/swap/swapRefToSharedVarLong.kt index 13cee4d244e..7340eb15d14 100644 --- a/compiler/testData/codegen/box/instructions/swap/swapRefToSharedVarLong.kt +++ b/compiler/testData/codegen/box/instructions/swap/swapRefToSharedVarLong.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR //KT-3042 Attempt to split long or double on the stack excepion fun box(): String { diff --git a/compiler/testData/codegen/box/ir/closureConversion/mutablePrimitives.kt b/compiler/testData/codegen/box/ir/closureConversion/mutablePrimitives.kt index f8bb97310a9..314ff34dd37 100644 --- a/compiler/testData/codegen/box/ir/closureConversion/mutablePrimitives.kt +++ b/compiler/testData/codegen/box/ir/closureConversion/mutablePrimitives.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR fun testBoolean(v: Boolean): Boolean { var value = false fun setValue(v: Boolean) { diff --git a/compiler/testData/codegen/box/multiDecl/VarCapturedInFunctionLiteral.kt b/compiler/testData/codegen/box/multiDecl/VarCapturedInFunctionLiteral.kt index a33099640c0..e0eb2cb5edd 100644 --- a/compiler/testData/codegen/box/multiDecl/VarCapturedInFunctionLiteral.kt +++ b/compiler/testData/codegen/box/multiDecl/VarCapturedInFunctionLiteral.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR class A { operator fun component1() = 1 operator fun component2() = 2 diff --git a/compiler/testData/codegen/box/multiDecl/VarCapturedInLocalFunction.kt b/compiler/testData/codegen/box/multiDecl/VarCapturedInLocalFunction.kt index b2715ff3099..5c2a87c9d65 100644 --- a/compiler/testData/codegen/box/multiDecl/VarCapturedInLocalFunction.kt +++ b/compiler/testData/codegen/box/multiDecl/VarCapturedInLocalFunction.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR class A { } diff --git a/compiler/testData/codegen/box/multiDecl/VarCapturedInObjectLiteral.kt b/compiler/testData/codegen/box/multiDecl/VarCapturedInObjectLiteral.kt index 0e836751dd0..48534b362c6 100644 --- a/compiler/testData/codegen/box/multiDecl/VarCapturedInObjectLiteral.kt +++ b/compiler/testData/codegen/box/multiDecl/VarCapturedInObjectLiteral.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR class A { operator fun component1() = 1 operator fun component2() = 2 diff --git a/compiler/testData/codegen/box/nonLocalReturns/localReturnInsideProperty.kt b/compiler/testData/codegen/box/nonLocalReturns/localReturnInsideProperty.kt index c8b74cf76fc..7808b367f3e 100644 --- a/compiler/testData/codegen/box/nonLocalReturns/localReturnInsideProperty.kt +++ b/compiler/testData/codegen/box/nonLocalReturns/localReturnInsideProperty.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR interface ClassData fun f() = object : ClassData { diff --git a/compiler/testData/codegen/box/objects/anonymousObjectReturnsFromTopLevelFun.kt b/compiler/testData/codegen/box/objects/anonymousObjectReturnsFromTopLevelFun.kt index f746e709f95..c2f14068bfe 100644 --- a/compiler/testData/codegen/box/objects/anonymousObjectReturnsFromTopLevelFun.kt +++ b/compiler/testData/codegen/box/objects/anonymousObjectReturnsFromTopLevelFun.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR interface IFoo { fun foo(): String } diff --git a/compiler/testData/codegen/box/objects/kt2663.kt b/compiler/testData/codegen/box/objects/kt2663.kt index ddea6734883..b7dad56133f 100644 --- a/compiler/testData/codegen/box/objects/kt2663.kt +++ b/compiler/testData/codegen/box/objects/kt2663.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR fun box() : String { var a = 1 diff --git a/compiler/testData/codegen/box/objects/kt4086.kt b/compiler/testData/codegen/box/objects/kt4086.kt index 368c7a707f3..2aa1ca343d8 100644 --- a/compiler/testData/codegen/box/objects/kt4086.kt +++ b/compiler/testData/codegen/box/objects/kt4086.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR interface N open class Base(n: N) diff --git a/compiler/testData/codegen/box/objects/kt560.kt b/compiler/testData/codegen/box/objects/kt560.kt index 66b1ea17163..4ff549776e4 100644 --- a/compiler/testData/codegen/box/objects/kt560.kt +++ b/compiler/testData/codegen/box/objects/kt560.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM package while_bug_1 diff --git a/compiler/testData/codegen/box/objects/selfReferenceToCompanionObjectInAnonymousObjectInSuperConstructorCall.kt b/compiler/testData/codegen/box/objects/selfReferenceToCompanionObjectInAnonymousObjectInSuperConstructorCall.kt index 69a0d870fca..099a68bfe1f 100644 --- a/compiler/testData/codegen/box/objects/selfReferenceToCompanionObjectInAnonymousObjectInSuperConstructorCall.kt +++ b/compiler/testData/codegen/box/objects/selfReferenceToCompanionObjectInAnonymousObjectInSuperConstructorCall.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR interface IFn { operator fun invoke(): String } diff --git a/compiler/testData/codegen/box/objects/selfReferenceToInterfaceCompanionObjectInAnonymousObjectInSuperConstructorCall.kt b/compiler/testData/codegen/box/objects/selfReferenceToInterfaceCompanionObjectInAnonymousObjectInSuperConstructorCall.kt index 07d99c40bea..f1b33e5ba20 100644 --- a/compiler/testData/codegen/box/objects/selfReferenceToInterfaceCompanionObjectInAnonymousObjectInSuperConstructorCall.kt +++ b/compiler/testData/codegen/box/objects/selfReferenceToInterfaceCompanionObjectInAnonymousObjectInSuperConstructorCall.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR interface IFn { operator fun invoke(): String } diff --git a/compiler/testData/codegen/box/objects/selfReferenceToObjectInAnonymousObjectInSuperConstructorCall.kt b/compiler/testData/codegen/box/objects/selfReferenceToObjectInAnonymousObjectInSuperConstructorCall.kt index 30572928976..2239c1b09e9 100644 --- a/compiler/testData/codegen/box/objects/selfReferenceToObjectInAnonymousObjectInSuperConstructorCall.kt +++ b/compiler/testData/codegen/box/objects/selfReferenceToObjectInAnonymousObjectInSuperConstructorCall.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR interface IFn { operator fun invoke(): String } diff --git a/compiler/testData/codegen/box/primitiveTypes/kt2251.kt b/compiler/testData/codegen/box/primitiveTypes/kt2251.kt index 68fc2494020..d75041090e5 100644 --- a/compiler/testData/codegen/box/primitiveTypes/kt2251.kt +++ b/compiler/testData/codegen/box/primitiveTypes/kt2251.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR class A(var b: Byte) { fun c(d: Short) = (b + d.toByte()).toChar() } diff --git a/compiler/testData/codegen/box/properties/kt1159.kt b/compiler/testData/codegen/box/properties/kt1159.kt index c0306657628..ff0d5301ccc 100644 --- a/compiler/testData/codegen/box/properties/kt1159.kt +++ b/compiler/testData/codegen/box/properties/kt1159.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/enclosing/anonymousObjectInInlinedLambda.kt b/compiler/testData/codegen/box/reflection/enclosing/anonymousObjectInInlinedLambda.kt index 547f018e245..3d578531deb 100644 --- a/compiler/testData/codegen/box/reflection/enclosing/anonymousObjectInInlinedLambda.kt +++ b/compiler/testData/codegen/box/reflection/enclosing/anonymousObjectInInlinedLambda.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/enclosing/kt6368.kt b/compiler/testData/codegen/box/reflection/enclosing/kt6368.kt index 7a32f51440b..bfe7a75c733 100644 --- a/compiler/testData/codegen/box/reflection/enclosing/kt6368.kt +++ b/compiler/testData/codegen/box/reflection/enclosing/kt6368.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/enclosing/lambdaInObjectExpression.kt b/compiler/testData/codegen/box/reflection/enclosing/lambdaInObjectExpression.kt index ecd7d2f9183..2a05c7f56f3 100644 --- a/compiler/testData/codegen/box/reflection/enclosing/lambdaInObjectExpression.kt +++ b/compiler/testData/codegen/box/reflection/enclosing/lambdaInObjectExpression.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/regressions/Kt1149.kt b/compiler/testData/codegen/box/regressions/Kt1149.kt index c1a82e063c0..985e1628eab 100644 --- a/compiler/testData/codegen/box/regressions/Kt1149.kt +++ b/compiler/testData/codegen/box/regressions/Kt1149.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/regressions/kt344.kt b/compiler/testData/codegen/box/regressions/kt344.kt index cafcaafd0ad..8c6d2a103bd 100644 --- a/compiler/testData/codegen/box/regressions/kt344.kt +++ b/compiler/testData/codegen/box/regressions/kt344.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/regressions/objectInsideDelegation.kt b/compiler/testData/codegen/box/regressions/objectInsideDelegation.kt index 2fa010627f3..f2f9caf960d 100644 --- a/compiler/testData/codegen/box/regressions/objectInsideDelegation.kt +++ b/compiler/testData/codegen/box/regressions/objectInsideDelegation.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME val b: First by lazy { diff --git a/compiler/testData/codegen/box/reified/anonymousObjectNoPropagate.kt b/compiler/testData/codegen/box/reified/anonymousObjectNoPropagate.kt index 57e666ffa0f..ae7d058fa46 100644 --- a/compiler/testData/codegen/box/reified/anonymousObjectNoPropagate.kt +++ b/compiler/testData/codegen/box/reified/anonymousObjectNoPropagate.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/reified/reifiedInlineFunOfObject.kt b/compiler/testData/codegen/box/reified/reifiedInlineFunOfObject.kt index e1f41121214..f25e58cadc9 100644 --- a/compiler/testData/codegen/box/reified/reifiedInlineFunOfObject.kt +++ b/compiler/testData/codegen/box/reified/reifiedInlineFunOfObject.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/reified/reifiedInlineFunOfObjectWithinReified.kt b/compiler/testData/codegen/box/reified/reifiedInlineFunOfObjectWithinReified.kt index a02d70779a6..6abdf91192c 100644 --- a/compiler/testData/codegen/box/reified/reifiedInlineFunOfObjectWithinReified.kt +++ b/compiler/testData/codegen/box/reified/reifiedInlineFunOfObjectWithinReified.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/reified/reifiedInlineIntoNonInlineableLambda.kt b/compiler/testData/codegen/box/reified/reifiedInlineIntoNonInlineableLambda.kt index e96ecc77dce..b1641f1ed42 100644 --- a/compiler/testData/codegen/box/reified/reifiedInlineIntoNonInlineableLambda.kt +++ b/compiler/testData/codegen/box/reified/reifiedInlineIntoNonInlineableLambda.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/reified/spreads.kt b/compiler/testData/codegen/box/reified/spreads.kt index ee2d7159538..3ef1765c97b 100644 --- a/compiler/testData/codegen/box/reified/spreads.kt +++ b/compiler/testData/codegen/box/reified/spreads.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/reified/varargs.kt b/compiler/testData/codegen/box/reified/varargs.kt index 0248efa908c..a3cd0cbb9d4 100644 --- a/compiler/testData/codegen/box/reified/varargs.kt +++ b/compiler/testData/codegen/box/reified/varargs.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/safeCall/kt1572.kt b/compiler/testData/codegen/box/safeCall/kt1572.kt index faf15a2e619..d3b3c52bde1 100644 --- a/compiler/testData/codegen/box/safeCall/kt1572.kt +++ b/compiler/testData/codegen/box/safeCall/kt1572.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR //KT-1572 Frontend doesn't mark all vars included in closure as refs. class A(val t : Int) {} diff --git a/compiler/testData/codegen/box/sam/constructors/syntheticVsReal.kt b/compiler/testData/codegen/box/sam/constructors/syntheticVsReal.kt index 70688092389..70ad7f5b42b 100644 --- a/compiler/testData/codegen/box/sam/constructors/syntheticVsReal.kt +++ b/compiler/testData/codegen/box/sam/constructors/syntheticVsReal.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM var global = "" diff --git a/compiler/testData/codegen/box/toArray/toArrayShouldBePublic.kt b/compiler/testData/codegen/box/toArray/toArrayShouldBePublic.kt index 5b55024d73e..78f1b92f895 100644 --- a/compiler/testData/codegen/box/toArray/toArrayShouldBePublic.kt +++ b/compiler/testData/codegen/box/toArray/toArrayShouldBePublic.kt @@ -1,5 +1,4 @@ // TARGET_BACKEND: JVM -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME // FILE: SingletonCollection.kt diff --git a/compiler/testData/codegen/box/toArray/toArrayShouldBePublicWithJava.kt b/compiler/testData/codegen/box/toArray/toArrayShouldBePublicWithJava.kt index a23b4876698..8e170ae174a 100644 --- a/compiler/testData/codegen/box/toArray/toArrayShouldBePublicWithJava.kt +++ b/compiler/testData/codegen/box/toArray/toArrayShouldBePublicWithJava.kt @@ -1,5 +1,4 @@ // TARGET_BACKEND: JVM -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME // IGNORE_LIGHT_ANALYSIS diff --git a/compiler/testData/codegen/box/traits/interfaceDefaultImpls.kt b/compiler/testData/codegen/box/traits/interfaceDefaultImpls.kt index b6ca02494dc..991f550c928 100644 --- a/compiler/testData/codegen/box/traits/interfaceDefaultImpls.kt +++ b/compiler/testData/codegen/box/traits/interfaceDefaultImpls.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // FILE: B.java diff --git a/compiler/testData/codegen/box/unsignedTypes/forEachIndexedInListOfUInts.kt b/compiler/testData/codegen/box/unsignedTypes/forEachIndexedInListOfUInts.kt index 83868bed072..c5b1fb680c4 100644 --- a/compiler/testData/codegen/box/unsignedTypes/forEachIndexedInListOfUInts.kt +++ b/compiler/testData/codegen/box/unsignedTypes/forEachIndexedInListOfUInts.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/unsignedTypes/unsignedRangeIterator.kt b/compiler/testData/codegen/box/unsignedTypes/unsignedRangeIterator.kt index 80d132691d4..a3f547cf1cb 100644 --- a/compiler/testData/codegen/box/unsignedTypes/unsignedRangeIterator.kt +++ b/compiler/testData/codegen/box/unsignedTypes/unsignedRangeIterator.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME