diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/builders/ExpressionHelpers.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/builders/ExpressionHelpers.kt index 023f69b6fd7..b11a7bdc99a 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/builders/ExpressionHelpers.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/builders/ExpressionHelpers.kt @@ -116,12 +116,18 @@ fun IrBuilderWithScope.irCallOp(callee: CallableDescriptor, dispatchReceiver: Ir putValueArgument(0, argument) } +fun IrBuilderWithScope.irIs(argument: IrExpression, type: KotlinType) = + IrTypeOperatorCallImpl(startOffset, endOffset, context.builtIns.booleanType, IrTypeOperator.INSTANCEOF, type, argument) + fun IrBuilderWithScope.irNotIs(argument: IrExpression, type: KotlinType) = IrTypeOperatorCallImpl(startOffset, endOffset, context.builtIns.booleanType, IrTypeOperator.NOT_INSTANCEOF, type, argument) fun IrBuilderWithScope.irAs(argument: IrExpression, type: KotlinType) = IrTypeOperatorCallImpl(startOffset, endOffset, type, IrTypeOperator.CAST, type, argument) +fun IrBuilderWithScope.irImplicitCast(argument: IrExpression, type: KotlinType) = + IrTypeOperatorCallImpl(startOffset, endOffset, type, IrTypeOperator.IMPLICIT_CAST, type, argument) + fun IrBuilderWithScope.irInt(value: Int) = IrConstImpl.int(startOffset, endOffset, context.builtIns.intType, value)