[Commonizer] Drop CirPackageFactory
This commit is contained in:
@@ -7,4 +7,13 @@ package org.jetbrains.kotlin.descriptors.commonizer.cir
|
||||
|
||||
interface CirPackage : CirDeclaration {
|
||||
val packageName: CirPackageName
|
||||
|
||||
companion object {
|
||||
@Suppress("NOTHING_TO_INLINE")
|
||||
inline fun create(packageName: CirPackageName): CirPackage = CirPackageImpl(packageName)
|
||||
}
|
||||
}
|
||||
|
||||
data class CirPackageImpl(
|
||||
override val packageName: CirPackageName
|
||||
) : CirPackage
|
||||
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.descriptors.commonizer.cir.factory
|
||||
|
||||
import org.jetbrains.kotlin.descriptors.commonizer.cir.CirPackage
|
||||
import org.jetbrains.kotlin.descriptors.commonizer.cir.CirPackageName
|
||||
import org.jetbrains.kotlin.descriptors.commonizer.cir.impl.CirPackageImpl
|
||||
|
||||
object CirPackageFactory {
|
||||
fun create(packageName: CirPackageName): CirPackage = CirPackageImpl(packageName)
|
||||
}
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.descriptors.commonizer.cir.impl
|
||||
|
||||
import org.jetbrains.kotlin.descriptors.commonizer.cir.CirPackage
|
||||
import org.jetbrains.kotlin.descriptors.commonizer.cir.CirPackageName
|
||||
|
||||
data class CirPackageImpl(
|
||||
override val packageName: CirPackageName
|
||||
) : CirPackage
|
||||
+1
-2
@@ -7,12 +7,11 @@ package org.jetbrains.kotlin.descriptors.commonizer.core
|
||||
|
||||
import org.jetbrains.kotlin.descriptors.commonizer.cir.CirPackage
|
||||
import org.jetbrains.kotlin.descriptors.commonizer.cir.CirPackageName
|
||||
import org.jetbrains.kotlin.descriptors.commonizer.cir.factory.CirPackageFactory
|
||||
|
||||
class PackageCommonizer : AbstractStandardCommonizer<CirPackage, CirPackage>() {
|
||||
private lateinit var packageName: CirPackageName
|
||||
|
||||
override fun commonizationResult() = CirPackageFactory.create(packageName = packageName)
|
||||
override fun commonizationResult() = CirPackage.create(packageName = packageName)
|
||||
|
||||
override fun initialize(first: CirPackage) {
|
||||
packageName = first.packageName
|
||||
|
||||
+1
-1
@@ -166,7 +166,7 @@ class CirTreeMerger(
|
||||
val packageNode: CirPackageNode = moduleNode.packages.getOrPut(packageName) {
|
||||
buildPackageNode(storageManager, leafTargetsSize)
|
||||
}
|
||||
packageNode.targetDeclarations[context.targetIndex] = CirPackageFactory.create(packageName)
|
||||
packageNode.targetDeclarations[context.targetIndex] = CirPackage.create(packageName)
|
||||
|
||||
val classesToProcess = ClassesToProcess()
|
||||
fragments.forEach { fragment ->
|
||||
|
||||
Reference in New Issue
Block a user