[IR] Add REINTERPRET_CAST operator in IrTypeOperatorCall
- fix BE - fix Serializer - implement builder - make Ir a bit more type-correct - support developer mode (lowering [dynamic]implicit cast meterialized as general cast) - fix autoboxing lowering
This commit is contained in:
@@ -314,6 +314,9 @@ fun IrBuilderWithScope.irAs(argument: IrExpression, type: IrType) =
|
||||
fun IrBuilderWithScope.irImplicitCast(argument: IrExpression, type: IrType) =
|
||||
IrTypeOperatorCallImpl(startOffset, endOffset, type, IrTypeOperator.IMPLICIT_CAST, type, argument)
|
||||
|
||||
fun IrBuilderWithScope.irReinterpretCast(argument: IrExpression, type: IrType) =
|
||||
IrTypeOperatorCallImpl(startOffset, endOffset, type, IrTypeOperator.REINTERPRET_CAST, type, argument)
|
||||
|
||||
fun IrBuilderWithScope.irInt(value: Int) =
|
||||
IrConstImpl.int(startOffset, endOffset, context.irBuiltIns.intType, value)
|
||||
|
||||
|
||||
@@ -49,7 +49,11 @@ enum class IrTypeOperator {
|
||||
* Implicit dynamic cast: implicit cast from `dynamic` to `T`.
|
||||
* This currently can happen in Kotlin/JS only.
|
||||
*/
|
||||
IMPLICIT_DYNAMIC_CAST;
|
||||
IMPLICIT_DYNAMIC_CAST,
|
||||
/**
|
||||
* C-like reinterpret_cast<T> using as primitive type operation in JS
|
||||
*/
|
||||
REINTERPRET_CAST;
|
||||
}
|
||||
|
||||
interface IrTypeOperatorCall : IrExpression {
|
||||
|
||||
Reference in New Issue
Block a user