Refactor IrWhen.
This commit is contained in:
@@ -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)
|
||||||
}
|
}
|
||||||
|
|||||||
+29
-17
@@ -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)
|
private fun createIrWhen(
|
||||||
|
ktIf: KtIfExpression,
|
||||||
|
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)
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
val irWhen = IrWhenImpl(expression.startOffset, expression.endOffset, resultType, IrStatementOrigin.WHEN)
|
val irWhen = IrWhenImpl(ktIf.startOffset, ktIf.endOffset, resultType, IrStatementOrigin.WHEN)
|
||||||
for ((irCondition, irThenBranch) in irBranches) {
|
|
||||||
irWhen.addBranch(irCondition, irThenBranch)
|
irWhen.branches.addAll(irBranches)
|
||||||
}
|
|
||||||
irWhen.elseBranch = irElseBranch
|
irElseResult?.let {
|
||||||
irWhen
|
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
|
||||||
|
|||||||
+3
-8
@@ -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)
|
||||||
|
}
|
||||||
|
|||||||
+10
-55
@@ -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)
|
||||||
|
|
||||||
|
|||||||
+38
-33
@@ -99,45 +99,50 @@ 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
|
||||||
if: CALL 'EQEQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQEQ
|
BRANCH
|
||||||
arg0: THIS of 'Test1' type=Test1
|
if: CALL 'EQEQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQEQ
|
||||||
arg1: GET_VAR 'value-parameter other: Any?' type=kotlin.Any? origin=null
|
arg0: THIS of 'Test1' type=Test1
|
||||||
then: RETURN type=kotlin.Nothing from='equals(Any?): Boolean'
|
arg1: GET_VAR 'value-parameter other: Any?' type=kotlin.Any? origin=null
|
||||||
CONST Boolean type=kotlin.Boolean value='true'
|
then: RETURN type=kotlin.Nothing from='equals(Any?): Boolean'
|
||||||
|
CONST Boolean type=kotlin.Boolean value='true'
|
||||||
WHEN type=kotlin.Unit origin=null
|
WHEN type=kotlin.Unit origin=null
|
||||||
if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=Test1
|
BRANCH
|
||||||
GET_VAR 'value-parameter other: Any?' type=kotlin.Any? origin=null
|
if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=Test1
|
||||||
then: RETURN type=kotlin.Nothing from='equals(Any?): Boolean'
|
GET_VAR 'value-parameter other: Any?' type=kotlin.Any? origin=null
|
||||||
CONST Boolean type=kotlin.Boolean value='false'
|
then: RETURN type=kotlin.Nothing from='equals(Any?): Boolean'
|
||||||
|
CONST Boolean type=kotlin.Boolean value='false'
|
||||||
VAR IR_TEMPORARY_VARIABLE val tmp0_other_with_cast: Test1
|
VAR IR_TEMPORARY_VARIABLE val tmp0_other_with_cast: Test1
|
||||||
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
|
||||||
if: CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ
|
BRANCH
|
||||||
arg0: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EXCLEQ
|
if: CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ
|
||||||
arg0: CALL '<get-x>(): Int' type=kotlin.Int origin=GET_PROPERTY
|
arg0: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EXCLEQ
|
||||||
$this: THIS of 'Test1' type=Test1
|
arg0: CALL '<get-x>(): Int' type=kotlin.Int origin=GET_PROPERTY
|
||||||
arg1: CALL '<get-x>(): Int' type=kotlin.Int origin=GET_PROPERTY
|
$this: THIS of 'Test1' type=Test1
|
||||||
$this: GET_VAR 'tmp0_other_with_cast: Test1' type=Test1 origin=null
|
arg1: CALL '<get-x>(): Int' type=kotlin.Int origin=GET_PROPERTY
|
||||||
then: RETURN type=kotlin.Nothing from='equals(Any?): Boolean'
|
$this: GET_VAR 'tmp0_other_with_cast: Test1' type=Test1 origin=null
|
||||||
CONST Boolean type=kotlin.Boolean value='false'
|
then: RETURN type=kotlin.Nothing from='equals(Any?): Boolean'
|
||||||
|
CONST Boolean type=kotlin.Boolean value='false'
|
||||||
WHEN type=kotlin.Unit origin=null
|
WHEN type=kotlin.Unit origin=null
|
||||||
if: CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ
|
BRANCH
|
||||||
arg0: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EXCLEQ
|
if: CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ
|
||||||
arg0: CALL '<get-y>(): String' type=kotlin.String origin=GET_PROPERTY
|
arg0: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EXCLEQ
|
||||||
$this: THIS of 'Test1' type=Test1
|
arg0: CALL '<get-y>(): String' type=kotlin.String origin=GET_PROPERTY
|
||||||
arg1: CALL '<get-y>(): String' type=kotlin.String origin=GET_PROPERTY
|
$this: THIS of 'Test1' type=Test1
|
||||||
$this: GET_VAR 'tmp0_other_with_cast: Test1' type=Test1 origin=null
|
arg1: CALL '<get-y>(): String' type=kotlin.String origin=GET_PROPERTY
|
||||||
then: RETURN type=kotlin.Nothing from='equals(Any?): Boolean'
|
$this: GET_VAR 'tmp0_other_with_cast: Test1' type=Test1 origin=null
|
||||||
CONST Boolean type=kotlin.Boolean value='false'
|
then: RETURN type=kotlin.Nothing from='equals(Any?): Boolean'
|
||||||
|
CONST Boolean type=kotlin.Boolean value='false'
|
||||||
WHEN type=kotlin.Unit origin=null
|
WHEN type=kotlin.Unit origin=null
|
||||||
if: CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ
|
BRANCH
|
||||||
arg0: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EXCLEQ
|
if: CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ
|
||||||
arg0: CALL '<get-z>(): Any' type=kotlin.Any origin=GET_PROPERTY
|
arg0: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EXCLEQ
|
||||||
$this: THIS of 'Test1' type=Test1
|
arg0: CALL '<get-z>(): Any' type=kotlin.Any origin=GET_PROPERTY
|
||||||
arg1: CALL '<get-z>(): Any' type=kotlin.Any origin=GET_PROPERTY
|
$this: THIS of 'Test1' type=Test1
|
||||||
$this: GET_VAR 'tmp0_other_with_cast: Test1' type=Test1 origin=null
|
arg1: CALL '<get-z>(): Any' type=kotlin.Any origin=GET_PROPERTY
|
||||||
then: RETURN type=kotlin.Nothing from='equals(Any?): Boolean'
|
$this: GET_VAR 'tmp0_other_with_cast: Test1' type=Test1 origin=null
|
||||||
CONST Boolean type=kotlin.Boolean value='false'
|
then: RETURN type=kotlin.Nothing from='equals(Any?): Boolean'
|
||||||
|
CONST Boolean type=kotlin.Boolean value='false'
|
||||||
RETURN type=kotlin.Nothing from='equals(Any?): Boolean'
|
RETURN type=kotlin.Nothing from='equals(Any?): Boolean'
|
||||||
CONST Boolean type=kotlin.Boolean value='true'
|
CONST Boolean type=kotlin.Boolean value='true'
|
||||||
|
|||||||
+25
-16
@@ -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
|
||||||
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
BRANCH
|
||||||
arg0: GET_VAR 'tmp0_notnull: Any?' type=kotlin.Any? origin=null
|
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
||||||
arg1: CONST Null type=kotlin.Nothing? value='null'
|
arg0: GET_VAR 'tmp0_notnull: Any?' type=kotlin.Any? origin=null
|
||||||
then: CALL 'THROW_NPE(): Nothing' type=kotlin.Nothing origin=EXCLEXCL
|
arg1: CONST Null type=kotlin.Nothing? value='null'
|
||||||
else: GET_VAR 'tmp0_notnull: Any?' type=kotlin.Any? origin=null
|
then: CALL 'THROW_NPE(): Nothing' type=kotlin.Nothing origin=EXCLEXCL
|
||||||
|
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
|
||||||
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
BRANCH
|
||||||
arg0: GET_VAR 'tmp0_safe_receiver: Any?' type=kotlin.Any? origin=null
|
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
||||||
arg1: CONST Null type=kotlin.Nothing? value='null'
|
arg0: GET_VAR 'tmp0_safe_receiver: Any?' type=kotlin.Any? origin=null
|
||||||
then: CONST Null type=kotlin.Nothing? value='null'
|
arg1: CONST Null type=kotlin.Nothing? value='null'
|
||||||
else: CALL 'hashCode(): Int' type=kotlin.Int origin=null
|
then: CONST Null type=kotlin.Nothing? value='null'
|
||||||
$this: GET_VAR 'tmp0_safe_receiver: Any?' type=kotlin.Any? 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
|
||||||
WHEN type=kotlin.Int origin=null
|
WHEN type=kotlin.Int origin=null
|
||||||
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
BRANCH
|
||||||
arg0: GET_VAR 'tmp1_notnull: Int?' type=kotlin.Int? origin=null
|
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
||||||
arg1: CONST Null type=kotlin.Nothing? value='null'
|
arg0: GET_VAR 'tmp1_notnull: Int?' type=kotlin.Int? origin=null
|
||||||
then: CALL 'THROW_NPE(): Nothing' type=kotlin.Nothing origin=EXCLEXCL
|
arg1: CONST Null type=kotlin.Nothing? value='null'
|
||||||
else: GET_VAR 'tmp1_notnull: Int?' type=kotlin.Int? origin=null
|
then: CALL 'THROW_NPE(): Nothing' type=kotlin.Nothing origin=EXCLEXCL
|
||||||
|
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
|
||||||
if: GET_VAR 'value-parameter a: Boolean' type=kotlin.Boolean origin=null
|
BRANCH
|
||||||
then: GET_VAR 'value-parameter b: Boolean' type=kotlin.Boolean origin=null
|
if: GET_VAR 'value-parameter a: Boolean' type=kotlin.Boolean origin=null
|
||||||
else: CONST Boolean type=kotlin.Boolean value='false'
|
then: GET_VAR 'value-parameter b: Boolean' type=kotlin.Boolean origin=null
|
||||||
|
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
|
||||||
if: GET_VAR 'value-parameter a: Boolean' type=kotlin.Boolean origin=null
|
BRANCH
|
||||||
then: CONST Boolean type=kotlin.Boolean value='true'
|
if: GET_VAR 'value-parameter a: Boolean' type=kotlin.Boolean origin=null
|
||||||
else: GET_VAR 'value-parameter b: Boolean' type=kotlin.Boolean origin=null
|
then: CONST Boolean type=kotlin.Boolean value='true'
|
||||||
|
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
|
||||||
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
BRANCH
|
||||||
arg0: GET_VAR 'tmp0_elvis_lhs: Boolean?' type=kotlin.Boolean? origin=null
|
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
||||||
arg1: CONST Null type=kotlin.Nothing? value='null'
|
arg0: GET_VAR 'tmp0_elvis_lhs: Boolean?' type=kotlin.Boolean? origin=null
|
||||||
then: BREAK label=null loop.label=L
|
arg1: CONST Null type=kotlin.Nothing? value='null'
|
||||||
else: GET_VAR 'tmp0_elvis_lhs: Boolean?' type=kotlin.Boolean? origin=null
|
then: BREAK label=null loop.label=L
|
||||||
|
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
|
||||||
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
BRANCH
|
||||||
arg0: GET_VAR 'tmp0_elvis_lhs: Boolean?' type=kotlin.Boolean? origin=null
|
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
||||||
arg1: CONST Null type=kotlin.Nothing? value='null'
|
arg0: GET_VAR 'tmp0_elvis_lhs: Boolean?' type=kotlin.Boolean? origin=null
|
||||||
then: CONTINUE label=null loop.label=L
|
arg1: CONST Null type=kotlin.Nothing? value='null'
|
||||||
else: GET_VAR 'tmp0_elvis_lhs: Boolean?' type=kotlin.Boolean? origin=null
|
then: CONTINUE label=null loop.label=L
|
||||||
|
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
|
||||||
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
BRANCH
|
||||||
arg0: GET_VAR 'tmp0_elvis_lhs: List<String>?' type=kotlin.collections.List<kotlin.String>? origin=null
|
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
||||||
arg1: CONST Null type=kotlin.Nothing? value='null'
|
arg0: GET_VAR 'tmp0_elvis_lhs: List<String>?' type=kotlin.collections.List<kotlin.String>? origin=null
|
||||||
then: CONTINUE label=null loop.label=L
|
arg1: CONST Null type=kotlin.Nothing? value='null'
|
||||||
else: GET_VAR 'tmp0_elvis_lhs: List<String>?' type=kotlin.collections.List<kotlin.String>? origin=null
|
then: CONTINUE label=null loop.label=L
|
||||||
|
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
|
||||||
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
BRANCH
|
||||||
arg0: GET_VAR 'tmp0_elvis_lhs: List<String>?' type=kotlin.collections.List<kotlin.String>? origin=null
|
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
||||||
arg1: CONST Null type=kotlin.Nothing? value='null'
|
arg0: GET_VAR 'tmp0_elvis_lhs: List<String>?' type=kotlin.collections.List<kotlin.String>? origin=null
|
||||||
then: BREAK label=null loop.label=L
|
arg1: CONST Null type=kotlin.Nothing? value='null'
|
||||||
else: GET_VAR 'tmp0_elvis_lhs: List<String>?' type=kotlin.collections.List<kotlin.String>? origin=null
|
then: BREAK label=null loop.label=L
|
||||||
|
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
|
||||||
|
|||||||
+36
-24
@@ -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
|
||||||
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
BRANCH
|
||||||
arg0: GET_VAR 'tmp0_safe_receiver: C?' type=C? origin=null
|
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
||||||
arg1: CONST Null type=kotlin.Nothing? value='null'
|
arg0: GET_VAR 'tmp0_safe_receiver: C?' type=C? origin=null
|
||||||
then: CONST Null type=kotlin.Nothing? value='null'
|
arg1: CONST Null type=kotlin.Nothing? value='null'
|
||||||
else: CALL 'foo(): C' type=C origin=null
|
then: CONST Null type=kotlin.Nothing? value='null'
|
||||||
$this: GET_VAR 'tmp0_safe_receiver: 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
|
||||||
WHEN type=C? origin=SAFE_CALL
|
WHEN type=C? origin=SAFE_CALL
|
||||||
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
BRANCH
|
||||||
arg0: GET_VAR 'tmp1_safe_receiver: C?' type=C? origin=null
|
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
||||||
arg1: CONST Null type=kotlin.Nothing? value='null'
|
arg0: GET_VAR 'tmp1_safe_receiver: C?' type=C? origin=null
|
||||||
then: CONST Null type=kotlin.Nothing? value='null'
|
arg1: CONST Null type=kotlin.Nothing? value='null'
|
||||||
else: CALL 'bar(): C?' type=C? origin=null
|
then: CONST Null type=kotlin.Nothing? value='null'
|
||||||
$this: GET_VAR 'tmp1_safe_receiver: 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
|
||||||
WHEN type=C? origin=SAFE_CALL
|
WHEN type=C? origin=SAFE_CALL
|
||||||
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
BRANCH
|
||||||
arg0: GET_VAR 'tmp2_safe_receiver: C?' type=C? origin=null
|
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
||||||
arg1: CONST Null type=kotlin.Nothing? value='null'
|
arg0: GET_VAR 'tmp2_safe_receiver: C?' type=C? origin=null
|
||||||
then: CONST Null type=kotlin.Nothing? value='null'
|
arg1: CONST Null type=kotlin.Nothing? value='null'
|
||||||
else: CALL 'foo(): C' type=C origin=null
|
then: CONST Null type=kotlin.Nothing? value='null'
|
||||||
$this: GET_VAR 'tmp2_safe_receiver: 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
|
||||||
WHEN type=C? origin=SAFE_CALL
|
WHEN type=C? origin=SAFE_CALL
|
||||||
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
BRANCH
|
||||||
arg0: GET_VAR 'tmp3_safe_receiver: C?' type=C? origin=null
|
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
||||||
arg1: CONST Null type=kotlin.Nothing? value='null'
|
arg0: GET_VAR 'tmp3_safe_receiver: C?' type=C? origin=null
|
||||||
then: CONST Null type=kotlin.Nothing? value='null'
|
arg1: CONST Null type=kotlin.Nothing? value='null'
|
||||||
else: CALL 'foo(): C' type=C origin=null
|
then: CONST Null type=kotlin.Nothing? value='null'
|
||||||
$this: GET_VAR 'tmp3_safe_receiver: 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
|
||||||
|
|||||||
+22
-16
@@ -26,24 +26,30 @@ 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
|
||||||
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
BRANCH
|
||||||
arg0: GET_VAR 'tmp0_safe_receiver: PrintStream!' type=java.io.PrintStream! origin=null
|
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
||||||
arg1: CONST Null type=kotlin.Nothing? value='null'
|
arg0: GET_VAR 'tmp0_safe_receiver: PrintStream!' type=java.io.PrintStream! origin=null
|
||||||
then: CONST Null type=kotlin.Nothing? value='null'
|
arg1: CONST Null type=kotlin.Nothing? value='null'
|
||||||
else: CALL 'println(String!): Unit' type=kotlin.Unit origin=null
|
then: CONST Null type=kotlin.Nothing? value='null'
|
||||||
$this: TYPE_OP origin=IMPLICIT_NOTNULL typeOperand=java.io.PrintStream
|
BRANCH
|
||||||
GET_VAR 'tmp0_safe_receiver: PrintStream!' type=java.io.PrintStream! origin=null
|
if: CONST Boolean type=kotlin.Boolean value='true'
|
||||||
p0: CONST String type=kotlin.String value='Hello,'
|
then: CALL 'println(String!): Unit' type=kotlin.Unit origin=null
|
||||||
|
$this: TYPE_OP origin=IMPLICIT_NOTNULL typeOperand=java.io.PrintStream
|
||||||
|
GET_VAR 'tmp0_safe_receiver: PrintStream!' type=java.io.PrintStream! origin=null
|
||||||
|
p0: CONST String type=kotlin.String value='Hello,'
|
||||||
TYPE_OP origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
TYPE_OP origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||||
BLOCK type=kotlin.Unit? origin=SAFE_CALL
|
BLOCK type=kotlin.Unit? origin=SAFE_CALL
|
||||||
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
|
||||||
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
BRANCH
|
||||||
arg0: GET_VAR 'tmp1_safe_receiver: PrintStream!' type=java.io.PrintStream! origin=null
|
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
||||||
arg1: CONST Null type=kotlin.Nothing? value='null'
|
arg0: GET_VAR 'tmp1_safe_receiver: PrintStream!' type=java.io.PrintStream! origin=null
|
||||||
then: CONST Null type=kotlin.Nothing? value='null'
|
arg1: CONST Null type=kotlin.Nothing? value='null'
|
||||||
else: CALL 'println(String!): Unit' type=kotlin.Unit origin=null
|
then: CONST Null type=kotlin.Nothing? value='null'
|
||||||
$this: TYPE_OP origin=IMPLICIT_NOTNULL typeOperand=java.io.PrintStream
|
BRANCH
|
||||||
GET_VAR 'tmp1_safe_receiver: PrintStream!' type=java.io.PrintStream! origin=null
|
if: CONST Boolean type=kotlin.Boolean value='true'
|
||||||
p0: CONST String type=kotlin.String value='world!'
|
then: CALL 'println(String!): Unit' type=kotlin.Unit origin=null
|
||||||
|
$this: TYPE_OP origin=IMPLICIT_NOTNULL typeOperand=java.io.PrintStream
|
||||||
|
GET_VAR 'tmp1_safe_receiver: PrintStream!' type=java.io.PrintStream! origin=null
|
||||||
|
p0: CONST String type=kotlin.String value='world!'
|
||||||
|
|||||||
@@ -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
|
||||||
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
BRANCH
|
||||||
arg0: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null
|
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
||||||
arg1: CONST Null type=kotlin.Nothing? value='null'
|
arg0: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null
|
||||||
then: CONST Null type=kotlin.Nothing? value='null'
|
arg1: CONST Null type=kotlin.Nothing? value='null'
|
||||||
else: CALL '<get-length>(): Int' type=kotlin.Int origin=GET_PROPERTY
|
then: CONST Null type=kotlin.Nothing? value='null'
|
||||||
$this: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null
|
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
|
||||||
|
|||||||
+54
-37
@@ -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
|
||||||
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
BRANCH
|
||||||
arg0: GET_VAR 'tmp0_elvis_lhs: Any?' type=kotlin.Any? origin=null
|
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
||||||
arg1: CONST Null type=kotlin.Nothing? value='null'
|
arg0: GET_VAR 'tmp0_elvis_lhs: Any?' type=kotlin.Any? origin=null
|
||||||
then: GET_VAR 'value-parameter b: Any' type=kotlin.Any origin=null
|
arg1: CONST Null type=kotlin.Nothing? value='null'
|
||||||
else: GET_VAR 'tmp0_elvis_lhs: Any?' type=kotlin.Any? origin=null
|
then: GET_VAR 'value-parameter b: 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,35 +33,43 @@ 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
|
||||||
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
BRANCH
|
||||||
arg0: GET_VAR 'tmp0_elvis_lhs: String?' type=kotlin.String? origin=null
|
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
||||||
arg1: CONST Null type=kotlin.Nothing? value='null'
|
arg0: GET_VAR 'tmp0_elvis_lhs: String?' type=kotlin.String? origin=null
|
||||||
then: GET_VAR 'value-parameter b: Any' type=kotlin.Any origin=null
|
arg1: CONST Null type=kotlin.Nothing? value='null'
|
||||||
else: GET_VAR 'tmp0_elvis_lhs: String?' type=kotlin.String? origin=null
|
then: GET_VAR 'value-parameter b: Any' type=kotlin.Any 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
|
||||||
if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=kotlin.String
|
BRANCH
|
||||||
GET_VAR 'value-parameter b: Any?' type=kotlin.Any? origin=null
|
if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=kotlin.String
|
||||||
then: RETURN type=kotlin.Nothing from='test3(Any?, Any?): String'
|
GET_VAR 'value-parameter b: Any?' type=kotlin.Any? origin=null
|
||||||
CONST String type=kotlin.String value=''
|
then: RETURN type=kotlin.Nothing from='test3(Any?, Any?): String'
|
||||||
WHEN type=kotlin.Unit origin=IF
|
CONST String type=kotlin.String value=''
|
||||||
if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=kotlin.String?
|
WHEN type=kotlin.Unit origin=null
|
||||||
GET_VAR 'value-parameter a: Any?' type=kotlin.Any? origin=null
|
BRANCH
|
||||||
then: RETURN type=kotlin.Nothing from='test3(Any?, Any?): String'
|
if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=kotlin.String?
|
||||||
CONST String type=kotlin.String value=''
|
GET_VAR 'value-parameter a: Any?' type=kotlin.Any? origin=null
|
||||||
|
then: RETURN type=kotlin.Nothing from='test3(Any?, Any?): String'
|
||||||
|
CONST String type=kotlin.String value=''
|
||||||
RETURN type=kotlin.Nothing from='test3(Any?, Any?): String'
|
RETURN type=kotlin.Nothing from='test3(Any?, Any?): String'
|
||||||
BLOCK type=kotlin.String origin=ELVIS
|
BLOCK type=kotlin.String origin=ELVIS
|
||||||
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
|
||||||
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
BRANCH
|
||||||
arg0: GET_VAR 'tmp0_elvis_lhs: Any?' type=kotlin.Any? origin=null
|
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
||||||
arg1: CONST Null type=kotlin.Nothing? value='null'
|
arg0: GET_VAR 'tmp0_elvis_lhs: Any?' type=kotlin.Any? origin=null
|
||||||
then: TYPE_OP origin=IMPLICIT_CAST typeOperand=kotlin.String
|
arg1: CONST Null type=kotlin.Nothing? value='null'
|
||||||
GET_VAR 'value-parameter b: Any?' type=kotlin.Any? origin=null
|
then: TYPE_OP origin=IMPLICIT_CAST typeOperand=kotlin.String
|
||||||
else: TYPE_OP origin=IMPLICIT_CAST typeOperand=kotlin.String
|
GET_VAR 'value-parameter b: Any?' type=kotlin.Any? origin=null
|
||||||
GET_VAR 'tmp0_elvis_lhs: Any?' type=kotlin.Any? origin=null
|
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
|
||||||
FUN public fun test4(x: kotlin.Any): kotlin.Any
|
FUN public fun test4(x: kotlin.Any): kotlin.Any
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
RETURN type=kotlin.Nothing from='test4(Any): Any'
|
RETURN type=kotlin.Nothing from='test4(Any): Any'
|
||||||
@@ -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
|
||||||
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
BRANCH
|
||||||
arg0: GET_VAR 'tmp0_elvis_lhs: Any?' type=kotlin.Any? origin=null
|
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
||||||
arg1: CONST Null type=kotlin.Nothing? value='null'
|
arg0: GET_VAR 'tmp0_elvis_lhs: Any?' type=kotlin.Any? origin=null
|
||||||
then: GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
|
arg1: CONST Null type=kotlin.Nothing? value='null'
|
||||||
else: GET_VAR 'tmp0_elvis_lhs: Any?' type=kotlin.Any? origin=null
|
then: GET_VAR 'value-parameter x: 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
|
||||||
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
BRANCH
|
||||||
arg0: GET_VAR 'tmp0_elvis_lhs: Any?' type=kotlin.Any? origin=null
|
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
||||||
arg1: CONST Null type=kotlin.Nothing? value='null'
|
arg0: GET_VAR 'tmp0_elvis_lhs: Any?' type=kotlin.Any? origin=null
|
||||||
then: GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
|
arg1: CONST Null type=kotlin.Nothing? value='null'
|
||||||
else: GET_VAR 'tmp0_elvis_lhs: Any?' type=kotlin.Any? origin=null
|
then: GET_VAR 'value-parameter x: 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
|
||||||
|
|||||||
+15
-11
@@ -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
|
||||||
if: CALL 'GT0(Int): Boolean' type=kotlin.Boolean origin=GT
|
BRANCH
|
||||||
arg0: CALL 'compareTo(Int): Int' type=kotlin.Int origin=GT
|
if: CALL 'GT0(Int): Boolean' type=kotlin.Boolean origin=GT
|
||||||
$this: GET_VAR 'value-parameter i: Int' type=kotlin.Int origin=null
|
arg0: CALL 'compareTo(Int): Int' type=kotlin.Int origin=GT
|
||||||
other: CONST Int type=kotlin.Int value='0'
|
$this: GET_VAR 'value-parameter i: Int' type=kotlin.Int origin=null
|
||||||
then: CONST Int type=kotlin.Int value='1'
|
other: CONST Int type=kotlin.Int value='0'
|
||||||
if: CALL 'LT0(Int): Boolean' type=kotlin.Boolean origin=LT
|
then: CONST Int type=kotlin.Int value='1'
|
||||||
arg0: CALL 'compareTo(Int): Int' type=kotlin.Int origin=LT
|
BRANCH
|
||||||
$this: GET_VAR 'value-parameter i: Int' type=kotlin.Int origin=null
|
if: CALL 'LT0(Int): Boolean' type=kotlin.Boolean origin=LT
|
||||||
other: CONST Int type=kotlin.Int value='0'
|
arg0: CALL 'compareTo(Int): Int' type=kotlin.Int origin=LT
|
||||||
then: CONST Int type=kotlin.Int value='-1'
|
$this: GET_VAR 'value-parameter i: Int' type=kotlin.Int origin=null
|
||||||
else: CONST Int type=kotlin.Int value='0'
|
other: CONST Int type=kotlin.Int value='0'
|
||||||
|
then: CONST Int type=kotlin.Int value='-1'
|
||||||
|
BRANCH
|
||||||
|
if: CONST Boolean type=kotlin.Boolean value='true'
|
||||||
|
then: CONST Int type=kotlin.Int value='0'
|
||||||
|
|||||||
@@ -29,12 +29,14 @@ 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
|
||||||
CALL 'println(String!): Unit' type=kotlin.Unit origin=null
|
if: CONST Boolean type=kotlin.Boolean value='true'
|
||||||
$this: TYPE_OP origin=IMPLICIT_NOTNULL typeOperand=java.io.PrintStream
|
then: BLOCK type=kotlin.Int origin=null
|
||||||
GET_FIELD 'out: PrintStream!' type=java.io.PrintStream! origin=GET_PROPERTY
|
CALL 'println(String!): Unit' type=kotlin.Unit origin=null
|
||||||
p0: CONST String type=kotlin.String value='TestClass/test'
|
$this: TYPE_OP origin=IMPLICIT_NOTNULL typeOperand=java.io.PrintStream
|
||||||
CONST Int type=kotlin.Int value='42'
|
GET_FIELD 'out: PrintStream!' type=java.io.PrintStream! origin=GET_PROPERTY
|
||||||
|
p0: CONST String type=kotlin.String value='TestClass/test'
|
||||||
|
CONST Int type=kotlin.Int value='42'
|
||||||
FUN DEFAULT_PROPERTY_ACCESSOR public final fun <get-test>(): kotlin.Int
|
FUN DEFAULT_PROPERTY_ACCESSOR public final fun <get-test>(): kotlin.Int
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
RETURN type=kotlin.Nothing from='<get-test>(): Int'
|
RETURN type=kotlin.Nothing from='<get-test>(): Int'
|
||||||
|
|||||||
+11
-8
@@ -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
|
||||||
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
BRANCH
|
||||||
arg0: GET_VAR 'tmp0_safe_receiver: C?' type=C? origin=null
|
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
||||||
arg1: CONST Null type=kotlin.Nothing? value='null'
|
arg0: GET_VAR 'tmp0_safe_receiver: C?' type=C? origin=null
|
||||||
then: TYPE_OP origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
arg1: CONST Null type=kotlin.Nothing? value='null'
|
||||||
CONST Null type=kotlin.Nothing? value='null'
|
then: TYPE_OP origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||||
else: CALL '<set-x>(Int): Unit' type=kotlin.Unit origin=EQ
|
CONST Null type=kotlin.Nothing? value='null'
|
||||||
$this: GET_VAR 'tmp0_safe_receiver: C?' type=C? origin=null
|
BRANCH
|
||||||
<set-?>: CONST Int type=kotlin.Int value='42'
|
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
|
||||||
|
<set-?>: CONST Int type=kotlin.Int value='42'
|
||||||
|
|||||||
+37
-28
@@ -18,12 +18,15 @@ 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
|
||||||
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
BRANCH
|
||||||
arg0: GET_VAR 'tmp0_safe_receiver: Int?' type=kotlin.Int? origin=null
|
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
||||||
arg1: CONST Null type=kotlin.Nothing? value='null'
|
arg0: GET_VAR 'tmp0_safe_receiver: Int?' type=kotlin.Int? origin=null
|
||||||
then: CONST Null type=kotlin.Nothing? value='null'
|
arg1: CONST Null type=kotlin.Nothing? value='null'
|
||||||
else: CALL 'inc(): Int' type=kotlin.Int origin=null
|
then: CONST Null type=kotlin.Nothing? value='null'
|
||||||
$this: GET_VAR 'tmp0_safe_receiver: 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
|
||||||
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
|
||||||
RETURN type=kotlin.Nothing from='get(Int) on Int?: Int'
|
RETURN type=kotlin.Nothing from='get(Int) on Int?: Int'
|
||||||
@@ -36,24 +39,27 @@ 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
|
||||||
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
BRANCH
|
||||||
arg0: GET_VAR 'tmp0_safe_receiver: C?' type=test.C? origin=null
|
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
||||||
arg1: CONST Null type=kotlin.Nothing? value='null'
|
arg0: GET_VAR 'tmp0_safe_receiver: C?' type=test.C? origin=null
|
||||||
then: TYPE_OP origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
arg1: CONST Null type=kotlin.Nothing? value='null'
|
||||||
CONST Null type=kotlin.Nothing? value='null'
|
then: TYPE_OP origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||||
else: TYPE_OP origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
CONST Null type=kotlin.Nothing? value='null'
|
||||||
BLOCK type=kotlin.Int origin=POSTFIX_INCR
|
BRANCH
|
||||||
VAR IR_TEMPORARY_VARIABLE val tmp1_this: test.C?
|
if: CONST Boolean type=kotlin.Boolean value='true'
|
||||||
GET_VAR 'tmp0_safe_receiver: C?' type=test.C? origin=null
|
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 tmp2: kotlin.Int
|
VAR IR_TEMPORARY_VARIABLE val tmp1_this: test.C?
|
||||||
CALL '<get-p>() on C?: Int' type=kotlin.Int origin=POSTFIX_INCR
|
GET_VAR 'tmp0_safe_receiver: C?' type=test.C? origin=null
|
||||||
|
BLOCK type=kotlin.Int origin=POSTFIX_INCR
|
||||||
|
VAR IR_TEMPORARY_VARIABLE val tmp2: kotlin.Int
|
||||||
|
CALL '<get-p>() on C?: Int' type=kotlin.Int origin=POSTFIX_INCR
|
||||||
|
$this: GET_VAR 'tmp1_this: C?' type=test.C? origin=null
|
||||||
|
CALL '<set-p>(Int) on C?: Unit' type=kotlin.Unit origin=POSTFIX_INCR
|
||||||
$this: GET_VAR 'tmp1_this: C?' type=test.C? origin=null
|
$this: GET_VAR 'tmp1_this: C?' type=test.C? origin=null
|
||||||
CALL '<set-p>(Int) on C?: Unit' type=kotlin.Unit origin=POSTFIX_INCR
|
value: CALL 'inc() on Int?: Int?' type=kotlin.Int? origin=POSTFIX_INCR
|
||||||
$this: GET_VAR 'tmp1_this: C?' type=test.C? origin=null
|
$receiver: GET_VAR 'tmp2: Int' type=kotlin.Int origin=null
|
||||||
value: CALL 'inc() on Int?: Int?' type=kotlin.Int? origin=POSTFIX_INCR
|
GET_VAR 'tmp2: Int' type=kotlin.Int origin=null
|
||||||
$receiver: GET_VAR 'tmp2: Int' type=kotlin.Int origin=null
|
|
||||||
GET_VAR 'tmp2: Int' type=kotlin.Int origin=null
|
|
||||||
FUN public fun testArrayAccess(nc: test.C?): kotlin.Unit
|
FUN public fun testArrayAccess(nc: test.C?): kotlin.Unit
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
TYPE_OP origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
TYPE_OP origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||||
@@ -63,12 +69,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.Int? origin=SAFE_CALL
|
WHEN type=kotlin.Int? origin=SAFE_CALL
|
||||||
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
BRANCH
|
||||||
arg0: GET_VAR 'tmp0_safe_receiver: C?' type=test.C? origin=null
|
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
||||||
arg1: CONST Null type=kotlin.Nothing? value='null'
|
arg0: GET_VAR 'tmp0_safe_receiver: C?' type=test.C? origin=null
|
||||||
then: CONST Null type=kotlin.Nothing? value='null'
|
arg1: CONST Null type=kotlin.Nothing? value='null'
|
||||||
else: CALL '<get-p>() on C?: Int' type=kotlin.Int origin=GET_PROPERTY
|
then: CONST Null type=kotlin.Nothing? value='null'
|
||||||
$this: GET_VAR 'tmp0_safe_receiver: C?' type=test.C? origin=null
|
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
|
||||||
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'
|
||||||
VAR IR_TEMPORARY_VARIABLE val tmp5: kotlin.Int
|
VAR IR_TEMPORARY_VARIABLE val tmp5: kotlin.Int
|
||||||
|
|||||||
+49
-34
@@ -31,12 +31,15 @@ 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
|
||||||
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
BRANCH
|
||||||
arg0: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null
|
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
||||||
arg1: CONST Null type=kotlin.Nothing? value='null'
|
arg0: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null
|
||||||
then: CONST Null type=kotlin.Nothing? value='null'
|
arg1: CONST Null type=kotlin.Nothing? value='null'
|
||||||
else: CALL '<get-length>(): Int' type=kotlin.Int origin=GET_PROPERTY
|
then: CONST Null type=kotlin.Nothing? value='null'
|
||||||
$this: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null
|
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
|
||||||
FUN public fun test2(x: kotlin.String?): kotlin.Int?
|
FUN public fun test2(x: kotlin.String?): kotlin.Int?
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
RETURN type=kotlin.Nothing from='test2(String?): Int?'
|
RETURN type=kotlin.Nothing from='test2(String?): Int?'
|
||||||
@@ -44,12 +47,15 @@ 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
|
||||||
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
BRANCH
|
||||||
arg0: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null
|
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
||||||
arg1: CONST Null type=kotlin.Nothing? value='null'
|
arg0: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null
|
||||||
then: CONST Null type=kotlin.Nothing? value='null'
|
arg1: CONST Null type=kotlin.Nothing? value='null'
|
||||||
else: CALL 'hashCode(): Int' type=kotlin.Int origin=null
|
then: CONST Null type=kotlin.Nothing? value='null'
|
||||||
$this: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? 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
|
||||||
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
|
||||||
RETURN type=kotlin.Nothing from='test3(String?, Any?): Boolean?'
|
RETURN type=kotlin.Nothing from='test3(String?, Any?): Boolean?'
|
||||||
@@ -57,27 +63,33 @@ 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
|
||||||
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
BRANCH
|
||||||
arg0: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null
|
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
||||||
arg1: CONST Null type=kotlin.Nothing? value='null'
|
arg0: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null
|
||||||
then: CONST Null type=kotlin.Nothing? value='null'
|
arg1: CONST Null type=kotlin.Nothing? value='null'
|
||||||
else: CALL 'equals(Any?): Boolean' type=kotlin.Boolean origin=null
|
then: CONST Null type=kotlin.Nothing? value='null'
|
||||||
$this: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null
|
BRANCH
|
||||||
other: GET_VAR 'value-parameter y: Any?' type=kotlin.Any? origin=null
|
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
|
||||||
|
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
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
BLOCK type=kotlin.Unit origin=SAFE_CALL
|
BLOCK type=kotlin.Unit origin=SAFE_CALL
|
||||||
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
|
||||||
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
BRANCH
|
||||||
arg0: GET_VAR 'tmp0_safe_receiver: Ref?' type=Ref? origin=null
|
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
||||||
arg1: CONST Null type=kotlin.Nothing? value='null'
|
arg0: GET_VAR 'tmp0_safe_receiver: Ref?' type=Ref? origin=null
|
||||||
then: TYPE_OP origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
arg1: CONST Null type=kotlin.Nothing? value='null'
|
||||||
CONST Null type=kotlin.Nothing? value='null'
|
then: TYPE_OP origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||||
else: CALL '<set-value>(Int): Unit' type=kotlin.Unit origin=EQ
|
CONST Null type=kotlin.Nothing? value='null'
|
||||||
$this: GET_VAR 'tmp0_safe_receiver: Ref?' type=Ref? origin=null
|
BRANCH
|
||||||
<set-?>: CONST Int type=kotlin.Int value='0'
|
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
|
||||||
|
<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?
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
RETURN type=kotlin.Nothing from='test5(String?) on IHost: Int?'
|
RETURN type=kotlin.Nothing from='test5(String?) on IHost: 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
|
||||||
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
BRANCH
|
||||||
arg0: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null
|
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
||||||
arg1: CONST Null type=kotlin.Nothing? value='null'
|
arg0: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null
|
||||||
then: CONST Null type=kotlin.Nothing? value='null'
|
arg1: CONST Null type=kotlin.Nothing? value='null'
|
||||||
else: CALL 'extLength() on String: Int' type=kotlin.Int origin=null
|
then: CONST Null type=kotlin.Nothing? value='null'
|
||||||
$this: $RECEIVER of 'test5(String?) on IHost: Int?' type=IHost
|
BRANCH
|
||||||
$receiver: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null
|
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
|
||||||
|
$receiver: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null
|
||||||
|
|||||||
@@ -6,11 +6,12 @@ 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
|
||||||
if: TYPE_OP origin=INSTANCEOF typeOperand=kotlin.String
|
BRANCH
|
||||||
GET_VAR 'value-parameter v: Any' type=kotlin.Any origin=null
|
if: TYPE_OP origin=INSTANCEOF typeOperand=kotlin.String
|
||||||
then: BLOCK type=kotlin.Unit origin=null
|
GET_VAR 'value-parameter v: Any' type=kotlin.Any origin=null
|
||||||
SET_FIELD 'value: String!' type=kotlin.Unit origin=EQ
|
then: BLOCK type=kotlin.Unit origin=null
|
||||||
receiver: THIS of 'Derived' type=Derived
|
SET_FIELD 'value: String!' type=kotlin.Unit origin=EQ
|
||||||
value: TYPE_OP origin=IMPLICIT_CAST typeOperand=kotlin.String!
|
receiver: THIS of 'Derived' type=Derived
|
||||||
GET_VAR 'value-parameter v: Any' type=kotlin.Any origin=null
|
value: TYPE_OP origin=IMPLICIT_CAST typeOperand=kotlin.String!
|
||||||
|
GET_VAR 'value-parameter v: Any' type=kotlin.Any origin=null
|
||||||
|
|||||||
+17
-14
@@ -13,10 +13,11 @@ 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
|
||||||
if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=kotlin.String
|
BRANCH
|
||||||
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
|
if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=kotlin.String
|
||||||
then: RETURN type=kotlin.Nothing from='test1(Any): Unit'
|
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
|
||||||
|
then: RETURN type=kotlin.Nothing from='test1(Any): Unit'
|
||||||
CALL 'println(Int): Unit' type=kotlin.Unit origin=null
|
CALL 'println(Int): Unit' type=kotlin.Unit origin=null
|
||||||
message: CALL '<get-length>(): Int' type=kotlin.Int origin=GET_PROPERTY
|
message: CALL '<get-length>(): Int' type=kotlin.Int origin=GET_PROPERTY
|
||||||
$this: TYPE_OP origin=IMPLICIT_CAST typeOperand=kotlin.String
|
$this: TYPE_OP origin=IMPLICIT_CAST typeOperand=kotlin.String
|
||||||
@@ -34,22 +35,24 @@ 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
|
||||||
if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=kotlin.String
|
BRANCH
|
||||||
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
|
if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=kotlin.String
|
||||||
then: RETURN type=kotlin.Nothing from='test2(Any): String'
|
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
|
||||||
CONST String type=kotlin.String value=''
|
then: RETURN type=kotlin.Nothing from='test2(Any): String'
|
||||||
|
CONST String type=kotlin.String value=''
|
||||||
RETURN type=kotlin.Nothing from='test2(Any): String'
|
RETURN type=kotlin.Nothing from='test2(Any): String'
|
||||||
CALL 'overloaded(String): String' type=kotlin.String origin=null
|
CALL 'overloaded(String): String' type=kotlin.String origin=null
|
||||||
s: TYPE_OP origin=IMPLICIT_CAST typeOperand=kotlin.String
|
s: TYPE_OP origin=IMPLICIT_CAST 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
|
||||||
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
|
||||||
if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=kotlin.String
|
BRANCH
|
||||||
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
|
if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=kotlin.String
|
||||||
then: RETURN type=kotlin.Nothing from='test3(Any): String'
|
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
|
||||||
CONST String type=kotlin.String value=''
|
then: RETURN type=kotlin.Nothing from='test3(Any): String'
|
||||||
|
CONST String type=kotlin.String value=''
|
||||||
RETURN type=kotlin.Nothing from='test3(Any): String'
|
RETURN type=kotlin.Nothing from='test3(Any): String'
|
||||||
TYPE_OP origin=IMPLICIT_CAST typeOperand=kotlin.String
|
TYPE_OP origin=IMPLICIT_CAST 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
|
||||||
|
|||||||
@@ -11,10 +11,11 @@ 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
|
||||||
if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=I2
|
BRANCH
|
||||||
GET_VAR 'value-parameter x: I1' type=I1 origin=null
|
if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=I2
|
||||||
then: RETURN type=kotlin.Nothing from='test(I1): Unit'
|
GET_VAR 'value-parameter x: I1' type=I1 origin=null
|
||||||
|
then: RETURN type=kotlin.Nothing from='test(I1): Unit'
|
||||||
COMPOSITE type=kotlin.Unit origin=DESTRUCTURING_DECLARATION
|
COMPOSITE type=kotlin.Unit origin=DESTRUCTURING_DECLARATION
|
||||||
VAR IR_TEMPORARY_VARIABLE val tmp0_container: I1
|
VAR IR_TEMPORARY_VARIABLE val tmp0_container: I1
|
||||||
GET_VAR 'value-parameter x: I1' type=I1 origin=null
|
GET_VAR 'value-parameter x: I1' type=I1 origin=null
|
||||||
|
|||||||
+8
-7
@@ -5,10 +5,11 @@ 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
|
||||||
if: TYPE_OP origin=INSTANCEOF typeOperand=kotlin.Throwable
|
BRANCH
|
||||||
GET_VAR 'value-parameter a: Any' type=kotlin.Any origin=null
|
if: TYPE_OP origin=INSTANCEOF typeOperand=kotlin.Throwable
|
||||||
then: BLOCK type=kotlin.Nothing origin=null
|
GET_VAR 'value-parameter a: Any' type=kotlin.Any origin=null
|
||||||
THROW type=kotlin.Nothing
|
then: BLOCK type=kotlin.Nothing origin=null
|
||||||
TYPE_OP origin=IMPLICIT_CAST typeOperand=kotlin.Throwable
|
THROW type=kotlin.Nothing
|
||||||
GET_VAR 'value-parameter a: Any' type=kotlin.Any origin=null
|
TYPE_OP origin=IMPLICIT_CAST typeOperand=kotlin.Throwable
|
||||||
|
GET_VAR 'value-parameter a: Any' type=kotlin.Any origin=null
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
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
|
||||||
if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=kotlin.String
|
BRANCH
|
||||||
GET_VAR 'value-parameter a: Any' type=kotlin.Any origin=null
|
if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=kotlin.String
|
||||||
then: RETURN type=kotlin.Nothing from='testImplicitCast(Any): Unit'
|
GET_VAR 'value-parameter a: Any' type=kotlin.Any origin=null
|
||||||
|
then: RETURN type=kotlin.Nothing from='testImplicitCast(Any): Unit'
|
||||||
VAR val t: kotlin.String
|
VAR val t: kotlin.String
|
||||||
TRY type=kotlin.String
|
TRY type=kotlin.String
|
||||||
try: BLOCK type=kotlin.String origin=null
|
try: BLOCK type=kotlin.String origin=null
|
||||||
|
|||||||
@@ -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
|
||||||
if: TYPE_OP origin=INSTANCEOF typeOperand=kotlin.Array<*>
|
BRANCH
|
||||||
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
|
if: TYPE_OP origin=INSTANCEOF typeOperand=kotlin.Array<*>
|
||||||
then: CALL 'isArrayOf() on Array<*>: Boolean' type=kotlin.Boolean origin=null
|
|
||||||
<reified T : Any>: String
|
|
||||||
$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'
|
then: CALL 'isArrayOf() on Array<*>: Boolean' type=kotlin.Boolean origin=null
|
||||||
|
<reified T : Any>: String
|
||||||
|
$receiver: TYPE_OP origin=IMPLICIT_CAST typeOperand=kotlin.Array<*>
|
||||||
|
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
|
||||||
|
BRANCH
|
||||||
|
if: CONST Boolean type=kotlin.Boolean value='true'
|
||||||
|
then: CONST Boolean type=kotlin.Boolean value='false'
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
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
|
||||||
if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=kotlin.Int
|
BRANCH
|
||||||
GET_VAR 'value-parameter a: Any' type=kotlin.Any origin=null
|
if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=kotlin.Int
|
||||||
then: RETURN type=kotlin.Nothing from='testScalar(Any): IntArray'
|
GET_VAR 'value-parameter a: Any' type=kotlin.Any origin=null
|
||||||
CALL 'intArrayOf(vararg Int): IntArray' type=kotlin.IntArray origin=null
|
then: RETURN type=kotlin.Nothing from='testScalar(Any): IntArray'
|
||||||
|
CALL 'intArrayOf(vararg Int): IntArray' type=kotlin.IntArray origin=null
|
||||||
RETURN type=kotlin.Nothing from='testScalar(Any): IntArray'
|
RETURN type=kotlin.Nothing from='testScalar(Any): IntArray'
|
||||||
CALL 'intArrayOf(vararg Int): IntArray' type=kotlin.IntArray origin=null
|
CALL 'intArrayOf(vararg Int): IntArray' type=kotlin.IntArray origin=null
|
||||||
elements: VARARG type=IntArray varargElementType=Int
|
elements: VARARG type=IntArray varargElementType=Int
|
||||||
@@ -13,11 +14,12 @@ 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
|
||||||
if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=kotlin.IntArray
|
BRANCH
|
||||||
GET_VAR 'value-parameter a: Any' type=kotlin.Any origin=null
|
if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=kotlin.IntArray
|
||||||
then: RETURN type=kotlin.Nothing from='testSpread(Any): IntArray'
|
GET_VAR 'value-parameter a: Any' type=kotlin.Any origin=null
|
||||||
CALL 'intArrayOf(vararg Int): IntArray' type=kotlin.IntArray origin=null
|
then: RETURN type=kotlin.Nothing from='testSpread(Any): IntArray'
|
||||||
|
CALL 'intArrayOf(vararg Int): IntArray' type=kotlin.IntArray origin=null
|
||||||
RETURN type=kotlin.Nothing from='testSpread(Any): IntArray'
|
RETURN type=kotlin.Nothing from='testSpread(Any): IntArray'
|
||||||
CALL 'intArrayOf(vararg Int): IntArray' type=kotlin.IntArray origin=null
|
CALL 'intArrayOf(vararg Int): IntArray' type=kotlin.IntArray origin=null
|
||||||
elements: VARARG type=IntArray varargElementType=Int
|
elements: VARARG type=IntArray varargElementType=Int
|
||||||
|
|||||||
@@ -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
|
||||||
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
BRANCH
|
||||||
arg0: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null
|
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
||||||
arg1: CONST Null type=kotlin.Nothing? value='null'
|
arg0: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null
|
||||||
then: CONST Null type=kotlin.Nothing? value='null'
|
arg1: CONST Null type=kotlin.Nothing? value='null'
|
||||||
else: CALL 'k() on String: () -> String' type=() -> kotlin.String origin=null
|
then: CONST Null type=kotlin.Nothing? value='null'
|
||||||
$this: GET_VAR 'tmp0_safe_receiver: 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
|
||||||
WHEN type=kotlin.String? origin=SAFE_CALL
|
WHEN type=kotlin.String? origin=SAFE_CALL
|
||||||
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
BRANCH
|
||||||
arg0: GET_VAR 'tmp1_safe_receiver: (() -> String)?' type=(() -> kotlin.String)? origin=null
|
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
||||||
arg1: CONST Null type=kotlin.Nothing? value='null'
|
arg0: GET_VAR 'tmp1_safe_receiver: (() -> String)?' type=(() -> kotlin.String)? origin=null
|
||||||
then: CONST Null type=kotlin.Nothing? value='null'
|
arg1: CONST Null type=kotlin.Nothing? value='null'
|
||||||
else: CALL 'invoke(): String' type=kotlin.String origin=null
|
then: CONST Null type=kotlin.Nothing? value='null'
|
||||||
$this: GET_VAR 'tmp1_safe_receiver: (() -> 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
|
||||||
|
|||||||
+109
-74
@@ -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
|
||||||
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
BRANCH
|
||||||
arg0: GET_VAR 'tmp0_subject: Any?' type=kotlin.Any? origin=null
|
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
||||||
arg1: CONST Null type=kotlin.Nothing? value='null'
|
arg0: GET_VAR 'tmp0_subject: Any?' type=kotlin.Any? origin=null
|
||||||
then: CONST String type=kotlin.String value='null'
|
arg1: CONST Null type=kotlin.Nothing? value='null'
|
||||||
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
then: CONST String type=kotlin.String value='null'
|
||||||
arg0: GET_VAR 'tmp0_subject: Any?' type=kotlin.Any? origin=null
|
BRANCH
|
||||||
arg1: GET_OBJECT 'A' type=A
|
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
||||||
then: CONST String type=kotlin.String value='A'
|
arg0: GET_VAR 'tmp0_subject: Any?' type=kotlin.Any? origin=null
|
||||||
if: TYPE_OP origin=INSTANCEOF typeOperand=kotlin.String
|
arg1: GET_OBJECT 'A' type=A
|
||||||
GET_VAR 'tmp0_subject: Any?' type=kotlin.Any? origin=null
|
then: CONST String type=kotlin.String value='A'
|
||||||
then: CONST String type=kotlin.String value='String'
|
BRANCH
|
||||||
if: CALL 'contains(Any) on Iterable<Any>: Boolean' type=kotlin.Boolean origin=IN
|
if: TYPE_OP origin=INSTANCEOF typeOperand=kotlin.String
|
||||||
<T>: Any
|
GET_VAR 'tmp0_subject: Any?' type=kotlin.Any? origin=null
|
||||||
$receiver: CALL 'setOf(): Set<Nothing>' type=kotlin.collections.Set<kotlin.Nothing> origin=null
|
then: CONST String type=kotlin.String value='String'
|
||||||
<T>: Nothing
|
BRANCH
|
||||||
element: GET_VAR 'tmp0_subject: Any?' type=kotlin.Any? origin=null
|
if: CALL 'contains(Any) on Iterable<Any>: Boolean' type=kotlin.Boolean origin=IN
|
||||||
then: CONST String type=kotlin.String value='nothingness?'
|
<T>: Any
|
||||||
else: CONST String type=kotlin.String value='something'
|
$receiver: CALL 'setOf(): Set<Nothing>' type=kotlin.collections.Set<kotlin.Nothing> origin=null
|
||||||
|
<T>: Nothing
|
||||||
|
element: GET_VAR 'tmp0_subject: Any?' type=kotlin.Any? origin=null
|
||||||
|
then: CONST String type=kotlin.String value='nothingness?'
|
||||||
|
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
|
||||||
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
BRANCH
|
||||||
arg0: GET_VAR 'value-parameter x: Any?' type=kotlin.Any? origin=null
|
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
||||||
arg1: CONST Null type=kotlin.Nothing? value='null'
|
arg0: GET_VAR 'value-parameter x: Any?' type=kotlin.Any? origin=null
|
||||||
then: CONST String type=kotlin.String value='null'
|
arg1: CONST Null type=kotlin.Nothing? value='null'
|
||||||
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
then: CONST String type=kotlin.String value='null'
|
||||||
arg0: GET_VAR 'value-parameter x: Any?' type=kotlin.Any? origin=null
|
BRANCH
|
||||||
arg1: GET_OBJECT 'A' type=A
|
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
||||||
then: CONST String type=kotlin.String value='A'
|
arg0: GET_VAR 'value-parameter x: Any?' type=kotlin.Any? origin=null
|
||||||
if: TYPE_OP origin=INSTANCEOF typeOperand=kotlin.String
|
arg1: GET_OBJECT 'A' type=A
|
||||||
GET_VAR 'value-parameter x: Any?' type=kotlin.Any? origin=null
|
then: CONST String type=kotlin.String value='A'
|
||||||
then: CONST String type=kotlin.String value='String'
|
BRANCH
|
||||||
if: CALL 'contains(Any) on Iterable<Any>: Boolean' type=kotlin.Boolean origin=IN
|
if: TYPE_OP origin=INSTANCEOF typeOperand=kotlin.String
|
||||||
<T>: Any
|
GET_VAR 'value-parameter x: Any?' type=kotlin.Any? origin=null
|
||||||
$receiver: CALL 'setOf(): Set<Nothing>' type=kotlin.collections.Set<kotlin.Nothing> origin=null
|
then: CONST String type=kotlin.String value='String'
|
||||||
<T>: Nothing
|
BRANCH
|
||||||
element: GET_VAR 'value-parameter x: Any?' type=kotlin.Any? origin=null
|
if: CALL 'contains(Any) on Iterable<Any>: Boolean' type=kotlin.Boolean origin=IN
|
||||||
then: CONST String type=kotlin.String value='nothingness?'
|
<T>: Any
|
||||||
else: CONST String type=kotlin.String value='something'
|
$receiver: CALL 'setOf(): Set<Nothing>' type=kotlin.collections.Set<kotlin.Nothing> origin=null
|
||||||
|
<T>: Nothing
|
||||||
|
element: GET_VAR 'value-parameter x: Any?' type=kotlin.Any? origin=null
|
||||||
|
then: CONST String type=kotlin.String value='nothingness?'
|
||||||
|
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
|
||||||
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
|
||||||
if: WHEN type=kotlin.Boolean origin=WHEN_COMMA
|
BRANCH
|
||||||
|
if: WHEN type=kotlin.Boolean origin=WHEN_COMMA
|
||||||
|
BRANCH
|
||||||
|
if: WHEN type=kotlin.Boolean origin=WHEN_COMMA
|
||||||
|
BRANCH
|
||||||
|
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
||||||
|
arg0: GET_VAR 'tmp0_subject: Int' type=kotlin.Int origin=null
|
||||||
|
arg1: CONST Int type=kotlin.Int value='1'
|
||||||
|
then: CONST Boolean type=kotlin.Boolean value='true'
|
||||||
|
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
|
||||||
|
arg1: CONST Int type=kotlin.Int value='2'
|
||||||
|
then: CONST Boolean type=kotlin.Boolean value='true'
|
||||||
|
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
|
||||||
|
arg1: CONST Int type=kotlin.Int value='3'
|
||||||
|
then: CONST Boolean type=kotlin.Boolean value='true'
|
||||||
|
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
|
||||||
|
arg1: CONST Int type=kotlin.Int value='4'
|
||||||
|
then: CONST String type=kotlin.String value='1234'
|
||||||
|
BRANCH
|
||||||
|
if: WHEN type=kotlin.Boolean origin=WHEN_COMMA
|
||||||
|
BRANCH
|
||||||
|
if: WHEN type=kotlin.Boolean origin=WHEN_COMMA
|
||||||
|
BRANCH
|
||||||
|
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
||||||
|
arg0: GET_VAR 'tmp0_subject: Int' type=kotlin.Int origin=null
|
||||||
|
arg1: CONST Int type=kotlin.Int value='5'
|
||||||
|
then: CONST Boolean type=kotlin.Boolean value='true'
|
||||||
|
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
|
||||||
|
arg1: CONST Int type=kotlin.Int value='6'
|
||||||
|
then: CONST Boolean type=kotlin.Boolean value='true'
|
||||||
|
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
|
||||||
|
arg1: CONST Int type=kotlin.Int value='7'
|
||||||
|
then: CONST String type=kotlin.String value='567'
|
||||||
|
BRANCH
|
||||||
|
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='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='2'
|
arg1: CONST Int type=kotlin.Int value='9'
|
||||||
then: CONST Boolean type=kotlin.Boolean value='true'
|
then: CONST String type=kotlin.String value='89'
|
||||||
else: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
BRANCH
|
||||||
arg0: GET_VAR 'tmp0_subject: Int' type=kotlin.Int origin=null
|
if: CONST Boolean type=kotlin.Boolean value='true'
|
||||||
arg1: CONST Int type=kotlin.Int value='3'
|
then: CONST String type=kotlin.String value='?'
|
||||||
then: CONST Boolean type=kotlin.Boolean value='true'
|
|
||||||
else: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
|
||||||
arg0: GET_VAR 'tmp0_subject: Int' type=kotlin.Int origin=null
|
|
||||||
arg1: CONST Int type=kotlin.Int value='4'
|
|
||||||
then: CONST String type=kotlin.String value='1234'
|
|
||||||
if: WHEN type=kotlin.Boolean origin=WHEN_COMMA
|
|
||||||
if: WHEN type=kotlin.Boolean origin=WHEN_COMMA
|
|
||||||
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
|
||||||
arg0: GET_VAR 'tmp0_subject: Int' type=kotlin.Int origin=null
|
|
||||||
arg1: CONST Int type=kotlin.Int value='5'
|
|
||||||
then: CONST Boolean type=kotlin.Boolean value='true'
|
|
||||||
else: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
|
||||||
arg0: GET_VAR 'tmp0_subject: Int' type=kotlin.Int origin=null
|
|
||||||
arg1: CONST Int type=kotlin.Int value='6'
|
|
||||||
then: CONST Boolean type=kotlin.Boolean value='true'
|
|
||||||
else: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
|
||||||
arg0: GET_VAR 'tmp0_subject: Int' type=kotlin.Int origin=null
|
|
||||||
arg1: CONST Int type=kotlin.Int value='7'
|
|
||||||
then: CONST String type=kotlin.String value='567'
|
|
||||||
if: WHEN type=kotlin.Boolean origin=WHEN_COMMA
|
|
||||||
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
|
||||||
arg0: GET_VAR 'tmp0_subject: Int' type=kotlin.Int origin=null
|
|
||||||
arg1: CONST Int type=kotlin.Int value='8'
|
|
||||||
then: CONST Boolean type=kotlin.Boolean value='true'
|
|
||||||
else: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
|
||||||
arg0: GET_VAR 'tmp0_subject: Int' type=kotlin.Int origin=null
|
|
||||||
arg1: CONST Int type=kotlin.Int value='9'
|
|
||||||
then: CONST String type=kotlin.String value='89'
|
|
||||||
else: CONST String type=kotlin.String value='?'
|
|
||||||
|
|||||||
+3
-1
@@ -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'
|
||||||
|
|||||||
+13
-12
@@ -71,15 +71,16 @@ 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
|
||||||
if: TYPE_OP origin=INSTANCEOF typeOperand=kotlin.Boolean
|
BRANCH
|
||||||
GET_VAR 'a: Any?' type=kotlin.Any? origin=null
|
if: TYPE_OP origin=INSTANCEOF typeOperand=kotlin.Boolean
|
||||||
then: BLOCK type=kotlin.Unit origin=null
|
GET_VAR 'a: Any?' type=kotlin.Any? origin=null
|
||||||
WHILE label=null origin=WHILE_LOOP
|
then: BLOCK type=kotlin.Unit origin=null
|
||||||
condition: TYPE_OP origin=IMPLICIT_CAST typeOperand=kotlin.Boolean
|
WHILE label=null origin=WHILE_LOOP
|
||||||
GET_VAR 'a: Any?' type=kotlin.Any? origin=null
|
condition: TYPE_OP origin=IMPLICIT_CAST typeOperand=kotlin.Boolean
|
||||||
body: BLOCK type=kotlin.Unit origin=null
|
GET_VAR 'a: Any?' type=kotlin.Any? origin=null
|
||||||
DO_WHILE label=null origin=DO_WHILE_LOOP
|
body: BLOCK type=kotlin.Unit origin=null
|
||||||
body: BLOCK type=kotlin.Unit origin=null
|
DO_WHILE label=null origin=DO_WHILE_LOOP
|
||||||
condition: TYPE_OP origin=IMPLICIT_CAST typeOperand=kotlin.Boolean
|
body: BLOCK type=kotlin.Unit origin=null
|
||||||
GET_VAR 'a: Any?' type=kotlin.Any? origin=null
|
condition: TYPE_OP origin=IMPLICIT_CAST typeOperand=kotlin.Boolean
|
||||||
|
GET_VAR 'a: Any?' type=kotlin.Any? origin=null
|
||||||
|
|||||||
+12
-10
@@ -34,11 +34,12 @@ 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
|
||||||
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
BRANCH
|
||||||
arg0: GET_VAR 'value-parameter it: Int' type=kotlin.Int origin=null
|
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
||||||
arg1: CONST Int type=kotlin.Int value='0'
|
arg0: GET_VAR 'value-parameter it: Int' type=kotlin.Int origin=null
|
||||||
then: RETURN type=kotlin.Nothing from='<anonymous>(Int): Unit'
|
arg1: CONST Int type=kotlin.Int value='0'
|
||||||
|
then: RETURN type=kotlin.Nothing from='<anonymous>(Int): Unit'
|
||||||
RETURN type=kotlin.Nothing from='<anonymous>(Int): Unit'
|
RETURN type=kotlin.Nothing from='<anonymous>(Int): Unit'
|
||||||
CALL 'print(Int): Unit' type=kotlin.Unit origin=null
|
CALL 'print(Int): Unit' type=kotlin.Unit origin=null
|
||||||
message: GET_VAR 'value-parameter it: Int' type=kotlin.Int origin=null
|
message: GET_VAR 'value-parameter it: Int' type=kotlin.Int origin=null
|
||||||
@@ -51,11 +52,12 @@ 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
|
||||||
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
BRANCH
|
||||||
arg0: GET_VAR 'value-parameter it: Int' type=kotlin.Int origin=null
|
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
||||||
arg1: CONST Int type=kotlin.Int value='0'
|
arg0: GET_VAR 'value-parameter it: Int' type=kotlin.Int origin=null
|
||||||
then: RETURN type=kotlin.Nothing from='<anonymous>(Int): Unit'
|
arg1: CONST Int type=kotlin.Int value='0'
|
||||||
|
then: RETURN type=kotlin.Nothing from='<anonymous>(Int): Unit'
|
||||||
RETURN type=kotlin.Nothing from='<anonymous>(Int): Unit'
|
RETURN type=kotlin.Nothing from='<anonymous>(Int): Unit'
|
||||||
CALL 'print(Int): Unit' type=kotlin.Unit origin=null
|
CALL 'print(Int): Unit' type=kotlin.Unit origin=null
|
||||||
message: GET_VAR 'value-parameter it: Int' type=kotlin.Int origin=null
|
message: GET_VAR 'value-parameter it: Int' type=kotlin.Int origin=null
|
||||||
|
|||||||
+13
-12
@@ -14,18 +14,19 @@ 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
|
||||||
if: CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ
|
BRANCH
|
||||||
arg0: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EXCLEQ
|
if: CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ
|
||||||
arg0: CALL 'get(Int): Double' type=kotlin.Double origin=GET_ARRAY_ELEMENT
|
arg0: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EXCLEQ
|
||||||
$this: GET_VAR 'a: DoubleArray' type=kotlin.DoubleArray origin=null
|
arg0: CALL 'get(Int): Double' type=kotlin.Double origin=GET_ARRAY_ELEMENT
|
||||||
index: GET_VAR 'i: Int' type=kotlin.Int origin=null
|
$this: GET_VAR 'a: DoubleArray' type=kotlin.DoubleArray origin=null
|
||||||
arg1: CALL 'next(): Double' type=kotlin.Double origin=null
|
index: GET_VAR 'i: Int' type=kotlin.Int origin=null
|
||||||
$this: GET_VAR 'x: DoubleIterator' type=kotlin.collections.DoubleIterator origin=null
|
arg1: CALL 'next(): Double' type=kotlin.Double origin=null
|
||||||
then: RETURN type=kotlin.Nothing from='box(): String'
|
$this: GET_VAR 'x: DoubleIterator' type=kotlin.collections.DoubleIterator origin=null
|
||||||
STRING_CONCATENATION type=kotlin.String
|
then: RETURN type=kotlin.Nothing from='box(): String'
|
||||||
CONST String type=kotlin.String value='Fail '
|
STRING_CONCATENATION type=kotlin.String
|
||||||
GET_VAR 'i: Int' type=kotlin.Int origin=null
|
CONST String type=kotlin.String value='Fail '
|
||||||
|
GET_VAR 'i: Int' type=kotlin.Int origin=null
|
||||||
BLOCK type=kotlin.Int origin=POSTFIX_INCR
|
BLOCK type=kotlin.Int origin=POSTFIX_INCR
|
||||||
VAR IR_TEMPORARY_VARIABLE val tmp0: kotlin.Int
|
VAR IR_TEMPORARY_VARIABLE val tmp0: kotlin.Int
|
||||||
GET_VAR 'i: Int' type=kotlin.Int origin=POSTFIX_INCR
|
GET_VAR 'i: Int' type=kotlin.Int origin=POSTFIX_INCR
|
||||||
|
|||||||
Reference in New Issue
Block a user