[IR] Move IrFactory#createExpressionBody overloads to extension methods
This is to prepare for IrFactory auto-generation (KT-59308).
This commit is contained in:
committed by
Space Team
parent
ea8b482f4f
commit
3f6420c5b9
+5
-3
@@ -106,9 +106,11 @@ class InitializersCleanupLowering(
|
||||
} else {
|
||||
declaration.initializer?.let {
|
||||
declaration.initializer =
|
||||
context.irFactory.createExpressionBody(it.startOffset, it.endOffset) {
|
||||
expression = it.expression.deepCopyWithSymbols()
|
||||
}
|
||||
context.irFactory.createExpressionBody(
|
||||
startOffset = it.startOffset,
|
||||
endOffset = it.endOffset,
|
||||
expression = it.expression.deepCopyWithSymbols(),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+5
-3
@@ -44,9 +44,11 @@ class InnerClassesLowering(val context: BackendContext, private val innerClasses
|
||||
val variableRemapper = VariableRemapper(oldConstructorParameterToNew)
|
||||
for ((oldParam, newParam) in oldConstructorParameterToNew.entries) {
|
||||
newParam.defaultValue = oldParam.defaultValue?.let { oldDefault ->
|
||||
context.irFactory.createExpressionBody(oldDefault.startOffset, oldDefault.endOffset) {
|
||||
expression = oldDefault.expression.transform(variableRemapper, null).patchDeclarationParents(newConstructor)
|
||||
}
|
||||
context.irFactory.createExpressionBody(
|
||||
startOffset = oldDefault.startOffset,
|
||||
endOffset = oldDefault.endOffset,
|
||||
expression = oldDefault.expression.transform(variableRemapper, null).patchDeclarationParents(newConstructor),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user