IR: create IrBlockBody via IrFactory
This commit is contained in:
@@ -582,7 +582,7 @@ class Fir2IrVisitor(
|
||||
internal fun convertToIrBlockBody(block: FirBlock): IrBlockBody {
|
||||
return block.convertWithOffsets { startOffset, endOffset ->
|
||||
val irStatements = block.mapToIrStatements()
|
||||
IrBlockBodyImpl(
|
||||
irFactory.createBlockBody(
|
||||
startOffset, endOffset,
|
||||
if (irStatements.isNotEmpty()) {
|
||||
irStatements.filterNotNull().takeIf { it.isNotEmpty() }
|
||||
|
||||
+2
-2
@@ -127,7 +127,7 @@ internal class ClassMemberGenerator(
|
||||
annotationGenerator.generate(irFunction, firFunction)
|
||||
}
|
||||
if (firFunction is FirConstructor && irFunction is IrConstructor && !parentAsClass.isAnnotationClass && !firFunction.isExpect) {
|
||||
val body = IrBlockBodyImpl(startOffset, endOffset)
|
||||
val body = factory.createBlockBody(startOffset, endOffset)
|
||||
val delegatedConstructor = firFunction.delegatedConstructor
|
||||
if (delegatedConstructor != null) {
|
||||
val irDelegatingConstructorCall = delegatedConstructor.toIrDelegatingConstructorCall()
|
||||
@@ -250,7 +250,7 @@ internal class ClassMemberGenerator(
|
||||
val fieldSymbol = backingField?.symbol
|
||||
val declaration = this
|
||||
if (fieldSymbol != null) {
|
||||
body = IrBlockBodyImpl(
|
||||
body = factory.createBlockBody(
|
||||
startOffset, endOffset,
|
||||
listOf(
|
||||
if (isSetter) {
|
||||
|
||||
+5
-2
@@ -27,7 +27,10 @@ import org.jetbrains.kotlin.ir.descriptors.WrappedPropertyDescriptor
|
||||
import org.jetbrains.kotlin.ir.descriptors.WrappedSimpleFunctionDescriptor
|
||||
import org.jetbrains.kotlin.ir.descriptors.WrappedTypeParameterDescriptor
|
||||
import org.jetbrains.kotlin.ir.descriptors.WrappedValueParameterDescriptor
|
||||
import org.jetbrains.kotlin.ir.expressions.impl.*
|
||||
import org.jetbrains.kotlin.ir.expressions.impl.IrCallImpl
|
||||
import org.jetbrains.kotlin.ir.expressions.impl.IrGetFieldImpl
|
||||
import org.jetbrains.kotlin.ir.expressions.impl.IrGetValueImpl
|
||||
import org.jetbrains.kotlin.ir.expressions.impl.IrReturnImpl
|
||||
import org.jetbrains.kotlin.ir.symbols.IrTypeParameterSymbol
|
||||
import org.jetbrains.kotlin.ir.types.*
|
||||
import org.jetbrains.kotlin.ir.types.impl.IrSimpleTypeImpl
|
||||
@@ -212,7 +215,7 @@ internal class DelegatedMemberGenerator(
|
||||
}
|
||||
}
|
||||
|
||||
val body = IrBlockBodyImpl(startOffset, endOffset)
|
||||
val body = irFactory.createBlockBody(startOffset, endOffset)
|
||||
val irCall = IrCallImpl(
|
||||
startOffset,
|
||||
endOffset,
|
||||
|
||||
Reference in New Issue
Block a user