IR: cleanup expression implementations
Remove unused constructors with descriptors, minimize usages of secondary constructors and make some properties non-lateinit, fix some inspections.
This commit is contained in:
+4
-3
@@ -220,12 +220,13 @@ class FinallyBlocksLowering(val context: CommonBackendContext, private val throw
|
||||
endOffset = endOffset,
|
||||
type = context.irBuiltIns.unitType
|
||||
).apply {
|
||||
this.catches += irCatch(catchParameter).apply {
|
||||
result = irComposite {
|
||||
this.catches += irCatch(
|
||||
catchParameter,
|
||||
irComposite {
|
||||
+finallyExpression.copy()
|
||||
+irThrow(irGet(catchParameter))
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
this.finallyExpression = null
|
||||
}
|
||||
|
||||
+2
-5
@@ -111,11 +111,8 @@ fun IrBuilderWithScope.irNot(arg: IrExpression) =
|
||||
fun IrBuilderWithScope.irThrow(arg: IrExpression) =
|
||||
IrThrowImpl(startOffset, endOffset, context.irBuiltIns.nothingType, arg)
|
||||
|
||||
fun IrBuilderWithScope.irCatch(catchParameter: IrVariable) =
|
||||
IrCatchImpl(
|
||||
startOffset, endOffset,
|
||||
catchParameter
|
||||
)
|
||||
fun IrBuilderWithScope.irCatch(catchParameter: IrVariable, result: IrExpression): IrCatch =
|
||||
IrCatchImpl(startOffset, endOffset, catchParameter, result)
|
||||
|
||||
fun IrBuilderWithScope.irImplicitCoercionToUnit(arg: IrExpression) =
|
||||
IrTypeOperatorCallImpl(
|
||||
|
||||
Reference in New Issue
Block a user