diff --git a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/DeepCopyIrTreeWithDescriptoros.kt b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/DeepCopyIrTreeWithDescriptoros.kt index 2946a4f5a4c..bd4f8c8064a 100644 --- a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/DeepCopyIrTreeWithDescriptoros.kt +++ b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/DeepCopyIrTreeWithDescriptoros.kt @@ -36,7 +36,7 @@ import org.jetbrains.kotlin.types.TypeSubstitutor import org.jetbrains.kotlin.types.Variance import org.jetbrains.kotlin.types.typeUtil.makeNullable -internal class DeepCopyIrTreeWithDescriptors(val targetDescriptor: FunctionDescriptor, +class DeepCopyIrTreeWithDescriptors(val targetDescriptor: FunctionDescriptor, val context: CommonBackendContext) { private val descriptorSubstituteMap: MutableMap = mutableMapOf() @@ -553,9 +553,9 @@ internal class DeepCopyIrTreeWithDescriptors(val targetDescriptor: FunctionDescr } -internal class SubstitutedDescriptor(val inlinedFunction: FunctionDescriptor, val descriptor: DeclarationDescriptor) +class SubstitutedDescriptor(val inlinedFunction: FunctionDescriptor, val descriptor: DeclarationDescriptor) -internal class DescriptorSubstitutorForExternalScope(val globalSubstituteMap: MutableMap) +class DescriptorSubstitutorForExternalScope(val globalSubstituteMap: MutableMap) : IrElementTransformerVoidWithContext() { override fun visitCall(expression: IrCall): IrExpression { diff --git a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/ir/Ir.kt b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/ir/Ir.kt index 747e83ceab5..48ad3d2e967 100644 --- a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/ir/Ir.kt +++ b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/ir/Ir.kt @@ -28,10 +28,10 @@ abstract class Ir(val context: T, val irModule: IrM abstract class Symbols(val context: T, private val symbolTable: SymbolTable) { - private val builtIns + protected val builtIns get() = context.builtIns - private fun builtInsPackage(vararg packageNameSegments: String) = + protected fun builtInsPackage(vararg packageNameSegments: String) = context.builtIns.builtInsModule.getPackage(FqName.fromSegments(listOf(*packageNameSegments))).memberScope val refClass = symbolTable.referenceClass(context.getInternalClass("Ref")) @@ -121,7 +121,7 @@ abstract class Symbols(val context: T, private val } - private val arrayTypes = arrayOf( + protected val arrayTypes = arrayOf( builtIns.getPrimitiveArrayKotlinType(PrimitiveType.BYTE), builtIns.getPrimitiveArrayKotlinType(PrimitiveType.CHAR), builtIns.getPrimitiveArrayKotlinType(PrimitiveType.SHORT), diff --git a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/ir/IrUtils.kt b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/ir/IrUtils.kt index 0b71d4ca629..d00f69f7571 100644 --- a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/ir/IrUtils.kt +++ b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/ir/IrUtils.kt @@ -65,7 +65,7 @@ fun DeclarationDescriptor.createFakeOverrideDescriptor(owner: ClassDescriptor): } } -internal fun FunctionDescriptor.createOverriddenDescriptor(owner: ClassDescriptor, final: Boolean = true): FunctionDescriptor { +fun FunctionDescriptor.createOverriddenDescriptor(owner: ClassDescriptor, final: Boolean = true): FunctionDescriptor { return this.newCopyBuilder() .setOwner(owner) .setCopyOverrides(true) @@ -76,7 +76,7 @@ internal fun FunctionDescriptor.createOverriddenDescriptor(owner: ClassDescripto } } -internal fun ClassDescriptor.createSimpleDelegatingConstructorDescriptor(superConstructorDescriptor: ClassConstructorDescriptor, isPrimary: Boolean = false) +fun ClassDescriptor.createSimpleDelegatingConstructorDescriptor(superConstructorDescriptor: ClassConstructorDescriptor, isPrimary: Boolean = false) : ClassConstructorDescriptor { val constructorDescriptor = ClassConstructorDescriptorImpl.createSynthesized( /* containingDeclaration = */ this, @@ -91,7 +91,7 @@ internal fun ClassDescriptor.createSimpleDelegatingConstructorDescriptor(superCo return constructorDescriptor } -internal fun IrClass.addSimpleDelegatingConstructor(superConstructorSymbol: IrConstructorSymbol, +fun IrClass.addSimpleDelegatingConstructor(superConstructorSymbol: IrConstructorSymbol, constructorDescriptor: ClassConstructorDescriptor, origin: IrDeclarationOrigin) : IrConstructor { @@ -117,7 +117,7 @@ internal fun IrClass.addSimpleDelegatingConstructor(superConstructorSymbol: IrCo } } -internal fun CommonBackendContext.createArrayOfExpression(arrayElementType: KotlinType, +fun CommonBackendContext.createArrayOfExpression(arrayElementType: KotlinType, arrayElements: List, startOffset: Int, endOffset: Int): IrExpression { diff --git a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/StringConcatenationLowering.kt b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/StringConcatenationLowering.kt index 5ce34fbc91d..834ec2e2c2f 100644 --- a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/StringConcatenationLowering.kt +++ b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/StringConcatenationLowering.kt @@ -41,7 +41,7 @@ import org.jetbrains.kotlin.types.KotlinType /** * This lowering pass replaces [IrStringConcatenation]s with StringBuilder appends. */ -internal class StringConcatenationLowering(val context: CommonBackendContext) : FileLoweringPass { +class StringConcatenationLowering(val context: CommonBackendContext) : FileLoweringPass { override fun lower(irFile: IrFile) { irFile.transformChildrenVoid(StringConcatenationTransformer(this)) }