Refactor IrWhen.

This commit is contained in:
Dmitry Petrov
2016-09-21 15:32:36 +03:00
parent aca71dea22
commit 8551bcf103
37 changed files with 700 additions and 554 deletions
@@ -30,8 +30,6 @@ import org.jetbrains.kotlin.ir.declarations.IrVariable
import org.jetbrains.kotlin.ir.expressions.* import org.jetbrains.kotlin.ir.expressions.*
import org.jetbrains.kotlin.ir.expressions.impl.IrIfThenElseImpl import org.jetbrains.kotlin.ir.expressions.impl.IrIfThenElseImpl
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
import org.jetbrains.kotlin.psi.KtCallExpression
import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall
import org.jetbrains.kotlin.resolve.jvm.AsmTypes import org.jetbrains.kotlin.resolve.jvm.AsmTypes
import org.jetbrains.kotlin.resolve.jvm.AsmTypes.OBJECT_TYPE import org.jetbrains.kotlin.resolve.jvm.AsmTypes.OBJECT_TYPE
import org.jetbrains.kotlin.types.KotlinType import org.jetbrains.kotlin.types.KotlinType
@@ -303,13 +301,13 @@ class ExpressionCodegen(
/*TODO */ /*TODO */
if (expression is IrIfThenElseImpl) { if (expression is IrIfThenElseImpl) {
val elseLabel = Label() val elseLabel = Label()
val condition = expression.getNthCondition(0)!! val condition = expression.branches[0].condition
gen(condition, data) gen(condition, data)
BranchedValue.condJump(StackValue.onStack(condition.asmType), elseLabel, true, mv) BranchedValue.condJump(StackValue.onStack(condition.asmType), elseLabel, true, mv)
val end = Label() val end = Label()
expression.getNthResult(0)!!.apply { expression.branches[0].result.apply {
gen(this, data) gen(this, data)
coerceNotToUnit(this.asmType, expression.asmType) coerceNotToUnit(this.asmType, expression.asmType)
} }
@@ -317,7 +315,7 @@ class ExpressionCodegen(
mv.goTo(end) mv.goTo(end)
mv.mark(elseLabel) mv.mark(elseLabel)
expression.getNthResult(1)?.apply { expression.branches.getOrNull(1)?.result?.apply {
gen(this, data) gen(this, data)
coerceNotToUnit(this.asmType, expression.asmType) coerceNotToUnit(this.asmType, expression.asmType)
} }
@@ -25,6 +25,7 @@ import org.jetbrains.kotlin.psi.psiUtil.startOffset
import org.jetbrains.kotlin.psi2ir.defaultLoad import org.jetbrains.kotlin.psi2ir.defaultLoad
import org.jetbrains.kotlin.psi2ir.deparenthesize import org.jetbrains.kotlin.psi2ir.deparenthesize
import org.jetbrains.kotlin.resolve.BindingContext import org.jetbrains.kotlin.resolve.BindingContext
import org.jetbrains.kotlin.types.KotlinType
import org.jetbrains.kotlin.utils.SmartList import org.jetbrains.kotlin.utils.SmartList
class BranchingExpressionGenerator(statementGenerator: StatementGenerator) : StatementGeneratorExtension(statementGenerator) { class BranchingExpressionGenerator(statementGenerator: StatementGenerator) : StatementGeneratorExtension(statementGenerator) {
@@ -32,13 +33,13 @@ class BranchingExpressionGenerator(statementGenerator: StatementGenerator) : Sta
val resultType = getInferredTypeWithImplicitCastsOrFail(expression) val resultType = getInferredTypeWithImplicitCastsOrFail(expression)
var ktLastIf: KtIfExpression = expression var ktLastIf: KtIfExpression = expression
val irBranches = SmartList<Pair<IrExpression, IrExpression>>() val irBranches = SmartList<IrBranch>()
var irElseBranch: IrExpression? = null var irElseBranch: IrExpression? = null
whenBranches@while (true) { whenBranches@while (true) {
val irCondition = statementGenerator.generateExpression(ktLastIf.condition!!) val irCondition = statementGenerator.generateExpression(ktLastIf.condition!!)
val irThenBranch = statementGenerator.generateExpression(ktLastIf.then!!) val irThenBranch = statementGenerator.generateExpression(ktLastIf.then!!)
irBranches.add(Pair(irCondition, irThenBranch)) irBranches.add(IrBranchImpl(irCondition, irThenBranch))
val ktElse = ktLastIf.`else`?.deparenthesize() val ktElse = ktLastIf.`else`?.deparenthesize()
when (ktElse) { when (ktElse) {
@@ -52,19 +53,29 @@ class BranchingExpressionGenerator(statementGenerator: StatementGenerator) : Sta
} }
} }
return if (irBranches.size == 1) { return createIrWhen(expression, irBranches, irElseBranch, resultType)
val (irCondition, irThenBranch) = irBranches[0]
IrIfThenElseImpl(expression.startOffset, expression.endOffset, resultType,
irCondition, irThenBranch, irElseBranch, IrStatementOrigin.IF)
} }
else {
val irWhen = IrWhenImpl(expression.startOffset, expression.endOffset, resultType, IrStatementOrigin.WHEN) private fun createIrWhen(
for ((irCondition, irThenBranch) in irBranches) { ktIf: KtIfExpression,
irWhen.addBranch(irCondition, irThenBranch) irBranches: List<IrBranch>,
irElseResult: IrExpression?,
resultType: KotlinType
): IrWhen {
if (irBranches.size == 1) {
return IrIfThenElseImpl(ktIf.startOffset, ktIf.endOffset, resultType,
irBranches[0].condition, irBranches[0].result, irElseResult)
} }
irWhen.elseBranch = irElseBranch
irWhen val irWhen = IrWhenImpl(ktIf.startOffset, ktIf.endOffset, resultType, IrStatementOrigin.WHEN)
irWhen.branches.addAll(irBranches)
irElseResult?.let {
irWhen.branches.add(IrBranchImpl.elseBranch(it))
} }
return irWhen
} }
fun generateWhenExpression(expression: KtWhenExpression): IrExpression { fun generateWhenExpression(expression: KtWhenExpression): IrExpression {
@@ -78,7 +89,8 @@ class BranchingExpressionGenerator(statementGenerator: StatementGenerator) : Sta
for (ktEntry in expression.entries) { for (ktEntry in expression.entries) {
if (ktEntry.isElse) { if (ktEntry.isElse) {
irWhen.elseBranch = statementGenerator.generateExpression(ktEntry.expression!!) val irElseResult = statementGenerator.generateExpression(ktEntry.expression!!)
irWhen.branches.add(IrBranchImpl.elseBranch(irElseResult))
break break
} }
@@ -94,7 +106,7 @@ class BranchingExpressionGenerator(statementGenerator: StatementGenerator) : Sta
} }
val irBranchResult = statementGenerator.generateExpression(ktEntry.expression!!) val irBranchResult = statementGenerator.generateExpression(ktEntry.expression!!)
irWhen.addBranch(irBranchCondition!!, irBranchResult) irWhen.branches.add(IrBranchImpl(irBranchCondition!!, irBranchResult))
} }
return generateWhenBody(expression, irSubject, irWhen) return generateWhenBody(expression, irSubject, irWhen)
@@ -102,13 +114,13 @@ class BranchingExpressionGenerator(statementGenerator: StatementGenerator) : Sta
private fun generateWhenBody(expression: KtWhenExpression, irSubject: IrVariable?, irWhen: IrWhen): IrExpression { private fun generateWhenBody(expression: KtWhenExpression, irSubject: IrVariable?, irWhen: IrWhen): IrExpression {
if (irSubject == null) { if (irSubject == null) {
if (irWhen.branchesCount == 0 && irWhen.elseBranch == null) if (irWhen.branches.isEmpty())
return IrBlockImpl(expression.startOffset, expression.endOffset, context.builtIns.unitType, IrStatementOrigin.WHEN) return IrBlockImpl(expression.startOffset, expression.endOffset, context.builtIns.unitType, IrStatementOrigin.WHEN)
else else
return irWhen return irWhen
} }
else { else {
if (irWhen.branchesCount == 0) { if (irWhen.branches.isEmpty()) {
val irBlock = IrBlockImpl(expression.startOffset, expression.endOffset, context.builtIns.unitType, IrStatementOrigin.WHEN) val irBlock = IrBlockImpl(expression.startOffset, expression.endOffset, context.builtIns.unitType, IrStatementOrigin.WHEN)
irBlock.statements.add(irSubject) irBlock.statements.add(irSubject)
return irBlock return irBlock
@@ -127,16 +127,11 @@ class InsertImplicitCasts(val builtIns: KotlinBuiltIns): IrElementTransformerVoi
val resultType = expression.type val resultType = expression.type
for (i in expression.branchIndices) { for (irBranch in expression.branches) {
val nthCondition = expression.getNthCondition(i)!! irBranch.condition = irBranch.condition.cast(builtIns.booleanType)
val nthResult = expression.getNthResult(i)!! irBranch.result = irBranch.result.cast(resultType)
expression.putNthCondition(i, nthCondition.cast(builtIns.booleanType))
expression.putNthResult(i, nthResult.cast(resultType))
} }
expression.elseBranch = expression.elseBranch?.cast(resultType)
return expression return expression
} }
@@ -16,19 +16,23 @@
package org.jetbrains.kotlin.ir.expressions package org.jetbrains.kotlin.ir.expressions
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.visitors.IrElementTransformer
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
interface IrWhen : IrExpression { interface IrWhen : IrExpression {
val origin: IrStatementOrigin? val origin: IrStatementOrigin?
val branchesCount: Int val branches: MutableList<IrBranch>
fun getNthCondition(n: Int): IrExpression?
fun getNthResult(n: Int): IrExpression?
fun putNthCondition(n: Int, expression: IrExpression)
fun putNthResult(n: Int, expression: IrExpression)
var elseBranch: IrExpression?
} }
val IrWhen.branchIndices: IntRange get() = 0 ..branchesCount - 1 interface IrBranch : IrElement {
var condition: IrExpression
var result: IrExpression
override fun <D> transform(transformer: IrElementTransformer<D>, data: D): IrBranch =
transformer.visitBranch(this, data)
override fun <R, D> accept(visitor: IrElementVisitor<R, D>, data: D): R =
visitor.visitBranch(this, data)
}
@@ -16,17 +16,19 @@
package org.jetbrains.kotlin.ir.expressions.impl package org.jetbrains.kotlin.ir.expressions.impl
import org.jetbrains.kotlin.ir.expressions.IrBranch
import org.jetbrains.kotlin.ir.expressions.IrExpression import org.jetbrains.kotlin.ir.expressions.IrExpression
import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin
import org.jetbrains.kotlin.ir.expressions.IrWhen
import org.jetbrains.kotlin.ir.visitors.IrElementTransformer
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
import org.jetbrains.kotlin.types.KotlinType import org.jetbrains.kotlin.types.KotlinType
import org.jetbrains.kotlin.types.typeUtil.builtIns
import org.jetbrains.kotlin.utils.SmartList
class IrIfThenElseImpl( class IrIfThenElseImpl(
startOffset: Int, endOffset: Int, type: KotlinType, startOffset: Int, endOffset: Int, type: KotlinType,
override val origin: IrStatementOrigin? = null override val origin: IrStatementOrigin? = null
) : IrExpressionBase(startOffset, endOffset, type), IrWhen { ) : IrWhenBase(startOffset, endOffset, type) {
override val branches: MutableList<IrBranch> = SmartList()
constructor( constructor(
startOffset: Int, endOffset: Int, type: KotlinType, startOffset: Int, endOffset: Int, type: KotlinType,
condition: IrExpression, condition: IrExpression,
@@ -34,56 +36,9 @@ class IrIfThenElseImpl(
elseBranch: IrExpression? = null, elseBranch: IrExpression? = null,
origin: IrStatementOrigin? = null origin: IrStatementOrigin? = null
) : this(startOffset, endOffset, type, origin) { ) : this(startOffset, endOffset, type, origin) {
this.condition = condition branches.add(IrBranchImpl(startOffset, endOffset, condition, thenBranch))
this.thenBranch = thenBranch if (elseBranch != null) {
this.elseBranch = elseBranch branches.add(IrBranchImpl.elseBranch(elseBranch))
} }
override val branchesCount: Int get() = 1
override fun getNthCondition(n: Int): IrExpression? =
if (n == 0) condition else null
override fun getNthResult(n: Int): IrExpression? =
when (n) {
0 -> {
thenBranch
}
1 -> {
elseBranch
}
else -> null
}
override fun putNthCondition(n: Int, expression: IrExpression) {
if (n == 0) condition = expression
else throw AssertionError("No such branch $n")
}
override fun putNthResult(n: Int, expression: IrExpression) {
if (n == 0) thenBranch = expression
else throw AssertionError("No such branch $n")
}
lateinit var condition: IrExpression
lateinit var thenBranch: IrExpression
override var elseBranch: IrExpression? = null
override fun <R, D> accept(visitor: IrElementVisitor<R, D>, data: D): R =
visitor.visitWhen(this, data)
override fun <D> acceptChildren(visitor: IrElementVisitor<Unit, D>, data: D) {
condition.accept(visitor, data)
thenBranch.accept(visitor, data)
elseBranch?.accept(visitor, data)
}
override fun <D> transformChildren(transformer: IrElementTransformer<D>, data: D) {
condition = condition.transform(transformer, data)
thenBranch = thenBranch.transform(transformer, data)
elseBranch = elseBranch?.transform(transformer, data)
} }
} }
@@ -16,57 +16,58 @@
package org.jetbrains.kotlin.ir.expressions.impl package org.jetbrains.kotlin.ir.expressions.impl
import org.jetbrains.kotlin.ir.expressions.IrExpression import org.jetbrains.kotlin.ir.IrElementBase
import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin import org.jetbrains.kotlin.ir.expressions.*
import org.jetbrains.kotlin.ir.expressions.IrWhen
import org.jetbrains.kotlin.ir.visitors.IrElementTransformer import org.jetbrains.kotlin.ir.visitors.IrElementTransformer
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
import org.jetbrains.kotlin.types.KotlinType import org.jetbrains.kotlin.types.KotlinType
import org.jetbrains.kotlin.types.typeUtil.builtIns
import java.util.* import java.util.*
abstract class IrWhenBase(startOffset: Int, endOffset: Int, type: KotlinType, override val origin: IrStatementOrigin? = null) :
IrExpressionBase(startOffset, endOffset, type), IrWhen {
override fun <R, D> accept(visitor: IrElementVisitor<R, D>, data: D): R =
visitor.visitWhen(this, data)
override fun <D> acceptChildren(visitor: IrElementVisitor<Unit, D>, data: D) {
branches.forEach { it.accept(visitor, data) }
}
override fun <D> transformChildren(transformer: IrElementTransformer<D>, data: D) {
branches.forEachIndexed { i, irBranch ->
branches[i] = irBranch.transform(transformer, data)
}
}
}
class IrWhenImpl( class IrWhenImpl(
startOffset: Int, startOffset: Int,
endOffset: Int, endOffset: Int,
type: KotlinType, type: KotlinType,
override val origin: IrStatementOrigin? = null override val origin: IrStatementOrigin? = null
) : IrExpressionBase(startOffset, endOffset, type), IrWhen { ) : IrWhenBase(startOffset, endOffset, type) {
private val branchParts = ArrayList<IrExpression>() override val branches: MutableList<IrBranch> = ArrayList()
}
fun addBranch(condition: IrExpression, result: IrExpression) { class IrBranchImpl(startOffset: Int, endOffset: Int, override var condition: IrExpression, override var result: IrExpression) :
branchParts.add(condition) IrElementBase(startOffset, endOffset), IrBranch {
branchParts.add(result) constructor(condition: IrExpression, result: IrExpression) : this(condition.startOffset, condition.endOffset, condition, result)
}
override var elseBranch: IrExpression? = null
override val branchesCount: Int get() = branchParts.size / 2
override fun getNthCondition(n: Int): IrExpression? =
branchParts.getOrNull(n * 2)
override fun getNthResult(n: Int): IrExpression? =
branchParts.getOrNull(n * 2 + 1)
override fun putNthCondition(n: Int, expression: IrExpression) {
branchParts[n * 2] = expression
}
override fun putNthResult(n: Int, expression: IrExpression) {
branchParts[n * 2 + 1] = expression
}
override fun <R, D> accept(visitor: IrElementVisitor<R, D>, data: D): R =
visitor.visitWhen(this, data)
override fun <D> acceptChildren(visitor: IrElementVisitor<Unit, D>, data: D) { override fun <D> acceptChildren(visitor: IrElementVisitor<Unit, D>, data: D) {
branchParts.forEach { it.accept(visitor, data) } condition.accept(visitor, data)
elseBranch?.accept(visitor, data) result.accept(visitor, data)
} }
override fun <D> transformChildren(transformer: IrElementTransformer<D>, data: D) { override fun <D> transformChildren(transformer: IrElementTransformer<D>, data: D) {
branchParts.forEachIndexed { i, irExpression -> condition = condition.transform(transformer, data)
branchParts[i] = irExpression.transform(transformer, data) result = result.transform(transformer, data)
} }
elseBranch = elseBranch?.transform(transformer, data)
companion object {
fun elseBranch(result: IrExpression) =
IrBranchImpl(
IrConstImpl.boolean(result.startOffset, result.endOffset, result.type.builtIns.booleanType, true),
result
)
} }
} }
@@ -131,11 +131,16 @@ class DumpIrTreeVisitor(out: Appendable): IrElementVisitor<Unit, String> {
override fun visitWhen(expression: IrWhen, data: String) { override fun visitWhen(expression: IrWhen, data: String) {
expression.dumpLabeledElementWith(data) { expression.dumpLabeledElementWith(data) {
for (i in 0 .. expression.branchesCount - 1) { expression.branches.forEach {
expression.getNthCondition(i)!!.accept(this, "if") it.accept(this, "")
expression.getNthResult(i)!!.accept(this, "then")
} }
expression.elseBranch?.accept(this, "else") }
}
override fun visitBranch(branch: IrBranch, data: String) {
branch.dumpLabeledElementWith(data) {
branch.condition.accept(this, "if")
branch.result.accept(this, "then")
} }
} }
@@ -155,6 +155,9 @@ class RenderIrElementVisitor : IrElementVisitor<String, Nothing?> {
override fun visitWhen(expression: IrWhen, data: Nothing?): String = override fun visitWhen(expression: IrWhen, data: Nothing?): String =
"WHEN type=${expression.type.render()} origin=${expression.origin}" "WHEN type=${expression.type.render()} origin=${expression.origin}"
override fun visitBranch(branch: IrBranch, data: Nothing?): String =
"BRANCH"
override fun visitWhileLoop(loop: IrWhileLoop, data: Nothing?): String = override fun visitWhileLoop(loop: IrWhileLoop, data: Nothing?): String =
"WHILE label=${loop.label} origin=${loop.origin}" "WHILE label=${loop.label} origin=${loop.origin}"
@@ -92,6 +92,13 @@ interface IrElementTransformer<in D> : IrElementVisitor<IrElement, D> {
override fun visitTypeOperator(expression: IrTypeOperatorCall, data: D) = visitExpression(expression, data) override fun visitTypeOperator(expression: IrTypeOperatorCall, data: D) = visitExpression(expression, data)
override fun visitWhen(expression: IrWhen, data: D) = visitExpression(expression, data) override fun visitWhen(expression: IrWhen, data: D) = visitExpression(expression, data)
override fun visitBranch(branch: IrBranch, data: D): IrBranch =
branch.apply {
condition = condition.transform(this@IrElementTransformer, data)
result = result.transform(this@IrElementTransformer, data)
}
override fun visitLoop(loop: IrLoop, data: D) = visitExpression(loop, data) override fun visitLoop(loop: IrLoop, data: D) = visitExpression(loop, data)
override fun visitWhileLoop(loop: IrWhileLoop, data: D) = visitLoop(loop, data) override fun visitWhileLoop(loop: IrWhileLoop, data: D) = visitLoop(loop, data)
override fun visitDoWhileLoop(loop: IrDoWhileLoop, data: D) = visitLoop(loop, data) override fun visitDoWhileLoop(loop: IrDoWhileLoop, data: D) = visitLoop(loop, data)
@@ -78,6 +78,7 @@ interface IrElementVisitor<out R, in D> {
fun visitTypeOperator(expression: IrTypeOperatorCall, data: D) = visitExpression(expression, data) fun visitTypeOperator(expression: IrTypeOperatorCall, data: D) = visitExpression(expression, data)
fun visitWhen(expression: IrWhen, data: D) = visitExpression(expression, data) fun visitWhen(expression: IrWhen, data: D) = visitExpression(expression, data)
fun visitBranch(branch: IrBranch, data: D) = visitElement(branch, data)
fun visitLoop(loop: IrLoop, data: D) = visitExpression(loop, data) fun visitLoop(loop: IrLoop, data: D) = visitExpression(loop, data)
fun visitWhileLoop(loop: IrWhileLoop, data: D) = visitLoop(loop, data) fun visitWhileLoop(loop: IrWhileLoop, data: D) = visitLoop(loop, data)
fun visitDoWhileLoop(loop: IrDoWhileLoop, data: D) = visitLoop(loop, data) fun visitDoWhileLoop(loop: IrDoWhileLoop, data: D) = visitLoop(loop, data)
@@ -165,6 +165,9 @@ interface IrElementVisitorVoid : IrElementVisitor<Unit, Nothing?> {
fun visitWhen(expression: IrWhen) = visitExpression(expression) fun visitWhen(expression: IrWhen) = visitExpression(expression)
override fun visitWhen(expression: IrWhen, data: Nothing?) = visitWhen(expression) override fun visitWhen(expression: IrWhen, data: Nothing?) = visitWhen(expression)
fun visitBranch(branch: IrBranch) = visitElement(branch)
override fun visitBranch(branch: IrBranch, data: Nothing?) = visitBranch(branch)
fun visitLoop(loop: IrLoop) = visitExpression(loop) fun visitLoop(loop: IrLoop) = visitExpression(loop)
override fun visitLoop(loop: IrLoop, data: Nothing?) = visitLoop(loop) override fun visitLoop(loop: IrLoop, data: Nothing?) = visitLoop(loop)
+5
View File
@@ -99,12 +99,14 @@ FILE /dataClasses.kt
FUN GENERATED_DATA_CLASS_MEMBER public open override fun equals(other: kotlin.Any?): kotlin.Boolean FUN GENERATED_DATA_CLASS_MEMBER public open override fun equals(other: kotlin.Any?): kotlin.Boolean
BLOCK_BODY BLOCK_BODY
WHEN type=kotlin.Unit origin=null WHEN type=kotlin.Unit origin=null
BRANCH
if: CALL 'EQEQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQEQ if: CALL 'EQEQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQEQ
arg0: THIS of 'Test1' type=Test1 arg0: THIS of 'Test1' type=Test1
arg1: GET_VAR 'value-parameter other: Any?' type=kotlin.Any? origin=null arg1: GET_VAR 'value-parameter other: Any?' type=kotlin.Any? origin=null
then: RETURN type=kotlin.Nothing from='equals(Any?): Boolean' then: RETURN type=kotlin.Nothing from='equals(Any?): Boolean'
CONST Boolean type=kotlin.Boolean value='true' CONST Boolean type=kotlin.Boolean value='true'
WHEN type=kotlin.Unit origin=null WHEN type=kotlin.Unit origin=null
BRANCH
if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=Test1 if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=Test1
GET_VAR 'value-parameter other: Any?' type=kotlin.Any? origin=null GET_VAR 'value-parameter other: Any?' type=kotlin.Any? origin=null
then: RETURN type=kotlin.Nothing from='equals(Any?): Boolean' then: RETURN type=kotlin.Nothing from='equals(Any?): Boolean'
@@ -113,6 +115,7 @@ FILE /dataClasses.kt
TYPE_OP origin=CAST typeOperand=Test1 TYPE_OP origin=CAST typeOperand=Test1
GET_VAR 'value-parameter other: Any?' type=kotlin.Any? origin=null GET_VAR 'value-parameter other: Any?' type=kotlin.Any? origin=null
WHEN type=kotlin.Unit origin=null WHEN type=kotlin.Unit origin=null
BRANCH
if: CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ if: CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EXCLEQ arg0: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: CALL '<get-x>(): Int' type=kotlin.Int origin=GET_PROPERTY arg0: CALL '<get-x>(): Int' type=kotlin.Int origin=GET_PROPERTY
@@ -122,6 +125,7 @@ FILE /dataClasses.kt
then: RETURN type=kotlin.Nothing from='equals(Any?): Boolean' then: RETURN type=kotlin.Nothing from='equals(Any?): Boolean'
CONST Boolean type=kotlin.Boolean value='false' CONST Boolean type=kotlin.Boolean value='false'
WHEN type=kotlin.Unit origin=null WHEN type=kotlin.Unit origin=null
BRANCH
if: CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ if: CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EXCLEQ arg0: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: CALL '<get-y>(): String' type=kotlin.String origin=GET_PROPERTY arg0: CALL '<get-y>(): String' type=kotlin.String origin=GET_PROPERTY
@@ -131,6 +135,7 @@ FILE /dataClasses.kt
then: RETURN type=kotlin.Nothing from='equals(Any?): Boolean' then: RETURN type=kotlin.Nothing from='equals(Any?): Boolean'
CONST Boolean type=kotlin.Boolean value='false' CONST Boolean type=kotlin.Boolean value='false'
WHEN type=kotlin.Unit origin=null WHEN type=kotlin.Unit origin=null
BRANCH
if: CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ if: CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EXCLEQ arg0: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: CALL '<get-z>(): Any' type=kotlin.Any origin=GET_PROPERTY arg0: CALL '<get-z>(): Any' type=kotlin.Any origin=GET_PROPERTY
+12 -3
View File
@@ -6,11 +6,14 @@ FILE /bangbang.kt
VAR IR_TEMPORARY_VARIABLE val tmp0_notnull: kotlin.Any? VAR IR_TEMPORARY_VARIABLE val tmp0_notnull: kotlin.Any?
GET_VAR 'value-parameter a: Any?' type=kotlin.Any? origin=null GET_VAR 'value-parameter a: Any?' type=kotlin.Any? origin=null
WHEN type=kotlin.Any origin=null WHEN type=kotlin.Any origin=null
BRANCH
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'tmp0_notnull: Any?' type=kotlin.Any? origin=null arg0: GET_VAR 'tmp0_notnull: Any?' type=kotlin.Any? origin=null
arg1: CONST Null type=kotlin.Nothing? value='null' arg1: CONST Null type=kotlin.Nothing? value='null'
then: CALL 'THROW_NPE(): Nothing' type=kotlin.Nothing origin=EXCLEXCL then: CALL 'THROW_NPE(): Nothing' type=kotlin.Nothing origin=EXCLEXCL
else: GET_VAR 'tmp0_notnull: Any?' type=kotlin.Any? origin=null BRANCH
if: CONST Boolean type=kotlin.Boolean value='true'
then: GET_VAR 'tmp0_notnull: Any?' type=kotlin.Any? origin=null
FUN public fun test2(a: kotlin.Any?): kotlin.Int FUN public fun test2(a: kotlin.Any?): kotlin.Int
BLOCK_BODY BLOCK_BODY
RETURN type=kotlin.Nothing from='test2(Any?): Int' RETURN type=kotlin.Nothing from='test2(Any?): Int'
@@ -20,15 +23,21 @@ FILE /bangbang.kt
VAR IR_TEMPORARY_VARIABLE val tmp0_safe_receiver: kotlin.Any? VAR IR_TEMPORARY_VARIABLE val tmp0_safe_receiver: kotlin.Any?
GET_VAR 'value-parameter a: Any?' type=kotlin.Any? origin=null GET_VAR 'value-parameter a: Any?' type=kotlin.Any? origin=null
WHEN type=kotlin.Int? origin=SAFE_CALL WHEN type=kotlin.Int? origin=SAFE_CALL
BRANCH
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'tmp0_safe_receiver: Any?' type=kotlin.Any? origin=null arg0: GET_VAR 'tmp0_safe_receiver: Any?' type=kotlin.Any? origin=null
arg1: CONST Null type=kotlin.Nothing? value='null' arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null' then: CONST Null type=kotlin.Nothing? value='null'
else: CALL 'hashCode(): Int' type=kotlin.Int origin=null BRANCH
if: CONST Boolean type=kotlin.Boolean value='true'
then: CALL 'hashCode(): Int' type=kotlin.Int origin=null
$this: GET_VAR 'tmp0_safe_receiver: Any?' type=kotlin.Any? origin=null $this: GET_VAR 'tmp0_safe_receiver: Any?' type=kotlin.Any? origin=null
WHEN type=kotlin.Int origin=null WHEN type=kotlin.Int origin=null
BRANCH
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'tmp1_notnull: Int?' type=kotlin.Int? origin=null arg0: GET_VAR 'tmp1_notnull: Int?' type=kotlin.Int? origin=null
arg1: CONST Null type=kotlin.Nothing? value='null' arg1: CONST Null type=kotlin.Nothing? value='null'
then: CALL 'THROW_NPE(): Nothing' type=kotlin.Nothing origin=EXCLEXCL then: CALL 'THROW_NPE(): Nothing' type=kotlin.Nothing origin=EXCLEXCL
else: GET_VAR 'tmp1_notnull: Int?' type=kotlin.Int? origin=null BRANCH
if: CONST Boolean type=kotlin.Boolean value='true'
then: GET_VAR 'tmp1_notnull: Int?' type=kotlin.Int? origin=null
@@ -3,16 +3,22 @@ FILE /booleanOperators.kt
BLOCK_BODY BLOCK_BODY
RETURN type=kotlin.Nothing from='test1(Boolean, Boolean): Boolean' RETURN type=kotlin.Nothing from='test1(Boolean, Boolean): Boolean'
WHEN type=kotlin.Boolean origin=ANDAND WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: GET_VAR 'value-parameter a: Boolean' type=kotlin.Boolean origin=null if: GET_VAR 'value-parameter a: Boolean' type=kotlin.Boolean origin=null
then: GET_VAR 'value-parameter b: Boolean' type=kotlin.Boolean origin=null then: GET_VAR 'value-parameter b: Boolean' type=kotlin.Boolean origin=null
else: CONST Boolean type=kotlin.Boolean value='false' BRANCH
if: CONST Boolean type=kotlin.Boolean value='true'
then: CONST Boolean type=kotlin.Boolean value='false'
FUN public fun test2(a: kotlin.Boolean, b: kotlin.Boolean): kotlin.Boolean FUN public fun test2(a: kotlin.Boolean, b: kotlin.Boolean): kotlin.Boolean
BLOCK_BODY BLOCK_BODY
RETURN type=kotlin.Nothing from='test2(Boolean, Boolean): Boolean' RETURN type=kotlin.Nothing from='test2(Boolean, Boolean): Boolean'
WHEN type=kotlin.Boolean origin=OROR WHEN type=kotlin.Boolean origin=OROR
BRANCH
if: GET_VAR 'value-parameter a: Boolean' type=kotlin.Boolean origin=null if: GET_VAR 'value-parameter a: Boolean' type=kotlin.Boolean origin=null
then: CONST Boolean type=kotlin.Boolean value='true' then: CONST Boolean type=kotlin.Boolean value='true'
else: GET_VAR 'value-parameter b: Boolean' type=kotlin.Boolean origin=null BRANCH
if: CONST Boolean type=kotlin.Boolean value='true'
then: GET_VAR 'value-parameter b: Boolean' type=kotlin.Boolean origin=null
FUN public fun test1x(a: kotlin.Boolean, b: kotlin.Boolean): kotlin.Boolean FUN public fun test1x(a: kotlin.Boolean, b: kotlin.Boolean): kotlin.Boolean
BLOCK_BODY BLOCK_BODY
RETURN type=kotlin.Nothing from='test1x(Boolean, Boolean): Boolean' RETURN type=kotlin.Nothing from='test1x(Boolean, Boolean): Boolean'
@@ -9,11 +9,14 @@ FILE /breakContinueInLoopHeader.kt
VAR IR_TEMPORARY_VARIABLE val tmp0_elvis_lhs: kotlin.Boolean? VAR IR_TEMPORARY_VARIABLE val tmp0_elvis_lhs: kotlin.Boolean?
GET_VAR 'value-parameter c: Boolean?' type=kotlin.Boolean? origin=null GET_VAR 'value-parameter c: Boolean?' type=kotlin.Boolean? origin=null
WHEN type=kotlin.Boolean origin=null WHEN type=kotlin.Boolean origin=null
BRANCH
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'tmp0_elvis_lhs: Boolean?' type=kotlin.Boolean? origin=null arg0: GET_VAR 'tmp0_elvis_lhs: Boolean?' type=kotlin.Boolean? origin=null
arg1: CONST Null type=kotlin.Nothing? value='null' arg1: CONST Null type=kotlin.Nothing? value='null'
then: BREAK label=null loop.label=L then: BREAK label=null loop.label=L
else: GET_VAR 'tmp0_elvis_lhs: Boolean?' type=kotlin.Boolean? origin=null BRANCH
if: CONST Boolean type=kotlin.Boolean value='true'
then: GET_VAR 'tmp0_elvis_lhs: Boolean?' type=kotlin.Boolean? origin=null
FUN public fun test2(c: kotlin.Boolean?): kotlin.Unit FUN public fun test2(c: kotlin.Boolean?): kotlin.Unit
BLOCK_BODY BLOCK_BODY
WHILE label=L origin=WHILE_LOOP WHILE label=L origin=WHILE_LOOP
@@ -24,11 +27,14 @@ FILE /breakContinueInLoopHeader.kt
VAR IR_TEMPORARY_VARIABLE val tmp0_elvis_lhs: kotlin.Boolean? VAR IR_TEMPORARY_VARIABLE val tmp0_elvis_lhs: kotlin.Boolean?
GET_VAR 'value-parameter c: Boolean?' type=kotlin.Boolean? origin=null GET_VAR 'value-parameter c: Boolean?' type=kotlin.Boolean? origin=null
WHEN type=kotlin.Boolean origin=null WHEN type=kotlin.Boolean origin=null
BRANCH
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'tmp0_elvis_lhs: Boolean?' type=kotlin.Boolean? origin=null arg0: GET_VAR 'tmp0_elvis_lhs: Boolean?' type=kotlin.Boolean? origin=null
arg1: CONST Null type=kotlin.Nothing? value='null' arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONTINUE label=null loop.label=L then: CONTINUE label=null loop.label=L
else: GET_VAR 'tmp0_elvis_lhs: Boolean?' type=kotlin.Boolean? origin=null BRANCH
if: CONST Boolean type=kotlin.Boolean value='true'
then: GET_VAR 'tmp0_elvis_lhs: Boolean?' type=kotlin.Boolean? origin=null
FUN public fun test3(ss: kotlin.collections.List<kotlin.String>?): kotlin.Unit FUN public fun test3(ss: kotlin.collections.List<kotlin.String>?): kotlin.Unit
BLOCK_BODY BLOCK_BODY
WHILE label=L origin=WHILE_LOOP WHILE label=L origin=WHILE_LOOP
@@ -41,11 +47,14 @@ FILE /breakContinueInLoopHeader.kt
VAR IR_TEMPORARY_VARIABLE val tmp0_elvis_lhs: kotlin.collections.List<kotlin.String>? VAR IR_TEMPORARY_VARIABLE val tmp0_elvis_lhs: kotlin.collections.List<kotlin.String>?
GET_VAR 'value-parameter ss: List<String>?' type=kotlin.collections.List<kotlin.String>? origin=null GET_VAR 'value-parameter ss: List<String>?' type=kotlin.collections.List<kotlin.String>? origin=null
WHEN type=kotlin.collections.List<kotlin.String> origin=null WHEN type=kotlin.collections.List<kotlin.String> origin=null
BRANCH
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'tmp0_elvis_lhs: List<String>?' type=kotlin.collections.List<kotlin.String>? origin=null arg0: GET_VAR 'tmp0_elvis_lhs: List<String>?' type=kotlin.collections.List<kotlin.String>? origin=null
arg1: CONST Null type=kotlin.Nothing? value='null' arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONTINUE label=null loop.label=L then: CONTINUE label=null loop.label=L
else: GET_VAR 'tmp0_elvis_lhs: List<String>?' type=kotlin.collections.List<kotlin.String>? origin=null BRANCH
if: CONST Boolean type=kotlin.Boolean value='true'
then: GET_VAR 'tmp0_elvis_lhs: List<String>?' type=kotlin.collections.List<kotlin.String>? origin=null
WHILE label=null origin=FOR_LOOP_INNER_WHILE WHILE label=null origin=FOR_LOOP_INNER_WHILE
condition: CALL 'hasNext(): Boolean' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT condition: CALL 'hasNext(): Boolean' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT
$this: GET_VAR 'tmp1_iterator: Iterator<String>' type=kotlin.collections.Iterator<kotlin.String> origin=null $this: GET_VAR 'tmp1_iterator: Iterator<String>' type=kotlin.collections.Iterator<kotlin.String> origin=null
@@ -65,11 +74,14 @@ FILE /breakContinueInLoopHeader.kt
VAR IR_TEMPORARY_VARIABLE val tmp0_elvis_lhs: kotlin.collections.List<kotlin.String>? VAR IR_TEMPORARY_VARIABLE val tmp0_elvis_lhs: kotlin.collections.List<kotlin.String>?
GET_VAR 'value-parameter ss: List<String>?' type=kotlin.collections.List<kotlin.String>? origin=null GET_VAR 'value-parameter ss: List<String>?' type=kotlin.collections.List<kotlin.String>? origin=null
WHEN type=kotlin.collections.List<kotlin.String> origin=null WHEN type=kotlin.collections.List<kotlin.String> origin=null
BRANCH
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'tmp0_elvis_lhs: List<String>?' type=kotlin.collections.List<kotlin.String>? origin=null arg0: GET_VAR 'tmp0_elvis_lhs: List<String>?' type=kotlin.collections.List<kotlin.String>? origin=null
arg1: CONST Null type=kotlin.Nothing? value='null' arg1: CONST Null type=kotlin.Nothing? value='null'
then: BREAK label=null loop.label=L then: BREAK label=null loop.label=L
else: GET_VAR 'tmp0_elvis_lhs: List<String>?' type=kotlin.collections.List<kotlin.String>? origin=null BRANCH
if: CONST Boolean type=kotlin.Boolean value='true'
then: GET_VAR 'tmp0_elvis_lhs: List<String>?' type=kotlin.collections.List<kotlin.String>? origin=null
WHILE label=null origin=FOR_LOOP_INNER_WHILE WHILE label=null origin=FOR_LOOP_INNER_WHILE
condition: CALL 'hasNext(): Boolean' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT condition: CALL 'hasNext(): Boolean' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT
$this: GET_VAR 'tmp1_iterator: Iterator<String>' type=kotlin.collections.Iterator<kotlin.String> origin=null $this: GET_VAR 'tmp1_iterator: Iterator<String>' type=kotlin.collections.Iterator<kotlin.String> origin=null
@@ -25,30 +25,42 @@ FILE /chainOfSafeCalls.kt
VAR IR_TEMPORARY_VARIABLE val tmp0_safe_receiver: C? VAR IR_TEMPORARY_VARIABLE val tmp0_safe_receiver: C?
GET_VAR 'value-parameter nc: C?' type=C? origin=null GET_VAR 'value-parameter nc: C?' type=C? origin=null
WHEN type=C? origin=SAFE_CALL WHEN type=C? origin=SAFE_CALL
BRANCH
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'tmp0_safe_receiver: C?' type=C? origin=null arg0: GET_VAR 'tmp0_safe_receiver: C?' type=C? origin=null
arg1: CONST Null type=kotlin.Nothing? value='null' arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null' then: CONST Null type=kotlin.Nothing? value='null'
else: CALL 'foo(): C' type=C origin=null BRANCH
if: CONST Boolean type=kotlin.Boolean value='true'
then: CALL 'foo(): C' type=C origin=null
$this: GET_VAR 'tmp0_safe_receiver: C?' type=C? origin=null $this: GET_VAR 'tmp0_safe_receiver: C?' type=C? origin=null
WHEN type=C? origin=SAFE_CALL WHEN type=C? origin=SAFE_CALL
BRANCH
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'tmp1_safe_receiver: C?' type=C? origin=null arg0: GET_VAR 'tmp1_safe_receiver: C?' type=C? origin=null
arg1: CONST Null type=kotlin.Nothing? value='null' arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null' then: CONST Null type=kotlin.Nothing? value='null'
else: CALL 'bar(): C?' type=C? origin=null BRANCH
if: CONST Boolean type=kotlin.Boolean value='true'
then: CALL 'bar(): C?' type=C? origin=null
$this: GET_VAR 'tmp1_safe_receiver: C?' type=C? origin=null $this: GET_VAR 'tmp1_safe_receiver: C?' type=C? origin=null
WHEN type=C? origin=SAFE_CALL WHEN type=C? origin=SAFE_CALL
BRANCH
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'tmp2_safe_receiver: C?' type=C? origin=null arg0: GET_VAR 'tmp2_safe_receiver: C?' type=C? origin=null
arg1: CONST Null type=kotlin.Nothing? value='null' arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null' then: CONST Null type=kotlin.Nothing? value='null'
else: CALL 'foo(): C' type=C origin=null BRANCH
if: CONST Boolean type=kotlin.Boolean value='true'
then: CALL 'foo(): C' type=C origin=null
$this: GET_VAR 'tmp2_safe_receiver: C?' type=C? origin=null $this: GET_VAR 'tmp2_safe_receiver: C?' type=C? origin=null
WHEN type=C? origin=SAFE_CALL WHEN type=C? origin=SAFE_CALL
BRANCH
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'tmp3_safe_receiver: C?' type=C? origin=null arg0: GET_VAR 'tmp3_safe_receiver: C?' type=C? origin=null
arg1: CONST Null type=kotlin.Nothing? value='null' arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null' then: CONST Null type=kotlin.Nothing? value='null'
else: CALL 'foo(): C' type=C origin=null BRANCH
if: CONST Boolean type=kotlin.Boolean value='true'
then: CALL 'foo(): C' type=C origin=null
$this: GET_VAR 'tmp3_safe_receiver: C?' type=C? origin=null $this: GET_VAR 'tmp3_safe_receiver: C?' type=C? origin=null
+8 -2
View File
@@ -26,11 +26,14 @@ FILE /coercionToUnit.kt
VAR IR_TEMPORARY_VARIABLE val tmp0_safe_receiver: java.io.PrintStream! VAR IR_TEMPORARY_VARIABLE val tmp0_safe_receiver: java.io.PrintStream!
GET_FIELD 'out: PrintStream!' type=java.io.PrintStream! origin=GET_PROPERTY GET_FIELD 'out: PrintStream!' type=java.io.PrintStream! origin=GET_PROPERTY
WHEN type=kotlin.Unit? origin=SAFE_CALL WHEN type=kotlin.Unit? origin=SAFE_CALL
BRANCH
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'tmp0_safe_receiver: PrintStream!' type=java.io.PrintStream! origin=null arg0: GET_VAR 'tmp0_safe_receiver: PrintStream!' type=java.io.PrintStream! origin=null
arg1: CONST Null type=kotlin.Nothing? value='null' arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null' then: CONST Null type=kotlin.Nothing? value='null'
else: CALL 'println(String!): Unit' type=kotlin.Unit origin=null BRANCH
if: CONST Boolean type=kotlin.Boolean value='true'
then: CALL 'println(String!): Unit' type=kotlin.Unit origin=null
$this: TYPE_OP origin=IMPLICIT_NOTNULL typeOperand=java.io.PrintStream $this: TYPE_OP origin=IMPLICIT_NOTNULL typeOperand=java.io.PrintStream
GET_VAR 'tmp0_safe_receiver: PrintStream!' type=java.io.PrintStream! origin=null GET_VAR 'tmp0_safe_receiver: PrintStream!' type=java.io.PrintStream! origin=null
p0: CONST String type=kotlin.String value='Hello,' p0: CONST String type=kotlin.String value='Hello,'
@@ -39,11 +42,14 @@ FILE /coercionToUnit.kt
VAR IR_TEMPORARY_VARIABLE val tmp1_safe_receiver: java.io.PrintStream! VAR IR_TEMPORARY_VARIABLE val tmp1_safe_receiver: java.io.PrintStream!
GET_FIELD 'out: PrintStream!' type=java.io.PrintStream! origin=GET_PROPERTY GET_FIELD 'out: PrintStream!' type=java.io.PrintStream! origin=GET_PROPERTY
WHEN type=kotlin.Unit? origin=SAFE_CALL WHEN type=kotlin.Unit? origin=SAFE_CALL
BRANCH
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'tmp1_safe_receiver: PrintStream!' type=java.io.PrintStream! origin=null arg0: GET_VAR 'tmp1_safe_receiver: PrintStream!' type=java.io.PrintStream! origin=null
arg1: CONST Null type=kotlin.Nothing? value='null' arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null' then: CONST Null type=kotlin.Nothing? value='null'
else: CALL 'println(String!): Unit' type=kotlin.Unit origin=null BRANCH
if: CONST Boolean type=kotlin.Boolean value='true'
then: CALL 'println(String!): Unit' type=kotlin.Unit origin=null
$this: TYPE_OP origin=IMPLICIT_NOTNULL typeOperand=java.io.PrintStream $this: TYPE_OP origin=IMPLICIT_NOTNULL typeOperand=java.io.PrintStream
GET_VAR 'tmp1_safe_receiver: PrintStream!' type=java.io.PrintStream! origin=null GET_VAR 'tmp1_safe_receiver: PrintStream!' type=java.io.PrintStream! origin=null
p0: CONST String type=kotlin.String value='world!' p0: CONST String type=kotlin.String value='world!'
+4 -1
View File
@@ -11,9 +11,12 @@ FILE /dotQualified.kt
VAR IR_TEMPORARY_VARIABLE val tmp0_safe_receiver: kotlin.String? VAR IR_TEMPORARY_VARIABLE val tmp0_safe_receiver: kotlin.String?
GET_VAR 'value-parameter s: String?' type=kotlin.String? origin=null GET_VAR 'value-parameter s: String?' type=kotlin.String? origin=null
WHEN type=kotlin.Int? origin=SAFE_CALL WHEN type=kotlin.Int? origin=SAFE_CALL
BRANCH
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null arg0: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null
arg1: CONST Null type=kotlin.Nothing? value='null' arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null' then: CONST Null type=kotlin.Nothing? value='null'
else: CALL '<get-length>(): Int' type=kotlin.Int origin=GET_PROPERTY BRANCH
if: CONST Boolean type=kotlin.Boolean value='true'
then: CALL '<get-length>(): Int' type=kotlin.Int origin=GET_PROPERTY
$this: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null $this: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null
+24 -7
View File
@@ -18,11 +18,14 @@ FILE /elvis.kt
VAR IR_TEMPORARY_VARIABLE val tmp0_elvis_lhs: kotlin.Any? VAR IR_TEMPORARY_VARIABLE val tmp0_elvis_lhs: kotlin.Any?
GET_VAR 'value-parameter a: Any?' type=kotlin.Any? origin=null GET_VAR 'value-parameter a: Any?' type=kotlin.Any? origin=null
WHEN type=kotlin.Any origin=null WHEN type=kotlin.Any origin=null
BRANCH
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'tmp0_elvis_lhs: Any?' type=kotlin.Any? origin=null arg0: GET_VAR 'tmp0_elvis_lhs: Any?' type=kotlin.Any? origin=null
arg1: CONST Null type=kotlin.Nothing? value='null' arg1: CONST Null type=kotlin.Nothing? value='null'
then: GET_VAR 'value-parameter b: Any' type=kotlin.Any origin=null then: GET_VAR 'value-parameter b: Any' type=kotlin.Any origin=null
else: GET_VAR 'tmp0_elvis_lhs: Any?' type=kotlin.Any? origin=null BRANCH
if: CONST Boolean type=kotlin.Boolean value='true'
then: GET_VAR 'tmp0_elvis_lhs: Any?' type=kotlin.Any? origin=null
FUN public fun test2(a: kotlin.String?, b: kotlin.Any): kotlin.Any FUN public fun test2(a: kotlin.String?, b: kotlin.Any): kotlin.Any
BLOCK_BODY BLOCK_BODY
RETURN type=kotlin.Nothing from='test2(String?, Any): Any' RETURN type=kotlin.Nothing from='test2(String?, Any): Any'
@@ -30,19 +33,24 @@ FILE /elvis.kt
VAR IR_TEMPORARY_VARIABLE val tmp0_elvis_lhs: kotlin.String? VAR IR_TEMPORARY_VARIABLE val tmp0_elvis_lhs: kotlin.String?
GET_VAR 'value-parameter a: String?' type=kotlin.String? origin=null GET_VAR 'value-parameter a: String?' type=kotlin.String? origin=null
WHEN type=kotlin.Any origin=null WHEN type=kotlin.Any origin=null
BRANCH
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'tmp0_elvis_lhs: String?' type=kotlin.String? origin=null arg0: GET_VAR 'tmp0_elvis_lhs: String?' type=kotlin.String? origin=null
arg1: CONST Null type=kotlin.Nothing? value='null' arg1: CONST Null type=kotlin.Nothing? value='null'
then: GET_VAR 'value-parameter b: Any' type=kotlin.Any origin=null then: GET_VAR 'value-parameter b: Any' type=kotlin.Any origin=null
else: GET_VAR 'tmp0_elvis_lhs: String?' type=kotlin.String? origin=null BRANCH
if: CONST Boolean type=kotlin.Boolean value='true'
then: GET_VAR 'tmp0_elvis_lhs: String?' type=kotlin.String? origin=null
FUN public fun test3(a: kotlin.Any?, b: kotlin.Any?): kotlin.String FUN public fun test3(a: kotlin.Any?, b: kotlin.Any?): kotlin.String
BLOCK_BODY BLOCK_BODY
WHEN type=kotlin.Unit origin=IF WHEN type=kotlin.Unit origin=null
BRANCH
if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=kotlin.String if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=kotlin.String
GET_VAR 'value-parameter b: Any?' type=kotlin.Any? origin=null GET_VAR 'value-parameter b: Any?' type=kotlin.Any? origin=null
then: RETURN type=kotlin.Nothing from='test3(Any?, Any?): String' then: RETURN type=kotlin.Nothing from='test3(Any?, Any?): String'
CONST String type=kotlin.String value='' CONST String type=kotlin.String value=''
WHEN type=kotlin.Unit origin=IF WHEN type=kotlin.Unit origin=null
BRANCH
if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=kotlin.String? if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=kotlin.String?
GET_VAR 'value-parameter a: Any?' type=kotlin.Any? origin=null GET_VAR 'value-parameter a: Any?' type=kotlin.Any? origin=null
then: RETURN type=kotlin.Nothing from='test3(Any?, Any?): String' then: RETURN type=kotlin.Nothing from='test3(Any?, Any?): String'
@@ -52,12 +60,15 @@ FILE /elvis.kt
VAR IR_TEMPORARY_VARIABLE val tmp0_elvis_lhs: kotlin.Any? VAR IR_TEMPORARY_VARIABLE val tmp0_elvis_lhs: kotlin.Any?
GET_VAR 'value-parameter a: Any?' type=kotlin.Any? origin=null GET_VAR 'value-parameter a: Any?' type=kotlin.Any? origin=null
WHEN type=kotlin.String origin=null WHEN type=kotlin.String origin=null
BRANCH
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'tmp0_elvis_lhs: Any?' type=kotlin.Any? origin=null arg0: GET_VAR 'tmp0_elvis_lhs: Any?' type=kotlin.Any? origin=null
arg1: CONST Null type=kotlin.Nothing? value='null' arg1: CONST Null type=kotlin.Nothing? value='null'
then: TYPE_OP origin=IMPLICIT_CAST typeOperand=kotlin.String then: TYPE_OP origin=IMPLICIT_CAST typeOperand=kotlin.String
GET_VAR 'value-parameter b: Any?' type=kotlin.Any? origin=null GET_VAR 'value-parameter b: Any?' type=kotlin.Any? origin=null
else: TYPE_OP origin=IMPLICIT_CAST typeOperand=kotlin.String BRANCH
if: CONST Boolean type=kotlin.Boolean value='true'
then: TYPE_OP origin=IMPLICIT_CAST typeOperand=kotlin.String
GET_VAR 'tmp0_elvis_lhs: Any?' type=kotlin.Any? origin=null GET_VAR 'tmp0_elvis_lhs: Any?' type=kotlin.Any? origin=null
FUN public fun test4(x: kotlin.Any): kotlin.Any FUN public fun test4(x: kotlin.Any): kotlin.Any
BLOCK_BODY BLOCK_BODY
@@ -66,11 +77,14 @@ FILE /elvis.kt
VAR IR_TEMPORARY_VARIABLE val tmp0_elvis_lhs: kotlin.Any? VAR IR_TEMPORARY_VARIABLE val tmp0_elvis_lhs: kotlin.Any?
CALL '<get-p>(): Any?' type=kotlin.Any? origin=GET_PROPERTY CALL '<get-p>(): Any?' type=kotlin.Any? origin=GET_PROPERTY
WHEN type=kotlin.Any origin=null WHEN type=kotlin.Any origin=null
BRANCH
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'tmp0_elvis_lhs: Any?' type=kotlin.Any? origin=null arg0: GET_VAR 'tmp0_elvis_lhs: Any?' type=kotlin.Any? origin=null
arg1: CONST Null type=kotlin.Nothing? value='null' arg1: CONST Null type=kotlin.Nothing? value='null'
then: GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null then: GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
else: GET_VAR 'tmp0_elvis_lhs: Any?' type=kotlin.Any? origin=null BRANCH
if: CONST Boolean type=kotlin.Boolean value='true'
then: GET_VAR 'tmp0_elvis_lhs: Any?' type=kotlin.Any? origin=null
FUN public fun test5(x: kotlin.Any): kotlin.Any FUN public fun test5(x: kotlin.Any): kotlin.Any
BLOCK_BODY BLOCK_BODY
RETURN type=kotlin.Nothing from='test5(Any): Any' RETURN type=kotlin.Nothing from='test5(Any): Any'
@@ -78,8 +92,11 @@ FILE /elvis.kt
VAR IR_TEMPORARY_VARIABLE val tmp0_elvis_lhs: kotlin.Any? VAR IR_TEMPORARY_VARIABLE val tmp0_elvis_lhs: kotlin.Any?
CALL 'foo(): Any?' type=kotlin.Any? origin=null CALL 'foo(): Any?' type=kotlin.Any? origin=null
WHEN type=kotlin.Any origin=null WHEN type=kotlin.Any origin=null
BRANCH
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'tmp0_elvis_lhs: Any?' type=kotlin.Any? origin=null arg0: GET_VAR 'tmp0_elvis_lhs: Any?' type=kotlin.Any? origin=null
arg1: CONST Null type=kotlin.Nothing? value='null' arg1: CONST Null type=kotlin.Nothing? value='null'
then: GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null then: GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
else: GET_VAR 'tmp0_elvis_lhs: Any?' type=kotlin.Any? origin=null BRANCH
if: CONST Boolean type=kotlin.Boolean value='true'
then: GET_VAR 'tmp0_elvis_lhs: Any?' type=kotlin.Any? origin=null
+5 -1
View File
@@ -3,14 +3,18 @@ FILE /ifElseIf.kt
BLOCK_BODY BLOCK_BODY
RETURN type=kotlin.Nothing from='test(Int): Int' RETURN type=kotlin.Nothing from='test(Int): Int'
WHEN type=kotlin.Int origin=WHEN WHEN type=kotlin.Int origin=WHEN
BRANCH
if: CALL 'GT0(Int): Boolean' type=kotlin.Boolean origin=GT if: CALL 'GT0(Int): Boolean' type=kotlin.Boolean origin=GT
arg0: CALL 'compareTo(Int): Int' type=kotlin.Int origin=GT arg0: CALL 'compareTo(Int): Int' type=kotlin.Int origin=GT
$this: GET_VAR 'value-parameter i: Int' type=kotlin.Int origin=null $this: GET_VAR 'value-parameter i: Int' type=kotlin.Int origin=null
other: CONST Int type=kotlin.Int value='0' other: CONST Int type=kotlin.Int value='0'
then: CONST Int type=kotlin.Int value='1' then: CONST Int type=kotlin.Int value='1'
BRANCH
if: CALL 'LT0(Int): Boolean' type=kotlin.Boolean origin=LT if: CALL 'LT0(Int): Boolean' type=kotlin.Boolean origin=LT
arg0: CALL 'compareTo(Int): Int' type=kotlin.Int origin=LT arg0: CALL 'compareTo(Int): Int' type=kotlin.Int origin=LT
$this: GET_VAR 'value-parameter i: Int' type=kotlin.Int origin=null $this: GET_VAR 'value-parameter i: Int' type=kotlin.Int origin=null
other: CONST Int type=kotlin.Int value='0' other: CONST Int type=kotlin.Int value='0'
then: CONST Int type=kotlin.Int value='-1' then: CONST Int type=kotlin.Int value='-1'
else: CONST Int type=kotlin.Int value='0' BRANCH
if: CONST Boolean type=kotlin.Boolean value='true'
then: CONST Int type=kotlin.Int value='0'
@@ -29,7 +29,9 @@ FILE /jvmStaticFieldReference.kt
FIELD PROPERTY_BACKING_FIELD public final val test: kotlin.Int FIELD PROPERTY_BACKING_FIELD public final val test: kotlin.Int
EXPRESSION_BODY EXPRESSION_BODY
WHEN type=kotlin.Int origin=WHEN WHEN type=kotlin.Int origin=WHEN
else: BLOCK type=kotlin.Int origin=null BRANCH
if: CONST Boolean type=kotlin.Boolean value='true'
then: BLOCK type=kotlin.Int origin=null
CALL 'println(String!): Unit' type=kotlin.Unit origin=null CALL 'println(String!): Unit' type=kotlin.Unit origin=null
$this: TYPE_OP origin=IMPLICIT_NOTNULL typeOperand=java.io.PrintStream $this: TYPE_OP origin=IMPLICIT_NOTNULL typeOperand=java.io.PrintStream
GET_FIELD 'out: PrintStream!' type=java.io.PrintStream! origin=GET_PROPERTY GET_FIELD 'out: PrintStream!' type=java.io.PrintStream! origin=GET_PROPERTY
+4 -1
View File
@@ -24,11 +24,14 @@ FILE /safeAssignment.kt
VAR IR_TEMPORARY_VARIABLE val tmp0_safe_receiver: C? VAR IR_TEMPORARY_VARIABLE val tmp0_safe_receiver: C?
GET_VAR 'value-parameter nc: C?' type=C? origin=null GET_VAR 'value-parameter nc: C?' type=C? origin=null
WHEN type=kotlin.Unit origin=SAFE_CALL WHEN type=kotlin.Unit origin=SAFE_CALL
BRANCH
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'tmp0_safe_receiver: C?' type=C? origin=null arg0: GET_VAR 'tmp0_safe_receiver: C?' type=C? origin=null
arg1: CONST Null type=kotlin.Nothing? value='null' arg1: CONST Null type=kotlin.Nothing? value='null'
then: TYPE_OP origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit then: TYPE_OP origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
CONST Null type=kotlin.Nothing? value='null' CONST Null type=kotlin.Nothing? value='null'
else: CALL '<set-x>(Int): Unit' type=kotlin.Unit origin=EQ BRANCH
if: CONST Boolean type=kotlin.Boolean value='true'
then: CALL '<set-x>(Int): Unit' type=kotlin.Unit origin=EQ
$this: GET_VAR 'tmp0_safe_receiver: C?' type=C? origin=null $this: GET_VAR 'tmp0_safe_receiver: C?' type=C? origin=null
<set-?>: CONST Int type=kotlin.Int value='42' <set-?>: CONST Int type=kotlin.Int value='42'
@@ -18,11 +18,14 @@ FILE /safeCallWithIncrementDecrement.kt
VAR IR_TEMPORARY_VARIABLE val tmp0_safe_receiver: kotlin.Int? VAR IR_TEMPORARY_VARIABLE val tmp0_safe_receiver: kotlin.Int?
$RECEIVER of 'inc() on Int?: Int?' type=kotlin.Int? $RECEIVER of 'inc() on Int?: Int?' type=kotlin.Int?
WHEN type=kotlin.Int? origin=SAFE_CALL WHEN type=kotlin.Int? origin=SAFE_CALL
BRANCH
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'tmp0_safe_receiver: Int?' type=kotlin.Int? origin=null arg0: GET_VAR 'tmp0_safe_receiver: Int?' type=kotlin.Int? origin=null
arg1: CONST Null type=kotlin.Nothing? value='null' arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null' then: CONST Null type=kotlin.Nothing? value='null'
else: CALL 'inc(): Int' type=kotlin.Int origin=null BRANCH
if: CONST Boolean type=kotlin.Boolean value='true'
then: CALL 'inc(): Int' type=kotlin.Int origin=null
$this: GET_VAR 'tmp0_safe_receiver: Int?' type=kotlin.Int? origin=null $this: GET_VAR 'tmp0_safe_receiver: Int?' type=kotlin.Int? origin=null
FUN public operator fun kotlin.Int?.get(index: kotlin.Int): kotlin.Int FUN public operator fun kotlin.Int?.get(index: kotlin.Int): kotlin.Int
BLOCK_BODY BLOCK_BODY
@@ -36,12 +39,15 @@ FILE /safeCallWithIncrementDecrement.kt
VAR IR_TEMPORARY_VARIABLE val tmp0_safe_receiver: test.C? VAR IR_TEMPORARY_VARIABLE val tmp0_safe_receiver: test.C?
GET_VAR 'value-parameter nc: C?' type=test.C? origin=null GET_VAR 'value-parameter nc: C?' type=test.C? origin=null
WHEN type=kotlin.Unit origin=SAFE_CALL WHEN type=kotlin.Unit origin=SAFE_CALL
BRANCH
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'tmp0_safe_receiver: C?' type=test.C? origin=null arg0: GET_VAR 'tmp0_safe_receiver: C?' type=test.C? origin=null
arg1: CONST Null type=kotlin.Nothing? value='null' arg1: CONST Null type=kotlin.Nothing? value='null'
then: TYPE_OP origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit then: TYPE_OP origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
CONST Null type=kotlin.Nothing? value='null' CONST Null type=kotlin.Nothing? value='null'
else: TYPE_OP origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit BRANCH
if: CONST Boolean type=kotlin.Boolean value='true'
then: TYPE_OP origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
BLOCK type=kotlin.Int origin=POSTFIX_INCR BLOCK type=kotlin.Int origin=POSTFIX_INCR
VAR IR_TEMPORARY_VARIABLE val tmp1_this: test.C? VAR IR_TEMPORARY_VARIABLE val tmp1_this: test.C?
GET_VAR 'tmp0_safe_receiver: C?' type=test.C? origin=null GET_VAR 'tmp0_safe_receiver: C?' type=test.C? origin=null
@@ -63,11 +69,14 @@ FILE /safeCallWithIncrementDecrement.kt
VAR IR_TEMPORARY_VARIABLE val tmp0_safe_receiver: test.C? VAR IR_TEMPORARY_VARIABLE val tmp0_safe_receiver: test.C?
GET_VAR 'value-parameter nc: C?' type=test.C? origin=null GET_VAR 'value-parameter nc: C?' type=test.C? origin=null
WHEN type=kotlin.Int? origin=SAFE_CALL WHEN type=kotlin.Int? origin=SAFE_CALL
BRANCH
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'tmp0_safe_receiver: C?' type=test.C? origin=null arg0: GET_VAR 'tmp0_safe_receiver: C?' type=test.C? origin=null
arg1: CONST Null type=kotlin.Nothing? value='null' arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null' then: CONST Null type=kotlin.Nothing? value='null'
else: CALL '<get-p>() on C?: Int' type=kotlin.Int origin=GET_PROPERTY BRANCH
if: CONST Boolean type=kotlin.Boolean value='true'
then: CALL '<get-p>() on C?: Int' type=kotlin.Int origin=GET_PROPERTY
$this: GET_VAR 'tmp0_safe_receiver: C?' type=test.C? origin=null $this: GET_VAR 'tmp0_safe_receiver: C?' type=test.C? origin=null
VAR IR_TEMPORARY_VARIABLE val tmp4_index0: kotlin.Int VAR IR_TEMPORARY_VARIABLE val tmp4_index0: kotlin.Int
CONST Int type=kotlin.Int value='0' CONST Int type=kotlin.Int value='0'
+20 -5
View File
@@ -31,11 +31,14 @@ FILE /safeCalls.kt
VAR IR_TEMPORARY_VARIABLE val tmp0_safe_receiver: kotlin.String? VAR IR_TEMPORARY_VARIABLE val tmp0_safe_receiver: kotlin.String?
GET_VAR 'value-parameter x: String?' type=kotlin.String? origin=null GET_VAR 'value-parameter x: String?' type=kotlin.String? origin=null
WHEN type=kotlin.Int? origin=SAFE_CALL WHEN type=kotlin.Int? origin=SAFE_CALL
BRANCH
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null arg0: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null
arg1: CONST Null type=kotlin.Nothing? value='null' arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null' then: CONST Null type=kotlin.Nothing? value='null'
else: CALL '<get-length>(): Int' type=kotlin.Int origin=GET_PROPERTY BRANCH
if: CONST Boolean type=kotlin.Boolean value='true'
then: CALL '<get-length>(): Int' type=kotlin.Int origin=GET_PROPERTY
$this: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null $this: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null
FUN public fun test2(x: kotlin.String?): kotlin.Int? FUN public fun test2(x: kotlin.String?): kotlin.Int?
BLOCK_BODY BLOCK_BODY
@@ -44,11 +47,14 @@ FILE /safeCalls.kt
VAR IR_TEMPORARY_VARIABLE val tmp0_safe_receiver: kotlin.String? VAR IR_TEMPORARY_VARIABLE val tmp0_safe_receiver: kotlin.String?
GET_VAR 'value-parameter x: String?' type=kotlin.String? origin=null GET_VAR 'value-parameter x: String?' type=kotlin.String? origin=null
WHEN type=kotlin.Int? origin=SAFE_CALL WHEN type=kotlin.Int? origin=SAFE_CALL
BRANCH
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null arg0: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null
arg1: CONST Null type=kotlin.Nothing? value='null' arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null' then: CONST Null type=kotlin.Nothing? value='null'
else: CALL 'hashCode(): Int' type=kotlin.Int origin=null BRANCH
if: CONST Boolean type=kotlin.Boolean value='true'
then: CALL 'hashCode(): Int' type=kotlin.Int origin=null
$this: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null $this: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null
FUN public fun test3(x: kotlin.String?, y: kotlin.Any?): kotlin.Boolean? FUN public fun test3(x: kotlin.String?, y: kotlin.Any?): kotlin.Boolean?
BLOCK_BODY BLOCK_BODY
@@ -57,11 +63,14 @@ FILE /safeCalls.kt
VAR IR_TEMPORARY_VARIABLE val tmp0_safe_receiver: kotlin.String? VAR IR_TEMPORARY_VARIABLE val tmp0_safe_receiver: kotlin.String?
GET_VAR 'value-parameter x: String?' type=kotlin.String? origin=null GET_VAR 'value-parameter x: String?' type=kotlin.String? origin=null
WHEN type=kotlin.Boolean? origin=SAFE_CALL WHEN type=kotlin.Boolean? origin=SAFE_CALL
BRANCH
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null arg0: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null
arg1: CONST Null type=kotlin.Nothing? value='null' arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null' then: CONST Null type=kotlin.Nothing? value='null'
else: CALL 'equals(Any?): Boolean' type=kotlin.Boolean origin=null BRANCH
if: CONST Boolean type=kotlin.Boolean value='true'
then: CALL 'equals(Any?): Boolean' type=kotlin.Boolean origin=null
$this: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null $this: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null
other: GET_VAR 'value-parameter y: Any?' type=kotlin.Any? origin=null other: GET_VAR 'value-parameter y: Any?' type=kotlin.Any? origin=null
FUN public fun test4(x: Ref?): kotlin.Unit FUN public fun test4(x: Ref?): kotlin.Unit
@@ -70,12 +79,15 @@ FILE /safeCalls.kt
VAR IR_TEMPORARY_VARIABLE val tmp0_safe_receiver: Ref? VAR IR_TEMPORARY_VARIABLE val tmp0_safe_receiver: Ref?
GET_VAR 'value-parameter x: Ref?' type=Ref? origin=null GET_VAR 'value-parameter x: Ref?' type=Ref? origin=null
WHEN type=kotlin.Unit origin=SAFE_CALL WHEN type=kotlin.Unit origin=SAFE_CALL
BRANCH
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'tmp0_safe_receiver: Ref?' type=Ref? origin=null arg0: GET_VAR 'tmp0_safe_receiver: Ref?' type=Ref? origin=null
arg1: CONST Null type=kotlin.Nothing? value='null' arg1: CONST Null type=kotlin.Nothing? value='null'
then: TYPE_OP origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit then: TYPE_OP origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
CONST Null type=kotlin.Nothing? value='null' CONST Null type=kotlin.Nothing? value='null'
else: CALL '<set-value>(Int): Unit' type=kotlin.Unit origin=EQ BRANCH
if: CONST Boolean type=kotlin.Boolean value='true'
then: CALL '<set-value>(Int): Unit' type=kotlin.Unit origin=EQ
$this: GET_VAR 'tmp0_safe_receiver: Ref?' type=Ref? origin=null $this: GET_VAR 'tmp0_safe_receiver: Ref?' type=Ref? origin=null
<set-?>: CONST Int type=kotlin.Int value='0' <set-?>: CONST Int type=kotlin.Int value='0'
FUN public fun IHost.test5(s: kotlin.String?): kotlin.Int? FUN public fun IHost.test5(s: kotlin.String?): kotlin.Int?
@@ -85,10 +97,13 @@ FILE /safeCalls.kt
VAR IR_TEMPORARY_VARIABLE val tmp0_safe_receiver: kotlin.String? VAR IR_TEMPORARY_VARIABLE val tmp0_safe_receiver: kotlin.String?
GET_VAR 'value-parameter s: String?' type=kotlin.String? origin=null GET_VAR 'value-parameter s: String?' type=kotlin.String? origin=null
WHEN type=kotlin.Int? origin=SAFE_CALL WHEN type=kotlin.Int? origin=SAFE_CALL
BRANCH
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null arg0: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null
arg1: CONST Null type=kotlin.Nothing? value='null' arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null' then: CONST Null type=kotlin.Nothing? value='null'
else: CALL 'extLength() on String: Int' type=kotlin.Int origin=null BRANCH
if: CONST Boolean type=kotlin.Boolean value='true'
then: CALL 'extLength() on String: Int' type=kotlin.Int origin=null
$this: $RECEIVER of 'test5(String?) on IHost: Int?' type=IHost $this: $RECEIVER of 'test5(String?) on IHost: Int?' type=IHost
$receiver: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null $receiver: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null
@@ -6,7 +6,8 @@ FILE /Derived.kt
INSTANCE_INITIALIZER_CALL classDescriptor='Derived' INSTANCE_INITIALIZER_CALL classDescriptor='Derived'
FUN public final fun setValue(v: kotlin.Any): kotlin.Unit FUN public final fun setValue(v: kotlin.Any): kotlin.Unit
BLOCK_BODY BLOCK_BODY
WHEN type=kotlin.Unit origin=IF WHEN type=kotlin.Unit origin=null
BRANCH
if: TYPE_OP origin=INSTANCEOF typeOperand=kotlin.String if: TYPE_OP origin=INSTANCEOF typeOperand=kotlin.String
GET_VAR 'value-parameter v: Any' type=kotlin.Any origin=null GET_VAR 'value-parameter v: Any' type=kotlin.Any origin=null
then: BLOCK type=kotlin.Unit origin=null then: BLOCK type=kotlin.Unit origin=null
+6 -3
View File
@@ -13,7 +13,8 @@ FILE /smartCasts.kt
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
FUN public fun test1(x: kotlin.Any): kotlin.Unit FUN public fun test1(x: kotlin.Any): kotlin.Unit
BLOCK_BODY BLOCK_BODY
WHEN type=kotlin.Unit origin=IF WHEN type=kotlin.Unit origin=null
BRANCH
if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=kotlin.String if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=kotlin.String
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
then: RETURN type=kotlin.Nothing from='test1(Any): Unit' then: RETURN type=kotlin.Nothing from='test1(Any): Unit'
@@ -34,7 +35,8 @@ FILE /smartCasts.kt
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
FUN public fun test2(x: kotlin.Any): kotlin.String FUN public fun test2(x: kotlin.Any): kotlin.String
BLOCK_BODY BLOCK_BODY
WHEN type=kotlin.Unit origin=IF WHEN type=kotlin.Unit origin=null
BRANCH
if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=kotlin.String if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=kotlin.String
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
then: RETURN type=kotlin.Nothing from='test2(Any): String' then: RETURN type=kotlin.Nothing from='test2(Any): String'
@@ -45,7 +47,8 @@ FILE /smartCasts.kt
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
FUN public fun test3(x: kotlin.Any): kotlin.String FUN public fun test3(x: kotlin.Any): kotlin.String
BLOCK_BODY BLOCK_BODY
WHEN type=kotlin.Unit origin=IF WHEN type=kotlin.Unit origin=null
BRANCH
if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=kotlin.String if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=kotlin.String
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
then: RETURN type=kotlin.Nothing from='test3(Any): String' then: RETURN type=kotlin.Nothing from='test3(Any): String'
@@ -11,7 +11,8 @@ FILE /smartCastsWithDestructuring.kt
CONST String type=kotlin.String value='' CONST String type=kotlin.String value=''
FUN public fun test(x: I1): kotlin.Unit FUN public fun test(x: I1): kotlin.Unit
BLOCK_BODY BLOCK_BODY
WHEN type=kotlin.Unit origin=IF WHEN type=kotlin.Unit origin=null
BRANCH
if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=I2 if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=I2
GET_VAR 'value-parameter x: I1' type=I1 origin=null GET_VAR 'value-parameter x: I1' type=I1 origin=null
then: RETURN type=kotlin.Nothing from='test(I1): Unit' then: RETURN type=kotlin.Nothing from='test(I1): Unit'
+2 -1
View File
@@ -5,7 +5,8 @@ FILE /throw.kt
CALL 'constructor Throwable()' type=kotlin.Throwable origin=null CALL 'constructor Throwable()' type=kotlin.Throwable origin=null
FUN public fun testImplicitCast(a: kotlin.Any): kotlin.Unit FUN public fun testImplicitCast(a: kotlin.Any): kotlin.Unit
BLOCK_BODY BLOCK_BODY
WHEN type=kotlin.Unit origin=IF WHEN type=kotlin.Unit origin=null
BRANCH
if: TYPE_OP origin=INSTANCEOF typeOperand=kotlin.Throwable if: TYPE_OP origin=INSTANCEOF typeOperand=kotlin.Throwable
GET_VAR 'value-parameter a: Any' type=kotlin.Any origin=null GET_VAR 'value-parameter a: Any' type=kotlin.Any origin=null
then: BLOCK type=kotlin.Nothing origin=null then: BLOCK type=kotlin.Nothing origin=null
@@ -1,7 +1,8 @@
FILE /tryCatchWithImplicitCast.kt FILE /tryCatchWithImplicitCast.kt
FUN public fun testImplicitCast(a: kotlin.Any): kotlin.Unit FUN public fun testImplicitCast(a: kotlin.Any): kotlin.Unit
BLOCK_BODY BLOCK_BODY
WHEN type=kotlin.Unit origin=IF WHEN type=kotlin.Unit origin=null
BRANCH
if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=kotlin.String if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=kotlin.String
GET_VAR 'value-parameter a: Any' type=kotlin.Any origin=null GET_VAR 'value-parameter a: Any' type=kotlin.Any origin=null
then: RETURN type=kotlin.Nothing from='testImplicitCast(Any): Unit' then: RETURN type=kotlin.Nothing from='testImplicitCast(Any): Unit'
+4 -1
View File
@@ -3,10 +3,13 @@ FILE /typeArguments.kt
BLOCK_BODY BLOCK_BODY
RETURN type=kotlin.Nothing from='test1(Any): Boolean' RETURN type=kotlin.Nothing from='test1(Any): Boolean'
WHEN type=kotlin.Boolean origin=ANDAND WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP origin=INSTANCEOF typeOperand=kotlin.Array<*> if: TYPE_OP origin=INSTANCEOF typeOperand=kotlin.Array<*>
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
then: CALL 'isArrayOf() on Array<*>: Boolean' type=kotlin.Boolean origin=null then: CALL 'isArrayOf() on Array<*>: Boolean' type=kotlin.Boolean origin=null
<reified T : Any>: String <reified T : Any>: String
$receiver: TYPE_OP origin=IMPLICIT_CAST typeOperand=kotlin.Array<*> $receiver: TYPE_OP origin=IMPLICIT_CAST typeOperand=kotlin.Array<*>
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
else: CONST Boolean type=kotlin.Boolean value='false' BRANCH
if: CONST Boolean type=kotlin.Boolean value='true'
then: CONST Boolean type=kotlin.Boolean value='false'
@@ -1,7 +1,8 @@
FILE /varargWithImplicitCast.kt FILE /varargWithImplicitCast.kt
FUN public fun testScalar(a: kotlin.Any): kotlin.IntArray FUN public fun testScalar(a: kotlin.Any): kotlin.IntArray
BLOCK_BODY BLOCK_BODY
WHEN type=kotlin.Unit origin=IF WHEN type=kotlin.Unit origin=null
BRANCH
if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=kotlin.Int if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=kotlin.Int
GET_VAR 'value-parameter a: Any' type=kotlin.Any origin=null GET_VAR 'value-parameter a: Any' type=kotlin.Any origin=null
then: RETURN type=kotlin.Nothing from='testScalar(Any): IntArray' then: RETURN type=kotlin.Nothing from='testScalar(Any): IntArray'
@@ -13,7 +14,8 @@ FILE /varargWithImplicitCast.kt
GET_VAR 'value-parameter a: Any' type=kotlin.Any origin=null GET_VAR 'value-parameter a: Any' type=kotlin.Any origin=null
FUN public fun testSpread(a: kotlin.Any): kotlin.IntArray FUN public fun testSpread(a: kotlin.Any): kotlin.IntArray
BLOCK_BODY BLOCK_BODY
WHEN type=kotlin.Unit origin=IF WHEN type=kotlin.Unit origin=null
BRANCH
if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=kotlin.IntArray if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=kotlin.IntArray
GET_VAR 'value-parameter a: Any' type=kotlin.Any origin=null GET_VAR 'value-parameter a: Any' type=kotlin.Any origin=null
then: RETURN type=kotlin.Nothing from='testSpread(Any): IntArray' then: RETURN type=kotlin.Nothing from='testSpread(Any): IntArray'
@@ -34,16 +34,22 @@ FILE /variableAsFunctionCall.kt
VAR IR_TEMPORARY_VARIABLE val tmp0_safe_receiver: kotlin.String? VAR IR_TEMPORARY_VARIABLE val tmp0_safe_receiver: kotlin.String?
GET_VAR 'value-parameter ns: String?' type=kotlin.String? origin=null GET_VAR 'value-parameter ns: String?' type=kotlin.String? origin=null
WHEN type=(() -> kotlin.String)? origin=SAFE_CALL WHEN type=(() -> kotlin.String)? origin=SAFE_CALL
BRANCH
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null arg0: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null
arg1: CONST Null type=kotlin.Nothing? value='null' arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null' then: CONST Null type=kotlin.Nothing? value='null'
else: CALL 'k() on String: () -> String' type=() -> kotlin.String origin=null BRANCH
if: CONST Boolean type=kotlin.Boolean value='true'
then: CALL 'k() on String: () -> String' type=() -> kotlin.String origin=null
$this: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null $this: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null
WHEN type=kotlin.String? origin=SAFE_CALL WHEN type=kotlin.String? origin=SAFE_CALL
BRANCH
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'tmp1_safe_receiver: (() -> String)?' type=(() -> kotlin.String)? origin=null arg0: GET_VAR 'tmp1_safe_receiver: (() -> String)?' type=(() -> kotlin.String)? origin=null
arg1: CONST Null type=kotlin.Nothing? value='null' arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null' then: CONST Null type=kotlin.Nothing? value='null'
else: CALL 'invoke(): String' type=kotlin.String origin=null BRANCH
if: CONST Boolean type=kotlin.Boolean value='true'
then: CALL 'invoke(): String' type=kotlin.String origin=null
$this: GET_VAR 'tmp1_safe_receiver: (() -> String)?' type=(() -> kotlin.String)? origin=null $this: GET_VAR 'tmp1_safe_receiver: (() -> String)?' type=(() -> kotlin.String)? origin=null
+44 -9
View File
@@ -11,46 +11,58 @@ FILE /when.kt
VAR IR_TEMPORARY_VARIABLE val tmp0_subject: kotlin.Any? VAR IR_TEMPORARY_VARIABLE val tmp0_subject: kotlin.Any?
GET_VAR 'value-parameter x: Any?' type=kotlin.Any? origin=null GET_VAR 'value-parameter x: Any?' type=kotlin.Any? origin=null
WHEN type=kotlin.String origin=WHEN WHEN type=kotlin.String origin=WHEN
BRANCH
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'tmp0_subject: Any?' type=kotlin.Any? origin=null arg0: GET_VAR 'tmp0_subject: Any?' type=kotlin.Any? origin=null
arg1: CONST Null type=kotlin.Nothing? value='null' arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST String type=kotlin.String value='null' then: CONST String type=kotlin.String value='null'
BRANCH
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'tmp0_subject: Any?' type=kotlin.Any? origin=null arg0: GET_VAR 'tmp0_subject: Any?' type=kotlin.Any? origin=null
arg1: GET_OBJECT 'A' type=A arg1: GET_OBJECT 'A' type=A
then: CONST String type=kotlin.String value='A' then: CONST String type=kotlin.String value='A'
BRANCH
if: TYPE_OP origin=INSTANCEOF typeOperand=kotlin.String if: TYPE_OP origin=INSTANCEOF typeOperand=kotlin.String
GET_VAR 'tmp0_subject: Any?' type=kotlin.Any? origin=null GET_VAR 'tmp0_subject: Any?' type=kotlin.Any? origin=null
then: CONST String type=kotlin.String value='String' then: CONST String type=kotlin.String value='String'
BRANCH
if: CALL 'contains(Any) on Iterable<Any>: Boolean' type=kotlin.Boolean origin=IN if: CALL 'contains(Any) on Iterable<Any>: Boolean' type=kotlin.Boolean origin=IN
<T>: Any <T>: Any
$receiver: CALL 'setOf(): Set<Nothing>' type=kotlin.collections.Set<kotlin.Nothing> origin=null $receiver: CALL 'setOf(): Set<Nothing>' type=kotlin.collections.Set<kotlin.Nothing> origin=null
<T>: Nothing <T>: Nothing
element: GET_VAR 'tmp0_subject: Any?' type=kotlin.Any? origin=null element: GET_VAR 'tmp0_subject: Any?' type=kotlin.Any? origin=null
then: CONST String type=kotlin.String value='nothingness?' then: CONST String type=kotlin.String value='nothingness?'
else: CONST String type=kotlin.String value='something' BRANCH
if: CONST Boolean type=kotlin.Boolean value='true'
then: CONST String type=kotlin.String value='something'
FUN public fun test(x: kotlin.Any?): kotlin.String FUN public fun test(x: kotlin.Any?): kotlin.String
BLOCK_BODY BLOCK_BODY
RETURN type=kotlin.Nothing from='test(Any?): String' RETURN type=kotlin.Nothing from='test(Any?): String'
WHEN type=kotlin.String origin=WHEN WHEN type=kotlin.String origin=WHEN
BRANCH
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'value-parameter x: Any?' type=kotlin.Any? origin=null arg0: GET_VAR 'value-parameter x: Any?' type=kotlin.Any? origin=null
arg1: CONST Null type=kotlin.Nothing? value='null' arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST String type=kotlin.String value='null' then: CONST String type=kotlin.String value='null'
BRANCH
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'value-parameter x: Any?' type=kotlin.Any? origin=null arg0: GET_VAR 'value-parameter x: Any?' type=kotlin.Any? origin=null
arg1: GET_OBJECT 'A' type=A arg1: GET_OBJECT 'A' type=A
then: CONST String type=kotlin.String value='A' then: CONST String type=kotlin.String value='A'
BRANCH
if: TYPE_OP origin=INSTANCEOF typeOperand=kotlin.String if: TYPE_OP origin=INSTANCEOF typeOperand=kotlin.String
GET_VAR 'value-parameter x: Any?' type=kotlin.Any? origin=null GET_VAR 'value-parameter x: Any?' type=kotlin.Any? origin=null
then: CONST String type=kotlin.String value='String' then: CONST String type=kotlin.String value='String'
BRANCH
if: CALL 'contains(Any) on Iterable<Any>: Boolean' type=kotlin.Boolean origin=IN if: CALL 'contains(Any) on Iterable<Any>: Boolean' type=kotlin.Boolean origin=IN
<T>: Any <T>: Any
$receiver: CALL 'setOf(): Set<Nothing>' type=kotlin.collections.Set<kotlin.Nothing> origin=null $receiver: CALL 'setOf(): Set<Nothing>' type=kotlin.collections.Set<kotlin.Nothing> origin=null
<T>: Nothing <T>: Nothing
element: GET_VAR 'value-parameter x: Any?' type=kotlin.Any? origin=null element: GET_VAR 'value-parameter x: Any?' type=kotlin.Any? origin=null
then: CONST String type=kotlin.String value='nothingness?' then: CONST String type=kotlin.String value='nothingness?'
else: CONST String type=kotlin.String value='something' BRANCH
if: CONST Boolean type=kotlin.Boolean value='true'
then: CONST String type=kotlin.String value='something'
FUN public fun testComma(x: kotlin.Int): kotlin.String FUN public fun testComma(x: kotlin.Int): kotlin.String
BLOCK_BODY BLOCK_BODY
RETURN type=kotlin.Nothing from='testComma(Int): String' RETURN type=kotlin.Nothing from='testComma(Int): String'
@@ -58,46 +70,69 @@ FILE /when.kt
VAR IR_TEMPORARY_VARIABLE val tmp0_subject: kotlin.Int VAR IR_TEMPORARY_VARIABLE val tmp0_subject: kotlin.Int
GET_VAR 'value-parameter x: Int' type=kotlin.Int origin=null GET_VAR 'value-parameter x: Int' type=kotlin.Int origin=null
WHEN type=kotlin.String origin=WHEN WHEN type=kotlin.String origin=WHEN
BRANCH
if: WHEN type=kotlin.Boolean origin=WHEN_COMMA if: WHEN type=kotlin.Boolean origin=WHEN_COMMA
BRANCH
if: WHEN type=kotlin.Boolean origin=WHEN_COMMA if: WHEN type=kotlin.Boolean origin=WHEN_COMMA
BRANCH
if: WHEN type=kotlin.Boolean origin=WHEN_COMMA if: WHEN type=kotlin.Boolean origin=WHEN_COMMA
BRANCH
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'tmp0_subject: Int' type=kotlin.Int origin=null arg0: GET_VAR 'tmp0_subject: Int' type=kotlin.Int origin=null
arg1: CONST Int type=kotlin.Int value='1' arg1: CONST Int type=kotlin.Int value='1'
then: CONST Boolean type=kotlin.Boolean value='true' then: CONST Boolean type=kotlin.Boolean value='true'
else: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ BRANCH
if: CONST Boolean type=kotlin.Boolean value='true'
then: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'tmp0_subject: Int' type=kotlin.Int origin=null arg0: GET_VAR 'tmp0_subject: Int' type=kotlin.Int origin=null
arg1: CONST Int type=kotlin.Int value='2' arg1: CONST Int type=kotlin.Int value='2'
then: CONST Boolean type=kotlin.Boolean value='true' then: CONST Boolean type=kotlin.Boolean value='true'
else: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ BRANCH
if: CONST Boolean type=kotlin.Boolean value='true'
then: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'tmp0_subject: Int' type=kotlin.Int origin=null arg0: GET_VAR 'tmp0_subject: Int' type=kotlin.Int origin=null
arg1: CONST Int type=kotlin.Int value='3' arg1: CONST Int type=kotlin.Int value='3'
then: CONST Boolean type=kotlin.Boolean value='true' then: CONST Boolean type=kotlin.Boolean value='true'
else: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ BRANCH
if: CONST Boolean type=kotlin.Boolean value='true'
then: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'tmp0_subject: Int' type=kotlin.Int origin=null arg0: GET_VAR 'tmp0_subject: Int' type=kotlin.Int origin=null
arg1: CONST Int type=kotlin.Int value='4' arg1: CONST Int type=kotlin.Int value='4'
then: CONST String type=kotlin.String value='1234' then: CONST String type=kotlin.String value='1234'
BRANCH
if: WHEN type=kotlin.Boolean origin=WHEN_COMMA if: WHEN type=kotlin.Boolean origin=WHEN_COMMA
BRANCH
if: WHEN type=kotlin.Boolean origin=WHEN_COMMA if: WHEN type=kotlin.Boolean origin=WHEN_COMMA
BRANCH
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'tmp0_subject: Int' type=kotlin.Int origin=null arg0: GET_VAR 'tmp0_subject: Int' type=kotlin.Int origin=null
arg1: CONST Int type=kotlin.Int value='5' arg1: CONST Int type=kotlin.Int value='5'
then: CONST Boolean type=kotlin.Boolean value='true' then: CONST Boolean type=kotlin.Boolean value='true'
else: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ BRANCH
if: CONST Boolean type=kotlin.Boolean value='true'
then: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'tmp0_subject: Int' type=kotlin.Int origin=null arg0: GET_VAR 'tmp0_subject: Int' type=kotlin.Int origin=null
arg1: CONST Int type=kotlin.Int value='6' arg1: CONST Int type=kotlin.Int value='6'
then: CONST Boolean type=kotlin.Boolean value='true' then: CONST Boolean type=kotlin.Boolean value='true'
else: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ BRANCH
if: CONST Boolean type=kotlin.Boolean value='true'
then: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'tmp0_subject: Int' type=kotlin.Int origin=null arg0: GET_VAR 'tmp0_subject: Int' type=kotlin.Int origin=null
arg1: CONST Int type=kotlin.Int value='7' arg1: CONST Int type=kotlin.Int value='7'
then: CONST String type=kotlin.String value='567' then: CONST String type=kotlin.String value='567'
BRANCH
if: WHEN type=kotlin.Boolean origin=WHEN_COMMA if: WHEN type=kotlin.Boolean origin=WHEN_COMMA
BRANCH
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'tmp0_subject: Int' type=kotlin.Int origin=null arg0: GET_VAR 'tmp0_subject: Int' type=kotlin.Int origin=null
arg1: CONST Int type=kotlin.Int value='8' arg1: CONST Int type=kotlin.Int value='8'
then: CONST Boolean type=kotlin.Boolean value='true' then: CONST Boolean type=kotlin.Boolean value='true'
else: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ BRANCH
if: CONST Boolean type=kotlin.Boolean value='true'
then: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'tmp0_subject: Int' type=kotlin.Int origin=null arg0: GET_VAR 'tmp0_subject: Int' type=kotlin.Int origin=null
arg1: CONST Int type=kotlin.Int value='9' arg1: CONST Int type=kotlin.Int value='9'
then: CONST String type=kotlin.String value='89' then: CONST String type=kotlin.String value='89'
else: CONST String type=kotlin.String value='?' BRANCH
if: CONST Boolean type=kotlin.Boolean value='true'
then: CONST String type=kotlin.String value='?'
+3 -1
View File
@@ -3,4 +3,6 @@ FILE /whenElse.kt
BLOCK_BODY BLOCK_BODY
RETURN type=kotlin.Nothing from='test(): Int' RETURN type=kotlin.Nothing from='test(): Int'
WHEN type=kotlin.Int origin=WHEN WHEN type=kotlin.Int origin=WHEN
else: CONST Int type=kotlin.Int value='42' BRANCH
if: CONST Boolean type=kotlin.Boolean value='true'
then: CONST Int type=kotlin.Int value='42'
+2 -1
View File
@@ -71,7 +71,8 @@ FILE /whileDoWhile.kt
BLOCK_BODY BLOCK_BODY
VAR val a: kotlin.Any? = null VAR val a: kotlin.Any? = null
CONST Null type=kotlin.Nothing? value='null' CONST Null type=kotlin.Nothing? value='null'
WHEN type=kotlin.Unit origin=IF WHEN type=kotlin.Unit origin=null
BRANCH
if: TYPE_OP origin=INSTANCEOF typeOperand=kotlin.Boolean if: TYPE_OP origin=INSTANCEOF typeOperand=kotlin.Boolean
GET_VAR 'a: Any?' type=kotlin.Any? origin=null GET_VAR 'a: Any?' type=kotlin.Any? origin=null
then: BLOCK type=kotlin.Unit origin=null then: BLOCK type=kotlin.Unit origin=null
+4 -2
View File
@@ -34,7 +34,8 @@ FILE /nonLocalReturn.kt
action: BLOCK type=(kotlin.Int) -> kotlin.Unit origin=LAMBDA action: BLOCK type=(kotlin.Int) -> kotlin.Unit origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA local final fun <anonymous>(it: kotlin.Int): kotlin.Unit FUN LOCAL_FUNCTION_FOR_LAMBDA local final fun <anonymous>(it: kotlin.Int): kotlin.Unit
BLOCK_BODY BLOCK_BODY
WHEN type=kotlin.Unit origin=IF WHEN type=kotlin.Unit origin=null
BRANCH
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'value-parameter it: Int' type=kotlin.Int origin=null arg0: GET_VAR 'value-parameter it: Int' type=kotlin.Int origin=null
arg1: CONST Int type=kotlin.Int value='0' arg1: CONST Int type=kotlin.Int value='0'
@@ -51,7 +52,8 @@ FILE /nonLocalReturn.kt
action: BLOCK type=(kotlin.Int) -> kotlin.Unit origin=LAMBDA action: BLOCK type=(kotlin.Int) -> kotlin.Unit origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA local final fun <anonymous>(it: kotlin.Int): kotlin.Unit FUN LOCAL_FUNCTION_FOR_LAMBDA local final fun <anonymous>(it: kotlin.Int): kotlin.Unit
BLOCK_BODY BLOCK_BODY
WHEN type=kotlin.Unit origin=IF WHEN type=kotlin.Unit origin=null
BRANCH
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'value-parameter it: Int' type=kotlin.Int origin=null arg0: GET_VAR 'value-parameter it: Int' type=kotlin.Int origin=null
arg1: CONST Int type=kotlin.Int value='0' arg1: CONST Int type=kotlin.Int value='0'
+2 -1
View File
@@ -14,7 +14,8 @@ FILE /coercionInLoop.kt
$this: GET_VAR 'x: DoubleIterator' type=kotlin.collections.DoubleIterator origin=null $this: GET_VAR 'x: DoubleIterator' type=kotlin.collections.DoubleIterator origin=null
body: TYPE_OP origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit body: TYPE_OP origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
BLOCK type=kotlin.Int origin=null BLOCK type=kotlin.Int origin=null
WHEN type=kotlin.Unit origin=IF WHEN type=kotlin.Unit origin=null
BRANCH
if: CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ if: CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EXCLEQ arg0: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: CALL 'get(Int): Double' type=kotlin.Double origin=GET_ARRAY_ELEMENT arg0: CALL 'get(Int): Double' type=kotlin.Double origin=GET_ARRAY_ELEMENT