[JS IR BE] Remove unused classifier symbol from IrTypeOperatorCall builder

This commit is contained in:
Roman Artemev
2019-07-09 11:24:40 +03:00
committed by romanart
parent 69c4db82d4
commit 1605dc3251
2 changed files with 4 additions and 7 deletions
@@ -18,7 +18,6 @@ import org.jetbrains.kotlin.ir.expressions.impl.*
import org.jetbrains.kotlin.ir.symbols.*
import org.jetbrains.kotlin.ir.symbols.impl.*
import org.jetbrains.kotlin.ir.types.IrType
import org.jetbrains.kotlin.ir.types.classifierOrFail
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.types.Variance
@@ -240,12 +239,11 @@ object JsIrBuilder {
fun buildWhen(type: IrType, branches: List<IrBranch>, origin: IrStatementOrigin = SYNTHESIZED_STATEMENT) =
IrWhenImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, type, origin, branches)
// TODO drop type symbol here, it's really not needed
fun buildTypeOperator(type: IrType, operator: IrTypeOperator, argument: IrExpression, toType: IrType, symbol: IrClassifierSymbol) =
IrTypeOperatorCallImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, type, operator, toType, symbol, argument)
fun buildTypeOperator(type: IrType, operator: IrTypeOperator, argument: IrExpression, toType: IrType) =
IrTypeOperatorCallImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, type, operator, toType, argument)
fun buildImplicitCast(value: IrExpression, toType: IrType) =
buildTypeOperator(toType, IrTypeOperator.IMPLICIT_CAST, value, toType, toType.classifierOrFail)
buildTypeOperator(toType, IrTypeOperator.IMPLICIT_CAST, value, toType)
fun buildNull(type: IrType) = IrConstImpl.constNull(UNDEFINED_OFFSET, UNDEFINED_OFFSET, type)
@@ -657,8 +657,7 @@ class StateMachineBuilder(
context.irBuiltIns.booleanType,
IrTypeOperator.INSTANCEOF,
value,
toType,
toType.classifierOrNull!!
toType
)
private fun tempVar(type: IrType, name: String = "tmp") =