[Native] Move irByte from IrUtils2

We already have similar functions in `ExpressionHelpers`. Makes
sense to keep them together.
This commit is contained in:
Ivan Kylchik
2023-08-16 11:45:47 +02:00
committed by Space Team
parent d62323cdf1
commit ddde95bd78
2 changed files with 6 additions and 3 deletions
@@ -345,6 +345,12 @@ fun IrBuilderWithScope.irReinterpretCast(argument: IrExpression, type: IrType) =
fun IrBuilderWithScope.irSamConversion(argument: IrExpression, type: IrType) =
typeOperator(type, argument, IrTypeOperator.SAM_CONVERSION, type)
fun IrBuilderWithScope.irByte(value: Byte) =
IrConstImpl.byte(startOffset, endOffset, context.irBuiltIns.byteType, value)
fun IrBuilderWithScope.irShort(value: Short) =
IrConstImpl.short(startOffset, endOffset, context.irBuiltIns.shortType, value)
fun IrBuilderWithScope.irInt(value: Int, type: IrType = context.irBuiltIns.intType) =
IrConstImpl.int(startOffset, endOffset, type, value)
@@ -32,8 +32,5 @@ fun IrBuilderWithScope.irCatch() =
)
)
fun IrBuilderWithScope.irByte(value: Byte) =
IrConstImpl.byte(startOffset, endOffset, context.irBuiltIns.byteType, value)
val IrField.hasNonConstInitializer: Boolean
get() = initializer?.expression.let { it != null && it !is IrConst<*> && it !is IrConstantValue }