IR: Remove unused argument from DeclarationFactor.getFieldForEnumEntry
This commit is contained in:
committed by
max-kammerer
parent
ed57a53ad6
commit
83edc7fa73
+1
-1
@@ -11,7 +11,7 @@ import org.jetbrains.kotlin.ir.types.IrType
|
||||
interface DeclarationFactory {
|
||||
object FIELD_FOR_OUTER_THIS : IrDeclarationOriginImpl("FIELD_FOR_OUTER_THIS", isSynthetic = true)
|
||||
|
||||
fun getFieldForEnumEntry(enumEntry: IrEnumEntry, entryType: IrType): IrField
|
||||
fun getFieldForEnumEntry(enumEntry: IrEnumEntry): IrField
|
||||
fun getOuterThisField(innerClass: IrClass): IrField
|
||||
fun getInnerClassConstructorWithOuterThisParameter(innerClassConstructor: IrConstructor): IrConstructor
|
||||
fun getFieldForObjectInstance(singleton: IrClass): IrField
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ class JsDeclarationFactory : DeclarationFactory {
|
||||
private val outerThisFieldSymbols = HashMap<IrClass, IrField>()
|
||||
private val innerClassConstructors = HashMap<IrConstructor, IrConstructor>()
|
||||
|
||||
override fun getFieldForEnumEntry(enumEntry: IrEnumEntry, entryType: IrType): IrField = TODO()
|
||||
override fun getFieldForEnumEntry(enumEntry: IrEnumEntry): IrField = TODO()
|
||||
|
||||
override fun getOuterThisField(innerClass: IrClass): IrField =
|
||||
if (!innerClass.isInner) throw AssertionError("Class is not inner: ${innerClass.dump()}")
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ class JvmDeclarationFactory(
|
||||
private val defaultImplsClasses = HashMap<IrClass, IrClass>()
|
||||
private val defaultImplsRedirections = HashMap<IrSimpleFunction, IrSimpleFunction>()
|
||||
|
||||
override fun getFieldForEnumEntry(enumEntry: IrEnumEntry, entryType: IrType): IrField =
|
||||
override fun getFieldForEnumEntry(enumEntry: IrEnumEntry): IrField =
|
||||
singletonFieldDeclarations.getOrPut(enumEntry) {
|
||||
buildField {
|
||||
setSourceRange(enumEntry)
|
||||
|
||||
+1
-3
@@ -222,9 +222,7 @@ private class EnumClassLowering(val context: JvmBackendContext) : ClassLoweringP
|
||||
}
|
||||
|
||||
private fun createFieldForEnumEntry(enumEntry: IrEnumEntry): IrField =
|
||||
context.declarationFactory.getFieldForEnumEntry(
|
||||
enumEntry, (enumEntry.correspondingClass ?: enumEntry.parentAsClass).defaultType
|
||||
).also {
|
||||
context.declarationFactory.getFieldForEnumEntry(enumEntry).also {
|
||||
it.initializer = IrExpressionBodyImpl(
|
||||
enumEntry.initializerExpression!!.patchDeclarationParents(it)
|
||||
)
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ private class SingletonReferencesLowering(val context: JvmBackendContext) : File
|
||||
// must be replaced with `SomeEnumEntry.this`.
|
||||
IrGetValueImpl(expression.startOffset, expression.endOffset, expression.type, appropriateThis.symbol)
|
||||
} else {
|
||||
val entrySymbol = context.declarationFactory.getFieldForEnumEntry(expression.symbol.owner, expression.type)
|
||||
val entrySymbol = context.declarationFactory.getFieldForEnumEntry(expression.symbol.owner)
|
||||
IrGetFieldImpl(expression.startOffset, expression.endOffset, entrySymbol.symbol, expression.type)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user