Implement special desugaring for numeric comparisons in PSI2IR

This introduces the following IR built-in functions required for proper
implementation of the number comparisons:

- ieee754Equals(T, T): Boolean,
    for each T in {Float?, Double?}

- less(T, T): Boolean
  lessOrEqual(T, T): Boolean
  greater(T, T): Boolean
  greaterOrEqual(T, T): Boolean
    for each T in {Int, Long, Float, Double}
This commit is contained in:
Dmitry Petrov
2018-02-01 16:18:01 +03:00
parent f4ed4ec9d9
commit 9137e68d4e
33 changed files with 1566 additions and 233 deletions
+1 -2
View File
@@ -16,7 +16,7 @@ FILE fqName:<root> fileName:/coercionInLoop.kt
WHEN type=kotlin.Unit origin=null
BRANCH
if: CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: CALL 'ieee754equals(Double?, Double?): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: CALL 'get(Int): Double' type=kotlin.Double origin=GET_ARRAY_ELEMENT
$this: GET_VAR 'a: DoubleArray' type=kotlin.DoubleArray origin=null
index: GET_VAR 'i: Int' type=kotlin.Int origin=null
@@ -36,4 +36,3 @@ FILE fqName:<root> fileName:/coercionInLoop.kt
GET_VAR 'tmp0: Int' type=kotlin.Int origin=null
RETURN type=kotlin.Nothing from='box(): String'
CONST String type=kotlin.String value=OK