[IR] Remove IrExpressionWithCopy and replace with shallowCopy method
This commit is contained in:
committed by
TeamCityServer
parent
084d824984
commit
368ac36204
+6
-8
@@ -6,15 +6,15 @@
|
||||
package org.jetbrains.kotlin.ir.backend.js.lower
|
||||
|
||||
import org.jetbrains.kotlin.backend.common.BodyLoweringPass
|
||||
import org.jetbrains.kotlin.backend.common.ir.isPure
|
||||
import org.jetbrains.kotlin.ir.IrStatement
|
||||
import org.jetbrains.kotlin.ir.backend.js.JsIrBackendContext
|
||||
import org.jetbrains.kotlin.ir.backend.js.ir.JsIrArithBuilder
|
||||
import org.jetbrains.kotlin.ir.backend.js.ir.JsIrBuilder
|
||||
import org.jetbrains.kotlin.backend.common.ir.isPure
|
||||
import org.jetbrains.kotlin.ir.declarations.IrClass
|
||||
import org.jetbrains.kotlin.ir.declarations.IrDeclaration
|
||||
import org.jetbrains.kotlin.ir.declarations.IrDeclarationParent
|
||||
import org.jetbrains.kotlin.ir.declarations.IrDeclarationBase
|
||||
import org.jetbrains.kotlin.ir.declarations.IrDeclarationParent
|
||||
import org.jetbrains.kotlin.ir.expressions.*
|
||||
import org.jetbrains.kotlin.ir.expressions.impl.IrCompositeImpl
|
||||
import org.jetbrains.kotlin.ir.expressions.impl.IrTypeOperatorCallImpl
|
||||
@@ -47,6 +47,7 @@ class TypeOperatorLowering(val context: JsIrBackendContext) : BodyLoweringPass {
|
||||
private val isInterfaceSymbol get() = context.intrinsics.isInterfaceSymbol
|
||||
private val isArraySymbol get() = context.intrinsics.isArraySymbol
|
||||
private val isSuspendFunctionSymbol = context.intrinsics.isSuspendFunctionSymbol
|
||||
|
||||
// private val isCharSymbol get() = context.intrinsics.isCharSymbol
|
||||
private val isObjectSymbol get() = context.intrinsics.isObjectSymbol
|
||||
|
||||
@@ -269,11 +270,8 @@ class TypeOperatorLowering(val context: JsIrBackendContext) : BodyLoweringPass {
|
||||
// assert(!typeParameter.isReified) { "reified parameters have to be lowered before" }
|
||||
|
||||
return typeParameter.superTypes.fold<IrType, IrExpression?>(null) { r, t ->
|
||||
val copy = if (argument is IrExpressionWithCopy) {
|
||||
argument.copy()
|
||||
} else {
|
||||
argument.deepCopyWithSymbols()
|
||||
}
|
||||
val copy = argument.shallowCopyOrNull()
|
||||
?: argument.deepCopyWithSymbols()
|
||||
val check = generateTypeCheckNonNull(copy, t.makeNotNull())
|
||||
|
||||
if (r == null) {
|
||||
@@ -361,7 +359,7 @@ class TypeOperatorLowering(val context: JsIrBackendContext) : BodyLoweringPass {
|
||||
val toType = expression.typeOperand
|
||||
|
||||
fun maskOp(arg: IrExpression, mask: IrExpression, shift: IrConst<*>) = calculator.run {
|
||||
shr(shl(and(arg, mask), shift), shift.copy())
|
||||
shr(shl(and(arg, mask), shift), shift.shallowCopy())
|
||||
}
|
||||
|
||||
val newStatements = mutableListOf<IrStatement>()
|
||||
|
||||
Reference in New Issue
Block a user