[IR] Reorder parameters in IrFactory#createLocalDelegatedProperty

This is to prepare for IrFactory auto-generation (KT-59308).
This commit is contained in:
Sergej Jaskiewicz
2023-06-14 12:44:28 +02:00
committed by Space Team
parent a7c1f53af8
commit 5b8b3644fc
7 changed files with 32 additions and 23 deletions
@@ -1293,13 +1293,13 @@ class Fir2IrDeclarationStorage(
val origin = IrDeclarationOrigin.DEFINED
val irProperty = property.convertWithOffsets { startOffset, endOffset ->
irFactory.createLocalDelegatedProperty(
startOffset,
endOffset,
origin,
IrLocalDelegatedPropertySymbolImpl(),
property.name,
type,
property.isVar
startOffset = startOffset,
endOffset = endOffset,
origin = origin,
name = property.name,
symbol = IrLocalDelegatedPropertySymbolImpl(),
type = type,
isVar = property.isVar
)
}.apply {
parent = irParent
@@ -129,8 +129,8 @@ interface IrFactory {
startOffset: Int,
endOffset: Int,
origin: IrDeclarationOrigin,
symbol: IrLocalDelegatedPropertySymbol,
name: Name,
symbol: IrLocalDelegatedPropertySymbol,
type: IrType,
isVar: Boolean,
): IrLocalDelegatedProperty
@@ -158,8 +158,8 @@ abstract class AbstractIrFactoryImpl : IrFactory {
startOffset: Int,
endOffset: Int,
origin: IrDeclarationOrigin,
symbol: IrLocalDelegatedPropertySymbol,
name: Name,
symbol: IrLocalDelegatedPropertySymbol,
type: IrType,
isVar: Boolean,
): IrLocalDelegatedProperty =
@@ -238,8 +238,8 @@ class IrFactoryImplForJsIC(override val stageController: StageController) : Abst
startOffset: Int,
endOffset: Int,
origin: IrDeclarationOrigin,
symbol: IrLocalDelegatedPropertySymbol,
name: Name,
symbol: IrLocalDelegatedPropertySymbol,
type: IrType,
isVar: Boolean
): IrLocalDelegatedProperty {
@@ -247,8 +247,8 @@ class IrFactoryImplForJsIC(override val stageController: StageController) : Abst
startOffset,
endOffset,
origin,
symbol,
name,
symbol,
type,
isVar,
).register()
@@ -283,12 +283,13 @@ open class DeepCopyIrTreeWithSymbols(
override fun visitLocalDelegatedProperty(declaration: IrLocalDelegatedProperty): IrLocalDelegatedProperty =
declaration.factory.createLocalDelegatedProperty(
declaration.startOffset, declaration.endOffset,
mapDeclarationOrigin(declaration.origin),
symbolRemapper.getDeclaredLocalDelegatedProperty(declaration.symbol),
declaration.name,
declaration.type.remapType(),
declaration.isVar
startOffset = declaration.startOffset,
endOffset = declaration.endOffset,
origin = mapDeclarationOrigin(declaration.origin),
name = declaration.name,
symbol = symbolRemapper.getDeclaredLocalDelegatedProperty(declaration.symbol),
type = declaration.type.remapType(),
isVar = declaration.isVar,
).apply {
transformAnnotations(declaration)
delegate = declaration.delegate.transform()
@@ -1144,7 +1144,13 @@ open class SymbolTable(
type: IrType,
factory: (IrLocalDelegatedPropertySymbol) -> IrLocalDelegatedProperty = {
irFactory.createLocalDelegatedProperty(
startOffset, endOffset, origin, it, nameProvider.nameForDeclaration(descriptor), type, descriptor.isVar
startOffset = startOffset,
endOffset = endOffset,
origin = origin,
name = nameProvider.nameForDeclaration(descriptor),
symbol = it,
type = type,
isVar = descriptor.isVar
)
}
): IrLocalDelegatedProperty =
@@ -728,11 +728,13 @@ class IrDeclarationDeserializer(
val nameAndType = BinaryNameAndType.decode(proto.nameType)
val prop = irFactory.createLocalDelegatedProperty(
startOffset, endOffset, origin,
symbol.checkSymbolType(fallbackSymbolKind = null),
deserializeName(nameAndType.nameIndex),
deserializeIrType(nameAndType.typeIndex),
flags.isVar
startOffset = startOffset,
endOffset = endOffset,
origin = origin,
name = deserializeName(nameAndType.nameIndex),
symbol = symbol.checkSymbolType(fallbackSymbolKind = null),
type = deserializeIrType(nameAndType.typeIndex),
isVar = flags.isVar,
)
prop.apply {