IrBlockBody

Change block typing contract.
This commit is contained in:
Dmitry Petrov
2016-08-25 14:19:37 +03:00
committed by Dmitry Petrov
parent 8bef05703e
commit be86739d3a
72 changed files with 1882 additions and 2040 deletions
@@ -17,35 +17,37 @@
package org.jetbrains.kotlin.psi2ir.generators package org.jetbrains.kotlin.psi2ir.generators
import org.jetbrains.kotlin.descriptors.CallableDescriptor import org.jetbrains.kotlin.descriptors.CallableDescriptor
import org.jetbrains.kotlin.ir.expressions.IrBlockImpl import org.jetbrains.kotlin.ir.expressions.*
import org.jetbrains.kotlin.ir.expressions.IrExpression
import org.jetbrains.kotlin.ir.expressions.IrLoop
import org.jetbrains.kotlin.ir.expressions.IrReturnImpl
import org.jetbrains.kotlin.psi.KtBlockExpression import org.jetbrains.kotlin.psi.KtBlockExpression
import org.jetbrains.kotlin.psi.KtExpression import org.jetbrains.kotlin.psi.KtExpression
import org.jetbrains.kotlin.psi.psiUtil.endOffset import org.jetbrains.kotlin.psi.psiUtil.endOffset
import org.jetbrains.kotlin.psi.psiUtil.startOffset import org.jetbrains.kotlin.psi.psiUtil.startOffset
import java.util.* import java.util.*
class ExpressionBodyGenerator(val scopeOwner: CallableDescriptor, override val context: GeneratorContext): GeneratorWithScope { class BodyGenerator(val scopeOwner: CallableDescriptor, override val context: GeneratorContext): GeneratorWithScope {
override val scope = Scope(scopeOwner) override val scope = Scope(scopeOwner)
private val loopTable = HashMap<KtExpression, IrLoop>() private val loopTable = HashMap<KtExpression, IrLoop>()
fun generateFunctionBody(ktBody: KtExpression): IrExpression { fun generateFunctionBody(ktBody: KtExpression): IrBody {
resetInternalContext() resetInternalContext()
val irBodyExpression = createStatementGenerator().generateExpression(ktBody) val statementGenerator = createStatementGenerator()
val irBodyExpressionAsBlock = val irBlockBody = IrBlockBodyImpl(ktBody.startOffset, ktBody.endOffset)
if (ktBody is KtBlockExpression) if (ktBody is KtBlockExpression) {
irBodyExpression for (ktStatement in ktBody.statements) {
else IrBlockImpl(ktBody.startOffset, ktBody.endOffset, null, false).apply { irBlockBody.addStatement(statementGenerator.generateStatement(ktStatement))
addStatement(IrReturnImpl(ktBody.startOffset, ktBody.endOffset, scopeOwner, irBodyExpression)) }
} }
else {
val irBodyExpression = statementGenerator.generateExpression(ktBody)
val irReturn = IrReturnImpl(ktBody.startOffset, ktBody.endOffset, scopeOwner, irBodyExpression)
irBlockBody.addStatement(irReturn)
}
postprocessFunctionBody() postprocessFunctionBody()
return irBodyExpressionAsBlock return irBlockBody
} }
private fun resetInternalContext() { private fun resetInternalContext() {
@@ -55,8 +57,9 @@ class ExpressionBodyGenerator(val scopeOwner: CallableDescriptor, override val c
private fun postprocessFunctionBody() { private fun postprocessFunctionBody() {
} }
fun generatePropertyInitializerBody(ktInitializer: KtExpression): IrExpression = fun generatePropertyInitializerBody(ktInitializer: KtExpression): IrBody =
createStatementGenerator().generateExpression(ktInitializer) IrExpressionBodyImpl(ktInitializer.startOffset, ktInitializer.endOffset,
createStatementGenerator().generateExpression(ktInitializer))
private fun createStatementGenerator() = private fun createStatementGenerator() =
StatementGenerator(context, scopeOwner, this, scope) StatementGenerator(context, scopeOwner, this, scope)
@@ -23,7 +23,6 @@ import org.jetbrains.kotlin.psi.psiUtil.endOffset
import org.jetbrains.kotlin.psi.psiUtil.startOffset 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.psi2ir.generators.getInfixOperator
import org.jetbrains.kotlin.resolve.BindingContext import org.jetbrains.kotlin.resolve.BindingContext
import org.jetbrains.kotlin.utils.SmartList import org.jetbrains.kotlin.utils.SmartList
import java.lang.AssertionError import java.lang.AssertionError
@@ -107,18 +106,18 @@ class BranchingExpressionGenerator(val statementGenerator: StatementGenerator) :
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) if (irWhen.branchesCount == 0)
return IrBlockImpl(expression.startOffset, expression.endOffset, null, false, IrOperator.WHEN) return IrBlockImpl(expression.startOffset, expression.endOffset, context.builtIns.unitType, IrOperator.WHEN)
else else
return irWhen return irWhen
} }
else { else {
if (irWhen.branchesCount == 0) { if (irWhen.branchesCount == 0) {
val irBlock = IrBlockImpl(expression.startOffset, expression.endOffset, null, false, IrOperator.WHEN) val irBlock = IrBlockImpl(expression.startOffset, expression.endOffset, context.builtIns.unitType, IrOperator.WHEN)
irBlock.addStatement(irSubject) irBlock.addStatement(irSubject)
return irBlock return irBlock
} }
else { else {
val irBlock = IrBlockImpl(expression.startOffset, expression.endOffset, irWhen.type, true, IrOperator.WHEN) val irBlock = IrBlockImpl(expression.startOffset, expression.endOffset, irWhen.type, IrOperator.WHEN)
irBlock.addStatement(irSubject) irBlock.addStatement(irSubject)
irBlock.addStatement(irWhen) irBlock.addStatement(irWhen)
return irBlock return irBlock
@@ -68,19 +68,17 @@ fun StatementGenerator.generateCallReceiver(
val dispatchReceiverValue = generateReceiverOrNull(ktDefaultElement, dispatchReceiver) val dispatchReceiverValue = generateReceiverOrNull(ktDefaultElement, dispatchReceiver)
val extensionReceiverValue = generateReceiverOrNull(ktDefaultElement, extensionReceiver) val extensionReceiverValue = generateReceiverOrNull(ktDefaultElement, extensionReceiver)
if (!isSafe) { return when {
return SimpleCallReceiver(dispatchReceiverValue, extensionReceiverValue) !isSafe ->
} SimpleCallReceiver(dispatchReceiverValue, extensionReceiverValue)
else if (extensionReceiverValue != null) { extensionReceiverValue != null ->
return SafeCallReceiver(this, ktDefaultElement.startOffset, ktDefaultElement.endOffset, SafeCallReceiver(this, ktDefaultElement.startOffset, ktDefaultElement.endOffset,
extensionReceiverValue.load(), dispatchReceiverValue) extensionReceiverValue.load(), dispatchReceiverValue)
} dispatchReceiverValue != null ->
else if (dispatchReceiverValue != null) { SafeCallReceiver(this, ktDefaultElement.startOffset, ktDefaultElement.endOffset,
return SafeCallReceiver(this, ktDefaultElement.startOffset, ktDefaultElement.endOffset, dispatchReceiverValue.load(), null)
dispatchReceiverValue.load(), null) else ->
} throw AssertionError("Safe call should have an explicit receiver: ${ktDefaultElement.text}")
else {
return throw AssertionError("Safe call should have an explicit receiver: ${ktDefaultElement.text}")
} }
} }
@@ -118,7 +118,7 @@ class CallGenerator(
val valueArgumentsInEvaluationOrder = resolvedCall.valueArguments.values val valueArgumentsInEvaluationOrder = resolvedCall.valueArguments.values
val valueParameters = resolvedCall.resultingDescriptor.valueParameters val valueParameters = resolvedCall.resultingDescriptor.valueParameters
val irBlock = IrBlockImpl(startOffset, endOffset, resultType, true, IrOperator.SYNTHETIC_BLOCK) val irBlock = IrBlockImpl(startOffset, endOffset, resultType, IrOperator.ARGUMENTS_REORDERING_FOR_CALL)
val valueArgumentsToValueParameters = HashMap<ResolvedValueArgument, ValueParameterDescriptor>() val valueArgumentsToValueParameters = HashMap<ResolvedValueArgument, ValueParameterDescriptor>()
for ((index, valueArgument) in resolvedCall.valueArgumentsByIndex!!.withIndex()) { for ((index, valueArgument) in resolvedCall.valueArgumentsByIndex!!.withIndex()) {
@@ -25,10 +25,6 @@ import org.jetbrains.kotlin.psi.psiUtil.startOffset
import org.jetbrains.kotlin.resolve.BindingContext import org.jetbrains.kotlin.resolve.BindingContext
class DeclarationGenerator(override val context: GeneratorContext) : Generator { class DeclarationGenerator(override val context: GeneratorContext) : Generator {
fun generateAnnotationEntries(annotationEntries: List<KtAnnotationEntry>) {
// TODO create IrAnnotation's for each KtAnnotationEntry
}
fun generateMemberDeclaration(ktDeclaration: KtDeclaration): IrDeclaration = fun generateMemberDeclaration(ktDeclaration: KtDeclaration): IrDeclaration =
when (ktDeclaration) { when (ktDeclaration) {
is KtNamedFunction -> is KtNamedFunction ->
@@ -122,10 +118,8 @@ class DeclarationGenerator(override val context: GeneratorContext) : Generator {
} }
private fun generateFunctionBody(scopeOwner: CallableDescriptor, ktBody: KtExpression): IrBody = private fun generateFunctionBody(scopeOwner: CallableDescriptor, ktBody: KtExpression): IrBody =
IrExpressionBodyImpl(ktBody.startOffset, ktBody.endOffset, BodyGenerator(scopeOwner, context).generateFunctionBody(ktBody)
ExpressionBodyGenerator(scopeOwner, context).generateFunctionBody(ktBody))
private fun generateInitializerBody(scopeOwner: CallableDescriptor, ktBody: KtExpression): IrBody = private fun generateInitializerBody(scopeOwner: CallableDescriptor, ktBody: KtExpression): IrBody =
IrExpressionBodyImpl(ktBody.startOffset, ktBody.endOffset, BodyGenerator(scopeOwner, context).generatePropertyInitializerBody(ktBody)
ExpressionBodyGenerator(scopeOwner, context).generatePropertyInitializerBody(ktBody))
} }
@@ -19,10 +19,12 @@ package org.jetbrains.kotlin.psi2ir.generators
import org.jetbrains.kotlin.descriptors.CallableDescriptor import org.jetbrains.kotlin.descriptors.CallableDescriptor
import org.jetbrains.kotlin.descriptors.ClassDescriptor import org.jetbrains.kotlin.descriptors.ClassDescriptor
import org.jetbrains.kotlin.ir.expressions.IrDummyExpression import org.jetbrains.kotlin.ir.expressions.IrDummyExpression
import org.jetbrains.kotlin.psi.* import org.jetbrains.kotlin.psi.KtBlockExpression
import org.jetbrains.kotlin.psi.KtConstantExpression
import org.jetbrains.kotlin.psi.KtExpression
import org.jetbrains.kotlin.psi.KtStringTemplateExpression
import org.jetbrains.kotlin.psi.psiUtil.endOffset import org.jetbrains.kotlin.psi.psiUtil.endOffset
import org.jetbrains.kotlin.psi.psiUtil.startOffset import org.jetbrains.kotlin.psi.psiUtil.startOffset
import org.jetbrains.kotlin.resolve.BindingContext
import org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCall import org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCall
import org.jetbrains.kotlin.resolve.calls.callUtil.isSafeCall import org.jetbrains.kotlin.resolve.calls.callUtil.isSafeCall
import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall
@@ -58,9 +60,6 @@ fun Generator.getInferredTypeWithSmartcasts(key: KtExpression): KotlinType? =
fun Generator.getInferredTypeWithSmartcastsOrFail(key: KtExpression): KotlinType = fun Generator.getInferredTypeWithSmartcastsOrFail(key: KtExpression): KotlinType =
getInferredTypeWithSmartcasts(key) ?: throw AssertionError("No type for expression: ${key.text}") getInferredTypeWithSmartcasts(key) ?: throw AssertionError("No type for expression: ${key.text}")
fun Generator.isUsedAsExpression(ktElement: KtElement) =
get(BindingContext.USED_AS_EXPRESSION, ktElement) ?: false
fun Generator.getResolvedCall(key: KtExpression): ResolvedCall<out CallableDescriptor>? = fun Generator.getResolvedCall(key: KtExpression): ResolvedCall<out CallableDescriptor>? =
key.getResolvedCall(context.bindingContext) key.getResolvedCall(context.bindingContext)
@@ -70,20 +69,17 @@ fun Generator.getReturnType(key: KtExpression): KotlinType? {
return getReturnType(resolvedCall) return getReturnType(resolvedCall)
} }
if (key is KtBlockExpression) { return when (key) {
if (!isUsedAsExpression(key)) return null is KtBlockExpression ->
return getReturnType(key.statements.last()) getReturnType(key.statements.last())
is KtConstantExpression ->
getInferredTypeWithSmartcasts(key)
is KtStringTemplateExpression ->
context.builtIns.stringType
else ->
throw AssertionError("Unexpected expression: $key")
} }
if (key is KtConstantExpression) {
return getInferredTypeWithSmartcasts(key)
}
if (key is KtStringTemplateExpression) {
return context.builtIns.stringType
}
throw AssertionError("Unexpected expression: $key")
} }
fun getReturnType(resolvedCall: ResolvedCall<*>): KotlinType { fun getReturnType(resolvedCall: ResolvedCall<*>): KotlinType {
@@ -38,7 +38,7 @@ class LoopExpressionGenerator(val statementGenerator: StatementGenerator) : Gene
generateConditionalLoop(ktDoWhile, IrDoWhileLoopImpl(ktDoWhile.startOffset, ktDoWhile.endOffset, IrOperator.DO_WHILE_LOOP)) generateConditionalLoop(ktDoWhile, IrDoWhileLoopImpl(ktDoWhile.startOffset, ktDoWhile.endOffset, IrOperator.DO_WHILE_LOOP))
private fun generateConditionalLoop(ktLoop: KtWhileExpressionBase, irLoop: IrLoopBase): IrLoop { private fun generateConditionalLoop(ktLoop: KtWhileExpressionBase, irLoop: IrLoopBase): IrLoop {
statementGenerator.expressionBodyGenerator.putLoop(ktLoop, irLoop) statementGenerator.bodyGenerator.putLoop(ktLoop, irLoop)
irLoop.condition = statementGenerator.generateExpression(ktLoop.condition!!) irLoop.condition = statementGenerator.generateExpression(ktLoop.condition!!)
irLoop.body = statementGenerator.generateExpression(ktLoop.body!!) irLoop.body = statementGenerator.generateExpression(ktLoop.body!!)
irLoop.label = getLoopLabel(ktLoop) irLoop.label = getLoopLabel(ktLoop)
@@ -89,7 +89,7 @@ class LoopExpressionGenerator(val statementGenerator: StatementGenerator) : Gene
} }
private fun getLoop(ktLoop: KtLoopExpression): IrLoop { private fun getLoop(ktLoop: KtLoopExpression): IrLoop {
return statementGenerator.expressionBodyGenerator.getLoop(ktLoop) ?: return statementGenerator.bodyGenerator.getLoop(ktLoop) ?:
throw AssertionError("Loop was not visited:\n${ktLoop.text}") throw AssertionError("Loop was not visited:\n${ktLoop.text}")
} }
@@ -108,7 +108,7 @@ class LoopExpressionGenerator(val statementGenerator: StatementGenerator) : Gene
val callGenerator = CallGenerator(statementGenerator) val callGenerator = CallGenerator(statementGenerator)
val irForBlock = IrBlockImpl(ktFor.startOffset, ktFor.endOffset, context.builtIns.unitType, false, IrOperator.FOR_LOOP) val irForBlock = IrBlockImpl(ktFor.startOffset, ktFor.endOffset, context.builtIns.unitType, IrOperator.FOR_LOOP)
val iteratorCall = statementGenerator.pregenerateCall(iteratorResolvedCall) val iteratorCall = statementGenerator.pregenerateCall(iteratorResolvedCall)
val irIteratorCall = callGenerator.generateCall(ktLoopRange, iteratorCall, IrOperator.FOR_LOOP_ITERATOR) val irIteratorCall = callGenerator.generateCall(ktLoopRange, iteratorCall, IrOperator.FOR_LOOP_ITERATOR)
@@ -118,7 +118,7 @@ class LoopExpressionGenerator(val statementGenerator: StatementGenerator) : Gene
val irInnerWhile = IrWhileLoopImpl(ktFor.startOffset, ktFor.endOffset, IrOperator.FOR_LOOP_INNER_WHILE) val irInnerWhile = IrWhileLoopImpl(ktFor.startOffset, ktFor.endOffset, IrOperator.FOR_LOOP_INNER_WHILE)
irInnerWhile.label = getLoopLabel(ktFor) irInnerWhile.label = getLoopLabel(ktFor)
statementGenerator.expressionBodyGenerator.putLoop(ktFor, irInnerWhile) statementGenerator.bodyGenerator.putLoop(ktFor, irInnerWhile)
irForBlock.addStatement(irInnerWhile) irForBlock.addStatement(irInnerWhile)
val hasNextCall = statementGenerator.pregenerateCall(hasNextResolvedCall) val hasNextCall = statementGenerator.pregenerateCall(hasNextResolvedCall)
@@ -126,7 +126,7 @@ class LoopExpressionGenerator(val statementGenerator: StatementGenerator) : Gene
val irHasNextCall = callGenerator.generateCall(ktLoopRange, hasNextCall, IrOperator.FOR_LOOP_HAS_NEXT) val irHasNextCall = callGenerator.generateCall(ktLoopRange, hasNextCall, IrOperator.FOR_LOOP_HAS_NEXT)
irInnerWhile.condition = irHasNextCall irInnerWhile.condition = irHasNextCall
val irInnerBody = IrBlockImpl(ktFor.startOffset, ktFor.endOffset, context.builtIns.unitType, false, IrOperator.FOR_LOOP_INNER_WHILE) val irInnerBody = IrBlockImpl(ktFor.startOffset, ktFor.endOffset, context.builtIns.unitType, IrOperator.FOR_LOOP_INNER_WHILE)
irInnerWhile.body = irInnerBody irInnerWhile.body = irInnerBody
val nextCall = statementGenerator.pregenerateCall(nextResolvedCall) val nextCall = statementGenerator.pregenerateCall(nextResolvedCall)
@@ -117,7 +117,7 @@ class OperatorExpressionGenerator(
val irArgument0 = statementGenerator.generateExpression(expression.left!!) val irArgument0 = statementGenerator.generateExpression(expression.left!!)
val irArgument1 = statementGenerator.generateExpression(expression.right!!) val irArgument1 = statementGenerator.generateExpression(expression.right!!)
val irBlock = IrBlockImpl(expression.startOffset, expression.endOffset, returnType, true, IrOperator.ELVIS) val irBlock = IrBlockImpl(expression.startOffset, expression.endOffset, returnType, IrOperator.ELVIS)
val irArgument0Value = createRematerializableOrTemporary(scope, irArgument0, irBlock, "elvis_lhs") val irArgument0Value = createRematerializableOrTemporary(scope, irArgument0, irBlock, "elvis_lhs")
irBlock.addStatement(IrIfThenElseImpl( irBlock.addStatement(IrIfThenElseImpl(
expression.startOffset, expression.endOffset, returnType, expression.startOffset, expression.endOffset, returnType,
@@ -225,7 +225,7 @@ class OperatorExpressionGenerator(
val irAssignmentReceiver = generateAssignmentReceiver(ktBaseExpression, irOperator) val irAssignmentReceiver = generateAssignmentReceiver(ktBaseExpression, irOperator)
return irAssignmentReceiver.assign { irLValue -> return irAssignmentReceiver.assign { irLValue ->
val irBlock = IrBlockImpl(expression.startOffset, expression.endOffset, irLValue.type, true, irOperator) val irBlock = IrBlockImpl(expression.startOffset, expression.endOffset, irLValue.type, irOperator)
// VAR tmp = [lhs].inc() // VAR tmp = [lhs].inc()
val opCall = statementGenerator.pregenerateCall(opResolvedCall) val opCall = statementGenerator.pregenerateCall(opResolvedCall)
@@ -250,7 +250,7 @@ class OperatorExpressionGenerator(
val irAssignmentReceiver = generateAssignmentReceiver(ktBaseExpression, irOperator) val irAssignmentReceiver = generateAssignmentReceiver(ktBaseExpression, irOperator)
return irAssignmentReceiver.assign { irLValue -> return irAssignmentReceiver.assign { irLValue ->
val irBlock = IrBlockImpl(expression.startOffset, expression.endOffset, irLValue.type, true, irOperator) val irBlock = IrBlockImpl(expression.startOffset, expression.endOffset, irLValue.type, irOperator)
// VAR tmp = [lhs] // VAR tmp = [lhs]
val irTmp = scope.createTemporaryVariable(irLValue.load()) val irTmp = scope.createTemporaryVariable(irLValue.load())
@@ -40,14 +40,16 @@ import org.jetbrains.kotlin.resolve.constants.StringValue
import org.jetbrains.kotlin.resolve.constants.evaluate.ConstantExpressionEvaluator import org.jetbrains.kotlin.resolve.constants.evaluate.ConstantExpressionEvaluator
import org.jetbrains.kotlin.resolve.descriptorUtil.classValueType import org.jetbrains.kotlin.resolve.descriptorUtil.classValueType
import org.jetbrains.kotlin.types.expressions.ExpressionTypingUtils import org.jetbrains.kotlin.types.expressions.ExpressionTypingUtils
import java.lang.AssertionError
class StatementGenerator( class StatementGenerator(
override val context: GeneratorContext, override val context: GeneratorContext,
val scopeOwner: DeclarationDescriptor, val scopeOwner: DeclarationDescriptor,
val expressionBodyGenerator: ExpressionBodyGenerator, val bodyGenerator: BodyGenerator,
override val scope: Scope override val scope: Scope
) : KtVisitor<IrStatement, Nothing?>(), GeneratorWithScope { ) : KtVisitor<IrStatement, Nothing?>(), GeneratorWithScope {
fun generateStatement(ktElement: KtElement): IrStatement =
ktElement.genStmt()
fun generateExpression(ktExpression: KtExpression): IrExpression = fun generateExpression(ktExpression: KtExpression): IrExpression =
ktExpression.genExpr() ktExpression.genExpr()
@@ -73,7 +75,8 @@ class StatementGenerator(
override fun visitDestructuringDeclaration(multiDeclaration: KtDestructuringDeclaration, data: Nothing?): IrStatement { override fun visitDestructuringDeclaration(multiDeclaration: KtDestructuringDeclaration, data: Nothing?): IrStatement {
// TODO use some special form that introduces multiple declarations into surrounding scope? // TODO use some special form that introduces multiple declarations into surrounding scope?
val irBlock = IrBlockImpl(multiDeclaration.startOffset, multiDeclaration.endOffset, null, false, IrOperator.SYNTHETIC_BLOCK) val irBlock = IrBlockImpl(multiDeclaration.startOffset, multiDeclaration.endOffset,
context.builtIns.unitType, IrOperator.DESTRUCTURING_DECLARATION)
val ktInitializer = multiDeclaration.initializer!! val ktInitializer = multiDeclaration.initializer!!
val containerValue = createRematerializableOrTemporary(scope, ktInitializer.genExpr(), irBlock, "container") val containerValue = createRematerializableOrTemporary(scope, ktInitializer.genExpr(), irBlock, "container")
@@ -100,11 +103,16 @@ class StatementGenerator(
} }
override fun visitBlockExpression(expression: KtBlockExpression, data: Nothing?): IrStatement { override fun visitBlockExpression(expression: KtBlockExpression, data: Nothing?): IrStatement {
val isBlockBody = expression.parent is KtNamedFunction val isBlockBody = expression.parent is KtDeclarationWithBody && expression.parent !is KtFunctionLiteral
val hasResult = if (isBlockBody) false else isUsedAsExpression(expression) if (isBlockBody) throw AssertionError("Use IrBlockBody and corresponding body generator to generate blocks as function bodies")
val returnType = if (isBlockBody || !hasResult) null else getReturnType(expression)
val irBlock = IrBlockImpl(expression.startOffset, expression.endOffset, returnType, hasResult) val returnType = getInferredTypeWithSmartcasts(expression) ?: context.builtIns.unitType
expression.statements.forEach { irBlock.addStatement(it.genStmt()) } val irBlock = IrBlockImpl(expression.startOffset, expression.endOffset, returnType)
expression.statements.forEach {
irBlock.addStatement(it.genStmt())
}
return irBlock return irBlock
} }
@@ -38,7 +38,7 @@ class ArrayAccessAssignmentReceiver(
override fun assign(withLValue: (LValue) -> IrExpression): IrExpression { override fun assign(withLValue: (LValue) -> IrExpression): IrExpression {
val hasResult = operator.isAssignmentOperatorWithResult() val hasResult = operator.isAssignmentOperatorWithResult()
val resultType = if (hasResult) type else callGenerator.context.builtIns.unitType val resultType = if (hasResult) type else callGenerator.context.builtIns.unitType
val irBlock = IrBlockImpl(startOffset, endOffset, resultType, hasResult, operator) val irBlock = IrBlockImpl(startOffset, endOffset, resultType, operator)
val irArrayValue = createRematerializableOrTemporary(callGenerator.scope, irArray, irBlock, "array") val irArrayValue = createRematerializableOrTemporary(callGenerator.scope, irArray, irBlock, "array")
@@ -51,7 +51,7 @@ class SafeCallReceiver(
val irResult = withDispatchAndExtensionReceivers(dispatchReceiverValue, extensionReceiverValue) val irResult = withDispatchAndExtensionReceivers(dispatchReceiverValue, extensionReceiverValue)
val resultType = irResult.type?.makeNullable() val resultType = irResult.type?.makeNullable()
val irBlock = IrBlockImpl(startOffset, endOffset, resultType, resultType != null, IrOperator.SAFE_CALL) val irBlock = IrBlockImpl(startOffset, endOffset, resultType, IrOperator.SAFE_CALL)
irBlock.addStatement(irTmp) irBlock.addStatement(irTmp)
@@ -79,7 +79,7 @@ class SimplePropertyLValue(
irResultExpression irResultExpression
} }
else { else {
val irBlock = IrBlockImpl(startOffset, endOffset, irResultExpression.type, irResultExpression.type != null, irOperator) val irBlock = IrBlockImpl(startOffset, endOffset, irResultExpression.type, irOperator)
irBlock.addAll(variablesForReceivers) irBlock.addAll(variablesForReceivers)
irBlock.addStatement(irResultExpression) irBlock.addStatement(irResultExpression)
irBlock irBlock
@@ -33,10 +33,7 @@ class InlineDesugaredBlocks : IrElementVisitor<Unit, Nothing?> {
} }
override fun visitBlock(expression: IrBlock, data: Nothing?) { override fun visitBlock(expression: IrBlock, data: Nothing?) {
val transformedBlock = IrBlockImpl( val transformedBlock = IrBlockImpl(expression.startOffset, expression.endOffset, expression.type, expression.operator)
expression.startOffset, expression.endOffset, expression.type,
expression.hasResult, expression.operator
)
for (statement in expression.statements) { for (statement in expression.statements) {
statement.accept(this, data) statement.accept(this, data)
if (statement is IrBlock && statement.operator != null) { if (statement is IrBlock && statement.operator != null) {
@@ -55,7 +55,7 @@ class InlineSafeCallChains(val context: GeneratorContext) : IrElementVisitor<Uni
if (innerNestedCallReturnType.containsNull()) return if (innerNestedCallReturnType.containsNull()) return
outer.root.replaceWith { outer.root.replaceWith {
val newBlock = IrBlockImpl(it.startOffset, it.endOffset, it.type, it.hasResult, IrOperator.SAFE_CALL) val newBlock = IrBlockImpl(it.startOffset, it.endOffset, it.type, IrOperator.SAFE_CALL)
newBlock.addStatement(inner.receiverVariable.detach()) newBlock.addStatement(inner.receiverVariable.detach())
val replaceWithValue = OnceExpressionValue(inner.nestedCall.detach()) val replaceWithValue = OnceExpressionValue(inner.nestedCall.detach())
@@ -29,7 +29,6 @@ import org.jetbrains.kotlin.types.checker.KotlinTypeChecker
import org.jetbrains.kotlin.types.isNullabilityFlexible import org.jetbrains.kotlin.types.isNullabilityFlexible
import org.jetbrains.kotlin.types.typeUtil.makeNotNullable import org.jetbrains.kotlin.types.typeUtil.makeNotNullable
import org.jetbrains.kotlin.types.upperIfFlexible import org.jetbrains.kotlin.types.upperIfFlexible
import java.lang.AssertionError
fun insertImplicitCasts(builtIns: KotlinBuiltIns, element: IrElement) { fun insertImplicitCasts(builtIns: KotlinBuiltIns, element: IrElement) {
element.accept(InsertImplicitCasts(builtIns), null) element.accept(InsertImplicitCasts(builtIns), null)
@@ -55,11 +54,13 @@ class InsertImplicitCasts(val builtIns: KotlinBuiltIns): IrElementVisitor<Unit,
override fun visitBlock(expression: IrBlock, data: Nothing?) { override fun visitBlock(expression: IrBlock, data: Nothing?) {
expression.acceptChildren(this, null) expression.acceptChildren(this, null)
if (!expression.hasResult || expression.type == null) return val type = expression.type
if (type == null || KotlinBuiltIns.isUnit(type)) return
if (expression.statements.isEmpty()) return
val lastStatement = expression.statements.last() val lastStatement = expression.statements.last()
if (lastStatement is IrExpression) { if (lastStatement is IrExpression) {
lastStatement.wrapWithImplicitCast(expression.type) lastStatement.replaceWithCast(type)
} }
} }
@@ -119,12 +120,12 @@ class InsertImplicitCasts(val builtIns: KotlinBuiltIns): IrElementVisitor<Unit,
} }
private fun IrExpression.wrapWithImplicitCast(expectedType: KotlinType?): IrExpression { private fun IrExpression.wrapWithImplicitCast(expectedType: KotlinType?): IrExpression {
if (this is IrBlock && !this.hasResult) return this if (this is IrBlock && this.type == null) return this
if (expectedType == null) return this if (expectedType == null) return this
if (expectedType.isError) return this if (expectedType.isError) return this
if (KotlinBuiltIns.isUnit(expectedType)) return this // TODO expose coercion to Unit in IR? if (KotlinBuiltIns.isUnit(expectedType)) return this // TODO expose coercion to Unit in IR?
val valueType = this.type ?: throw AssertionError("expectedType != null, valueType == null: $this") val valueType = this.type ?: return this
if (valueType.isNullabilityFlexible() && valueType.containsNull() && !expectedType.containsNull()) { if (valueType.isNullabilityFlexible() && valueType.containsNull() && !expectedType.containsNull()) {
val nonNullValueType = valueType.upperIfFlexible().makeNotNullable(); val nonNullValueType = valueType.upperIfFlexible().makeNotNullable();
@@ -30,8 +30,6 @@ interface IrClass : IrDeclaration {
override val descriptor: ClassDescriptor override val descriptor: ClassDescriptor
val children: List<IrClassElement> val children: List<IrClassElement>
fun addChild(child: IrClassElement)
} }
class IrClassImpl( class IrClassImpl(
@@ -42,7 +40,7 @@ class IrClassImpl(
) : IrDeclarationBase(startOffset, endOffset, originKind), IrClass { ) : IrDeclarationBase(startOffset, endOffset, originKind), IrClass {
override val children: MutableList<IrClassElement> = ArrayList() override val children: MutableList<IrClassElement> = ArrayList()
override fun addChild(child: IrClassElement) { fun addElement(child: IrClassElement) {
child.assertDetached() child.assertDetached()
child.setTreeLocation(this, children.size) child.setTreeLocation(this, children.size)
children.add(child) children.add(child)
@@ -23,7 +23,6 @@ import java.util.*
interface IrBlock : IrExpression { interface IrBlock : IrExpression {
val hasResult: Boolean
val operator: IrOperator? val operator: IrOperator?
val statements: List<IrStatement> val statements: List<IrStatement>
@@ -37,7 +36,6 @@ class IrBlockImpl(
startOffset: Int, startOffset: Int,
endOffset: Int, endOffset: Int,
type: KotlinType?, type: KotlinType?,
override val hasResult: Boolean,
override val operator: IrOperator? = null override val operator: IrOperator? = null
) : IrExpressionBase(startOffset, endOffset, type), IrBlock { ) : IrExpressionBase(startOffset, endOffset, type), IrBlock {
override val statements: MutableList<IrStatement> = ArrayList() override val statements: MutableList<IrStatement> = ArrayList()
@@ -18,6 +18,7 @@ package org.jetbrains.kotlin.ir.expressions
import org.jetbrains.kotlin.ir.* import org.jetbrains.kotlin.ir.*
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
import java.util.*
interface IrBody : IrElement interface IrBody : IrElement
@@ -25,15 +26,12 @@ interface IrExpressionBody : IrBody {
var expression: IrExpression var expression: IrExpression
} }
class IrExpressionBodyImpl( interface IrBlockBody : IrBody {
startOffset: Int, val statements: List<IrStatement>
endOffset: Int }
) : IrElementBase(startOffset, endOffset), IrExpressionBody {
constructor( class IrExpressionBodyImpl(startOffset: Int, endOffset: Int) : IrElementBase(startOffset, endOffset), IrExpressionBody {
startOffset: Int, constructor(startOffset: Int, endOffset: Int, expression: IrExpression) : this(startOffset, endOffset) {
endOffset: Int,
expression: IrExpression
) : this(startOffset, endOffset) {
this.expression = expression this.expression = expression
} }
@@ -66,3 +64,35 @@ class IrExpressionBodyImpl(
expression.accept(visitor, data) expression.accept(visitor, data)
} }
} }
class IrBlockBodyImpl(startOffset: Int, endOffset: Int) : IrElementBase(startOffset, endOffset), IrBlockBody {
override val statements: MutableList<IrStatement> = ArrayList()
fun addStatement(statement: IrStatement) {
statement.assertDetached()
statement.setTreeLocation(this, statements.size)
statements.add(statement)
}
override fun getChild(slot: Int): IrElement? =
statements.getOrNull(slot)
override fun replaceChild(slot: Int, newChild: IrElement) {
if (slot < 0 || slot >= statements.size) throwNoSuchSlot(slot)
newChild.assertDetached()
statements[slot].detach()
statements[slot] = newChild.assertCast()
newChild.setTreeLocation(this, slot)
}
override fun <R, D> accept(visitor: IrElementVisitor<R, D>, data: D): R {
return visitor.visitBlockBody(this, data)
}
override fun <D> acceptChildren(visitor: IrElementVisitor<Unit, D>, data: D) {
statements.forEach { it.accept(visitor, data) }
}
}
@@ -68,7 +68,8 @@ interface IrOperator {
object DIVEQ : IrOperatorImpl("DIVEQ") object DIVEQ : IrOperatorImpl("DIVEQ")
object PERCEQ : IrOperatorImpl("PERCEQ") object PERCEQ : IrOperatorImpl("PERCEQ")
object SYNTHETIC_BLOCK : IrOperatorImpl("SYNTHETIC_BLOCK") object ARGUMENTS_REORDERING_FOR_CALL : IrOperatorImpl("ARGUMENTS_REORDERING_FOR_CALL")
object DESTRUCTURING_DECLARATION : IrOperatorImpl("DESTRUCTURING_DECLARATION")
object GET_PROPERTY : IrOperatorImpl("GET_PROPERTY") object GET_PROPERTY : IrOperatorImpl("GET_PROPERTY")
object SET_PROPERTY : IrOperatorImpl("SET_PROPERTY") object SET_PROPERTY : IrOperatorImpl("SET_PROPERTY")
@@ -37,25 +37,28 @@ class RenderIrElementVisitor : IrElementVisitor<String, Nothing?> {
"? ${declaration.javaClass.simpleName} ${declaration.descriptor?.name}" "? ${declaration.javaClass.simpleName} ${declaration.descriptor?.name}"
override fun visitFile(declaration: IrFile, data: Nothing?): String = override fun visitFile(declaration: IrFile, data: Nothing?): String =
"IrFile ${declaration.name}" "FILE ${declaration.name}"
override fun visitFunction(declaration: IrFunction, data: Nothing?): String = override fun visitFunction(declaration: IrFunction, data: Nothing?): String =
"IrFunction ${declaration.descriptor.render()}" "FUN ${declaration.descriptor.render()}"
override fun visitProperty(declaration: IrProperty, data: Nothing?): String = override fun visitProperty(declaration: IrProperty, data: Nothing?): String =
"IrProperty ${declaration.descriptor.render()} getter=${declaration.getter?.name()} setter=${declaration.setter?.name()}" "PROPERTY ${declaration.descriptor.render()} getter=${declaration.getter?.name()} setter=${declaration.setter?.name()}"
override fun visitPropertyGetter(declaration: IrPropertyGetter, data: Nothing?): String = override fun visitPropertyGetter(declaration: IrPropertyGetter, data: Nothing?): String =
"IrPropertyGetter ${declaration.descriptor.render()} property=${declaration.property?.name()}" "PROPERTY_GETTER ${declaration.descriptor.render()} property=${declaration.property?.name()}"
override fun visitPropertySetter(declaration: IrPropertySetter, data: Nothing?): String = override fun visitPropertySetter(declaration: IrPropertySetter, data: Nothing?): String =
"IrPropertySetter ${declaration.descriptor.render()} property=${declaration.property?.name()}" "PROPERTY_SETTER ${declaration.descriptor.render()} property=${declaration.property?.name()}"
override fun visitVariable(declaration: IrVariable, data: Nothing?): String = override fun visitVariable(declaration: IrVariable, data: Nothing?): String =
"VAR ${declaration.descriptor.render()}" "VAR ${declaration.descriptor.render()}"
override fun visitExpressionBody(body: IrExpressionBody, data: Nothing?): String = override fun visitExpressionBody(body: IrExpressionBody, data: Nothing?): String =
"IrExpressionBody" "EXPRESSION_BODY"
override fun visitBlockBody(body: IrBlockBody, data: Nothing?): String =
"BLOCK_BODY"
override fun visitExpression(expression: IrExpression, data: Nothing?): String = override fun visitExpression(expression: IrExpression, data: Nothing?): String =
"? ${expression.javaClass.simpleName} type=${expression.renderType()}" "? ${expression.javaClass.simpleName} type=${expression.renderType()}"
@@ -64,7 +67,7 @@ class RenderIrElementVisitor : IrElementVisitor<String, Nothing?> {
"CONST ${expression.kind} type=${expression.renderType()} value='${expression.value}'" "CONST ${expression.kind} type=${expression.renderType()} value='${expression.value}'"
override fun visitBlock(expression: IrBlock, data: Nothing?): String = override fun visitBlock(expression: IrBlock, data: Nothing?): String =
"BLOCK type=${expression.renderType()} hasResult=${expression.hasResult} operator=${expression.operator}" "BLOCK type=${expression.renderType()} operator=${expression.operator}"
override fun visitReturn(expression: IrReturn, data: Nothing?): String = override fun visitReturn(expression: IrReturn, data: Nothing?): String =
"RETURN type=${expression.renderType()}" "RETURN type=${expression.renderType()}"
@@ -37,6 +37,8 @@ interface IrElementVisitor<out R, in D> {
fun visitBody(body: IrBody, data: D): R = visitElement(body, data) fun visitBody(body: IrBody, data: D): R = visitElement(body, data)
fun visitExpressionBody(body: IrExpressionBody, data: D): R = visitBody(body, data) fun visitExpressionBody(body: IrExpressionBody, data: D): R = visitBody(body, data)
fun visitBlockBody(body: IrBlockBody, data: D) = visitBody(body, data)
fun visitExpression(expression: IrExpression, data: D): R = visitElement(expression, data) fun visitExpression(expression: IrExpression, data: D): R = visitElement(expression, data)
fun <T> visitConst(expression: IrConst<T>, data: D): R = visitExpression(expression, data) fun <T> visitConst(expression: IrConst<T>, data: D): R = visitExpression(expression, data)
@@ -71,6 +73,4 @@ interface IrElementVisitor<out R, in D> {
// NB Use it only for testing purposes; will be removed as soon as all Kotlin expression types are covered // NB Use it only for testing purposes; will be removed as soon as all Kotlin expression types are covered
fun visitDummyDeclaration(declaration: IrDummyDeclaration, data: D) = visitDeclaration(declaration, data) fun visitDummyDeclaration(declaration: IrDummyDeclaration, data: D) = visitDeclaration(declaration, data)
fun visitDummyExpression(expression: IrDummyExpression, data: D) = visitExpression(expression, data) fun visitDummyExpression(expression: IrDummyExpression, data: D) = visitExpression(expression, data)
} }
+19 -21
View File
@@ -1,24 +1,22 @@
IrFile /arrayAccess.kt FILE /arrayAccess.kt
IrProperty public val p: kotlin.Int = 0 getter=null setter=null PROPERTY public val p: kotlin.Int = 0 getter=null setter=null
IrExpressionBody EXPRESSION_BODY
CONST Int type=kotlin.Int value='0' CONST Int type=kotlin.Int value='0'
IrFunction public fun foo(): kotlin.Int FUN public fun foo(): kotlin.Int
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null RETURN type=<no-type>
RETURN type=<no-type> CONST Int type=kotlin.Int value='1'
CONST Int type=kotlin.Int value='1' FUN public fun test(/*0*/ a: kotlin.IntArray): kotlin.Int
IrFunction public fun test(/*0*/ a: kotlin.IntArray): kotlin.Int BLOCK_BODY
IrExpressionBody RETURN type=<no-type>
BLOCK type=<no-type> hasResult=false operator=null CALL .plus type=kotlin.Int operator=PLUS
RETURN type=<no-type> $this: CALL .plus type=kotlin.Int operator=PLUS
CALL .plus type=kotlin.Int operator=PLUS $this: CALL .get type=kotlin.Int operator=GET_ARRAY_ELEMENT
$this: CALL .plus type=kotlin.Int operator=PLUS $this: GET_VAR a type=kotlin.IntArray operator=null
$this: CALL .get type=kotlin.Int operator=GET_ARRAY_ELEMENT index: CONST Int type=kotlin.Int value='0'
$this: GET_VAR a type=kotlin.IntArray operator=null
index: CONST Int type=kotlin.Int value='0'
other: CALL .get type=kotlin.Int operator=GET_ARRAY_ELEMENT
$this: GET_VAR a type=kotlin.IntArray operator=null
index: CALL .<get-p> type=kotlin.Int operator=GET_PROPERTY
other: CALL .get type=kotlin.Int operator=GET_ARRAY_ELEMENT other: CALL .get type=kotlin.Int operator=GET_ARRAY_ELEMENT
$this: GET_VAR a type=kotlin.IntArray operator=null $this: GET_VAR a type=kotlin.IntArray operator=null
index: CALL .foo type=kotlin.Int operator=null index: CALL .<get-p> type=kotlin.Int operator=GET_PROPERTY
other: CALL .get type=kotlin.Int operator=GET_ARRAY_ELEMENT
$this: GET_VAR a type=kotlin.IntArray operator=null
index: CALL .foo type=kotlin.Int operator=null
+23 -26
View File
@@ -1,26 +1,23 @@
IrFile /arrayAssignment.kt FILE /arrayAssignment.kt
IrFunction public fun test(): kotlin.Unit FUN public fun test(): kotlin.Unit
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null VAR val x: kotlin.IntArray
VAR val x: kotlin.IntArray CALL .intArrayOf type=kotlin.IntArray operator=null
CALL .intArrayOf type=kotlin.IntArray operator=null elements: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.IntArray
elements: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.IntArray DUMMY vararg type=kotlin.Int
DUMMY vararg type=kotlin.Int CALL .set type=kotlin.Unit operator=EQ
CALL .set type=kotlin.Unit operator=EQ $this: GET_VAR x type=kotlin.IntArray operator=null
$this: GET_VAR x type=kotlin.IntArray operator=null index: CONST Int type=kotlin.Int value='1'
index: CONST Int type=kotlin.Int value='1' value: CONST Int type=kotlin.Int value='0'
value: CONST Int type=kotlin.Int value='0' FUN public fun foo(): kotlin.Int
IrFunction public fun foo(): kotlin.Int BLOCK_BODY
IrExpressionBody RETURN type=<no-type>
BLOCK type=<no-type> hasResult=false operator=null CONST Int type=kotlin.Int value='1'
RETURN type=<no-type> FUN public fun test2(): kotlin.Unit
CONST Int type=kotlin.Int value='1' BLOCK_BODY
IrFunction public fun test2(): kotlin.Unit CALL .set type=kotlin.Unit operator=EQ
IrExpressionBody $this: CALL .intArrayOf type=kotlin.IntArray operator=null
BLOCK type=<no-type> hasResult=false operator=null elements: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.IntArray
CALL .set type=kotlin.Unit operator=EQ DUMMY vararg type=kotlin.Int
$this: CALL .intArrayOf type=kotlin.IntArray operator=null index: CALL .foo type=kotlin.Int operator=null
elements: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.IntArray value: CONST Int type=kotlin.Int value='1'
DUMMY vararg type=kotlin.Int
index: CALL .foo type=kotlin.Int operator=null
value: CONST Int type=kotlin.Int value='1'
+52 -57
View File
@@ -1,61 +1,56 @@
IrFile /arrayAugmentedAssignment1.kt FILE /arrayAugmentedAssignment1.kt
IrFunction public fun foo(): kotlin.IntArray FUN public fun foo(): kotlin.IntArray
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null RETURN type=<no-type>
RETURN type=<no-type> CALL .intArrayOf type=kotlin.IntArray operator=null
CALL .intArrayOf type=kotlin.IntArray operator=null elements: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.IntArray
elements: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.IntArray DUMMY vararg type=kotlin.Int
DUMMY vararg type=kotlin.Int FUN public fun bar(): kotlin.Int
IrFunction public fun bar(): kotlin.Int BLOCK_BODY
IrExpressionBody RETURN type=<no-type>
BLOCK type=<no-type> hasResult=false operator=null CONST Int type=kotlin.Int value='42'
RETURN type=<no-type>
CONST Int type=kotlin.Int value='42'
DUMMY C DUMMY C
IrFunction public fun testVariable(): kotlin.Unit FUN public fun testVariable(): kotlin.Unit
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null VAR var x: kotlin.IntArray
VAR var x: kotlin.IntArray CALL .foo type=kotlin.IntArray operator=null
CALL .foo type=kotlin.IntArray operator=null BLOCK type=kotlin.Unit operator=PLUSEQ
BLOCK type=kotlin.Unit hasResult=false operator=PLUSEQ CALL .set type=kotlin.Unit operator=PLUSEQ
CALL .set type=kotlin.Unit operator=PLUSEQ $this: GET_VAR x type=kotlin.IntArray operator=null
$this: GET_VAR x type=kotlin.IntArray operator=null index: CONST Int type=kotlin.Int value='0'
index: CONST Int type=kotlin.Int value='0' value: CALL .plus type=kotlin.Int operator=PLUSEQ
value: CALL .plus type=kotlin.Int operator=PLUSEQ $this: CALL .get type=kotlin.Int operator=PLUSEQ
$this: CALL .get type=kotlin.Int operator=PLUSEQ $this: GET_VAR x type=kotlin.IntArray operator=null
$this: GET_VAR x type=kotlin.IntArray operator=null
index: CONST Int type=kotlin.Int value='0'
other: CONST Int type=kotlin.Int value='1'
IrFunction public fun testCall(): kotlin.Unit
IrExpressionBody
BLOCK type=<no-type> hasResult=false operator=null
BLOCK type=kotlin.Unit hasResult=false operator=MULTEQ
VAR val tmp0_array: kotlin.IntArray
CALL .foo type=kotlin.IntArray operator=null
VAR val tmp1_index0: kotlin.Int
CALL .bar type=kotlin.Int operator=null
CALL .set type=kotlin.Unit operator=MULTEQ
$this: GET_VAR tmp0_array type=kotlin.IntArray operator=null
index: GET_VAR tmp1_index0 type=kotlin.Int operator=null
value: CALL .times type=kotlin.Int operator=MULTEQ
$this: CALL .get type=kotlin.Int operator=MULTEQ
$this: GET_VAR tmp0_array type=kotlin.IntArray operator=null
index: GET_VAR tmp1_index0 type=kotlin.Int operator=null
other: CONST Int type=kotlin.Int value='2'
IrFunction public fun testMember(/*0*/ c: C): kotlin.Unit
IrExpressionBody
BLOCK type=<no-type> hasResult=false operator=null
BLOCK type=kotlin.Int hasResult=true operator=POSTFIX_INCR
VAR val tmp0_array: kotlin.IntArray
CALL .<get-x> type=kotlin.IntArray operator=GET_PROPERTY
$this: GET_VAR c type=C operator=null
VAR val tmp1: kotlin.Int
CALL .get type=kotlin.Int operator=POSTFIX_INCR
$this: GET_VAR tmp0_array type=kotlin.IntArray operator=null
index: CONST Int type=kotlin.Int value='0' index: CONST Int type=kotlin.Int value='0'
CALL .set type=kotlin.Unit operator=POSTFIX_INCR other: CONST Int type=kotlin.Int value='1'
FUN public fun testCall(): kotlin.Unit
BLOCK_BODY
BLOCK type=kotlin.Unit operator=MULTEQ
VAR val tmp0_array: kotlin.IntArray
CALL .foo type=kotlin.IntArray operator=null
VAR val tmp1_index0: kotlin.Int
CALL .bar type=kotlin.Int operator=null
CALL .set type=kotlin.Unit operator=MULTEQ
$this: GET_VAR tmp0_array type=kotlin.IntArray operator=null
index: GET_VAR tmp1_index0 type=kotlin.Int operator=null
value: CALL .times type=kotlin.Int operator=MULTEQ
$this: CALL .get type=kotlin.Int operator=MULTEQ
$this: GET_VAR tmp0_array type=kotlin.IntArray operator=null
index: GET_VAR tmp1_index0 type=kotlin.Int operator=null
other: CONST Int type=kotlin.Int value='2'
FUN public fun testMember(/*0*/ c: C): kotlin.Unit
BLOCK_BODY
BLOCK type=kotlin.Int operator=POSTFIX_INCR
VAR val tmp0_array: kotlin.IntArray
CALL .<get-x> type=kotlin.IntArray operator=GET_PROPERTY
$this: GET_VAR c type=C operator=null
VAR val tmp1: kotlin.Int
CALL .get type=kotlin.Int operator=POSTFIX_INCR
$this: GET_VAR tmp0_array type=kotlin.IntArray operator=null $this: GET_VAR tmp0_array type=kotlin.IntArray operator=null
index: CONST Int type=kotlin.Int value='0' index: CONST Int type=kotlin.Int value='0'
value: CALL .inc type=kotlin.Int operator=POSTFIX_INCR CALL .set type=kotlin.Unit operator=POSTFIX_INCR
$this: GET_VAR tmp1 type=kotlin.Int operator=null $this: GET_VAR tmp0_array type=kotlin.IntArray operator=null
GET_VAR tmp1 type=kotlin.Int operator=null index: CONST Int type=kotlin.Int value='0'
value: CALL .inc type=kotlin.Int operator=POSTFIX_INCR
$this: GET_VAR tmp1 type=kotlin.Int operator=null
GET_VAR tmp1 type=kotlin.Int operator=null
+13 -14
View File
@@ -1,16 +1,15 @@
IrFile /arrayAugmentedAssignment2.kt FILE /arrayAugmentedAssignment2.kt
DUMMY IA DUMMY IA
DUMMY IB DUMMY IB
IrFunction public fun IB.test(/*0*/ a: IA): kotlin.Unit FUN public fun IB.test(/*0*/ a: IA): kotlin.Unit
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null BLOCK type=kotlin.Unit operator=PLUSEQ
BLOCK type=kotlin.Unit hasResult=false operator=PLUSEQ CALL .set type=kotlin.Unit operator=PLUSEQ
CALL .set type=kotlin.Unit operator=PLUSEQ $this: $RECEIVER of: test type=IB
$this: $RECEIVER of: test type=IB $receiver: GET_VAR a type=IA operator=null
$receiver: GET_VAR a type=IA operator=null index: CONST String type=kotlin.String value=''
index: CONST String type=kotlin.String value='' value: CALL .plus type=kotlin.Int operator=PLUSEQ
value: CALL .plus type=kotlin.Int operator=PLUSEQ $this: CALL .get type=kotlin.Int operator=PLUSEQ
$this: CALL .get type=kotlin.Int operator=PLUSEQ $this: GET_VAR a type=IA operator=null
$this: GET_VAR a type=IA operator=null index: CONST String type=kotlin.String value=''
index: CONST String type=kotlin.String value='' other: CONST Int type=kotlin.Int value='42'
other: CONST Int type=kotlin.Int value='42'
+16 -18
View File
@@ -1,19 +1,17 @@
IrFile /assignments.kt FILE /assignments.kt
DUMMY Ref DUMMY Ref
IrFunction public fun test1(): kotlin.Unit FUN public fun test1(): kotlin.Unit
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null VAR var x: kotlin.Int
VAR var x: kotlin.Int CONST Int type=kotlin.Int value='0'
CONST Int type=kotlin.Int value='0' SET_VAR x type=<no-type> operator=EQ
SET_VAR x type=<no-type> operator=EQ CONST Int type=kotlin.Int value='1'
CONST Int type=kotlin.Int value='1' SET_VAR x type=<no-type> operator=EQ
SET_VAR x type=<no-type> operator=EQ CALL .plus type=kotlin.Int operator=PLUS
CALL .plus type=kotlin.Int operator=PLUS $this: GET_VAR x type=kotlin.Int operator=null
$this: GET_VAR x type=kotlin.Int operator=null other: CONST Int type=kotlin.Int value='1'
other: CONST Int type=kotlin.Int value='1' FUN public fun test2(/*0*/ r: Ref): kotlin.Unit
IrFunction public fun test2(/*0*/ r: Ref): kotlin.Unit BLOCK_BODY
IrExpressionBody CALL .<set-x> type=kotlin.Unit operator=EQ
BLOCK type=<no-type> hasResult=false operator=null $this: GET_VAR r type=Ref operator=null
CALL .<set-x> type=kotlin.Unit operator=EQ <set-?>: CONST Int type=kotlin.Int value='0'
$this: GET_VAR r type=Ref operator=null
<set-?>: CONST Int type=kotlin.Int value='0'
+49 -51
View File
@@ -1,52 +1,50 @@
IrFile /augmentedAssignment1.kt FILE /augmentedAssignment1.kt
IrProperty public var p: kotlin.Int getter=null setter=null PROPERTY public var p: kotlin.Int getter=null setter=null
IrExpressionBody EXPRESSION_BODY
CONST Int type=kotlin.Int value='0' CONST Int type=kotlin.Int value='0'
IrFunction public fun testVariable(): kotlin.Unit FUN public fun testVariable(): kotlin.Unit
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null VAR var x: kotlin.Int
VAR var x: kotlin.Int CONST Int type=kotlin.Int value='0'
CONST Int type=kotlin.Int value='0' SET_VAR x type=<no-type> operator=PLUSEQ
SET_VAR x type=<no-type> operator=PLUSEQ CALL .plus type=kotlin.Int operator=PLUSEQ
CALL .plus type=kotlin.Int operator=PLUSEQ $this: GET_VAR x type=kotlin.Int operator=PLUSEQ
$this: GET_VAR x type=kotlin.Int operator=PLUSEQ other: CONST Int type=kotlin.Int value='1'
other: CONST Int type=kotlin.Int value='1' SET_VAR x type=<no-type> operator=MINUSEQ
SET_VAR x type=<no-type> operator=MINUSEQ CALL .minus type=kotlin.Int operator=MINUSEQ
CALL .minus type=kotlin.Int operator=MINUSEQ $this: GET_VAR x type=kotlin.Int operator=MINUSEQ
$this: GET_VAR x type=kotlin.Int operator=MINUSEQ other: CONST Int type=kotlin.Int value='2'
other: CONST Int type=kotlin.Int value='2' SET_VAR x type=<no-type> operator=MULTEQ
SET_VAR x type=<no-type> operator=MULTEQ CALL .times type=kotlin.Int operator=MULTEQ
CALL .times type=kotlin.Int operator=MULTEQ $this: GET_VAR x type=kotlin.Int operator=MULTEQ
$this: GET_VAR x type=kotlin.Int operator=MULTEQ other: CONST Int type=kotlin.Int value='3'
other: CONST Int type=kotlin.Int value='3' SET_VAR x type=<no-type> operator=DIVEQ
SET_VAR x type=<no-type> operator=DIVEQ CALL .div type=kotlin.Int operator=DIVEQ
CALL .div type=kotlin.Int operator=DIVEQ $this: GET_VAR x type=kotlin.Int operator=DIVEQ
$this: GET_VAR x type=kotlin.Int operator=DIVEQ other: CONST Int type=kotlin.Int value='4'
other: CONST Int type=kotlin.Int value='4' SET_VAR x type=<no-type> operator=PERCEQ
SET_VAR x type=<no-type> operator=PERCEQ CALL .mod type=kotlin.Int operator=PERCEQ
CALL .mod type=kotlin.Int operator=PERCEQ $this: GET_VAR x type=kotlin.Int operator=PERCEQ
$this: GET_VAR x type=kotlin.Int operator=PERCEQ other: CONST Int type=kotlin.Int value='5'
other: CONST Int type=kotlin.Int value='5' FUN public fun testProperty(): kotlin.Unit
IrFunction public fun testProperty(): kotlin.Unit BLOCK_BODY
IrExpressionBody CALL .<set-p> type=kotlin.Unit operator=PLUSEQ
BLOCK type=<no-type> hasResult=false operator=null <set-?>: CALL .plus type=kotlin.Int operator=PLUSEQ
CALL .<set-p> type=kotlin.Unit operator=PLUSEQ $this: CALL .<get-p> type=kotlin.Int operator=PLUSEQ
<set-?>: CALL .plus type=kotlin.Int operator=PLUSEQ other: CONST Int type=kotlin.Int value='1'
$this: CALL .<get-p> type=kotlin.Int operator=PLUSEQ CALL .<set-p> type=kotlin.Unit operator=MINUSEQ
other: CONST Int type=kotlin.Int value='1' <set-?>: CALL .minus type=kotlin.Int operator=MINUSEQ
CALL .<set-p> type=kotlin.Unit operator=MINUSEQ $this: CALL .<get-p> type=kotlin.Int operator=MINUSEQ
<set-?>: CALL .minus type=kotlin.Int operator=MINUSEQ other: CONST Int type=kotlin.Int value='2'
$this: CALL .<get-p> type=kotlin.Int operator=MINUSEQ CALL .<set-p> type=kotlin.Unit operator=MULTEQ
other: CONST Int type=kotlin.Int value='2' <set-?>: CALL .times type=kotlin.Int operator=MULTEQ
CALL .<set-p> type=kotlin.Unit operator=MULTEQ $this: CALL .<get-p> type=kotlin.Int operator=MULTEQ
<set-?>: CALL .times type=kotlin.Int operator=MULTEQ other: CONST Int type=kotlin.Int value='3'
$this: CALL .<get-p> type=kotlin.Int operator=MULTEQ CALL .<set-p> type=kotlin.Unit operator=DIVEQ
other: CONST Int type=kotlin.Int value='3' <set-?>: CALL .div type=kotlin.Int operator=DIVEQ
CALL .<set-p> type=kotlin.Unit operator=DIVEQ $this: CALL .<get-p> type=kotlin.Int operator=DIVEQ
<set-?>: CALL .div type=kotlin.Int operator=DIVEQ other: CONST Int type=kotlin.Int value='4'
$this: CALL .<get-p> type=kotlin.Int operator=DIVEQ CALL .<set-p> type=kotlin.Unit operator=PERCEQ
other: CONST Int type=kotlin.Int value='4' <set-?>: CALL .mod type=kotlin.Int operator=PERCEQ
CALL .<set-p> type=kotlin.Unit operator=PERCEQ $this: CALL .<get-p> type=kotlin.Int operator=PERCEQ
<set-?>: CALL .mod type=kotlin.Int operator=PERCEQ other: CONST Int type=kotlin.Int value='5'
$this: CALL .<get-p> type=kotlin.Int operator=PERCEQ
other: CONST Int type=kotlin.Int value='5'
+49 -56
View File
@@ -1,58 +1,51 @@
IrFile /augmentedAssignment2.kt FILE /augmentedAssignment2.kt
DUMMY A DUMMY A
IrFunction public operator fun A.plusAssign(/*0*/ s: kotlin.String): kotlin.Unit FUN public operator fun A.plusAssign(/*0*/ s: kotlin.String): kotlin.Unit
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null FUN public operator fun A.minusAssign(/*0*/ s: kotlin.String): kotlin.Unit
IrFunction public operator fun A.minusAssign(/*0*/ s: kotlin.String): kotlin.Unit BLOCK_BODY
IrExpressionBody FUN public operator fun A.timesAssign(/*0*/ s: kotlin.String): kotlin.Unit
BLOCK type=<no-type> hasResult=false operator=null BLOCK_BODY
IrFunction public operator fun A.timesAssign(/*0*/ s: kotlin.String): kotlin.Unit FUN public operator fun A.divAssign(/*0*/ s: kotlin.String): kotlin.Unit
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null FUN public operator fun A.modAssign(/*0*/ s: kotlin.String): kotlin.Unit
IrFunction public operator fun A.divAssign(/*0*/ s: kotlin.String): kotlin.Unit BLOCK_BODY
IrExpressionBody PROPERTY public val p: A getter=null setter=null
BLOCK type=<no-type> hasResult=false operator=null EXPRESSION_BODY
IrFunction public operator fun A.modAssign(/*0*/ s: kotlin.String): kotlin.Unit
IrExpressionBody
BLOCK type=<no-type> hasResult=false operator=null
IrProperty public val p: A getter=null setter=null
IrExpressionBody
CALL .<init> type=A operator=null CALL .<init> type=A operator=null
IrFunction public fun testVariable(): kotlin.Unit FUN public fun testVariable(): kotlin.Unit
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null VAR val a: A
VAR val a: A CALL .<init> type=A operator=null
CALL .<init> type=A operator=null CALL .plusAssign type=kotlin.Unit operator=PLUSEQ
CALL .plusAssign type=kotlin.Unit operator=PLUSEQ $receiver: GET_VAR a type=A operator=PLUSEQ
$receiver: GET_VAR a type=A operator=PLUSEQ s: CONST String type=kotlin.String value='+='
s: CONST String type=kotlin.String value='+=' CALL .minusAssign type=kotlin.Unit operator=MINUSEQ
CALL .minusAssign type=kotlin.Unit operator=MINUSEQ $receiver: GET_VAR a type=A operator=MINUSEQ
$receiver: GET_VAR a type=A operator=MINUSEQ s: CONST String type=kotlin.String value='-='
s: CONST String type=kotlin.String value='-=' CALL .timesAssign type=kotlin.Unit operator=MULTEQ
CALL .timesAssign type=kotlin.Unit operator=MULTEQ $receiver: GET_VAR a type=A operator=MULTEQ
$receiver: GET_VAR a type=A operator=MULTEQ s: CONST String type=kotlin.String value='*='
s: CONST String type=kotlin.String value='*=' CALL .divAssign type=kotlin.Unit operator=DIVEQ
CALL .divAssign type=kotlin.Unit operator=DIVEQ $receiver: GET_VAR a type=A operator=DIVEQ
$receiver: GET_VAR a type=A operator=DIVEQ s: CONST String type=kotlin.String value='/='
s: CONST String type=kotlin.String value='/=' CALL .modAssign type=kotlin.Unit operator=PERCEQ
CALL .modAssign type=kotlin.Unit operator=PERCEQ $receiver: GET_VAR a type=A operator=PERCEQ
$receiver: GET_VAR a type=A operator=PERCEQ s: CONST String type=kotlin.String value='*='
s: CONST String type=kotlin.String value='*=' FUN public fun testProperty(): kotlin.Unit
IrFunction public fun testProperty(): kotlin.Unit BLOCK_BODY
IrExpressionBody CALL .plusAssign type=kotlin.Unit operator=PLUSEQ
BLOCK type=<no-type> hasResult=false operator=null $receiver: CALL .<get-p> type=A operator=PLUSEQ
CALL .plusAssign type=kotlin.Unit operator=PLUSEQ s: CONST String type=kotlin.String value='+='
$receiver: CALL .<get-p> type=A operator=PLUSEQ CALL .minusAssign type=kotlin.Unit operator=MINUSEQ
s: CONST String type=kotlin.String value='+=' $receiver: CALL .<get-p> type=A operator=MINUSEQ
CALL .minusAssign type=kotlin.Unit operator=MINUSEQ s: CONST String type=kotlin.String value='-='
$receiver: CALL .<get-p> type=A operator=MINUSEQ CALL .timesAssign type=kotlin.Unit operator=MULTEQ
s: CONST String type=kotlin.String value='-=' $receiver: CALL .<get-p> type=A operator=MULTEQ
CALL .timesAssign type=kotlin.Unit operator=MULTEQ s: CONST String type=kotlin.String value='*='
$receiver: CALL .<get-p> type=A operator=MULTEQ CALL .divAssign type=kotlin.Unit operator=DIVEQ
s: CONST String type=kotlin.String value='*=' $receiver: CALL .<get-p> type=A operator=DIVEQ
CALL .divAssign type=kotlin.Unit operator=DIVEQ s: CONST String type=kotlin.String value='/='
$receiver: CALL .<get-p> type=A operator=DIVEQ CALL .modAssign type=kotlin.Unit operator=PERCEQ
s: CONST String type=kotlin.String value='/=' $receiver: CALL .<get-p> type=A operator=PERCEQ
CALL .modAssign type=kotlin.Unit operator=PERCEQ s: CONST String type=kotlin.String value='%='
$receiver: CALL .<get-p> type=A operator=PERCEQ
s: CONST String type=kotlin.String value='%='
+27 -31
View File
@@ -1,31 +1,27 @@
IrFile /booleanOperators.kt FILE /booleanOperators.kt
IrFunction public fun test1(/*0*/ a: kotlin.Boolean, /*1*/ b: kotlin.Boolean): kotlin.Boolean FUN public fun test1(/*0*/ a: kotlin.Boolean, /*1*/ b: kotlin.Boolean): kotlin.Boolean
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null RETURN type=<no-type>
RETURN type=<no-type> WHEN type=kotlin.Boolean operator=ANDAND
WHEN type=kotlin.Boolean operator=ANDAND if: GET_VAR a type=kotlin.Boolean operator=null
if: GET_VAR a type=kotlin.Boolean operator=null then: GET_VAR b type=kotlin.Boolean operator=null
then: GET_VAR b type=kotlin.Boolean operator=null else: CONST Boolean type=kotlin.Boolean value='false'
else: CONST Boolean type=kotlin.Boolean value='false' FUN public fun test2(/*0*/ a: kotlin.Boolean, /*1*/ b: kotlin.Boolean): kotlin.Boolean
IrFunction public fun test2(/*0*/ a: kotlin.Boolean, /*1*/ b: kotlin.Boolean): kotlin.Boolean BLOCK_BODY
IrExpressionBody RETURN type=<no-type>
BLOCK type=<no-type> hasResult=false operator=null WHEN type=kotlin.Boolean operator=OROR
RETURN type=<no-type> if: GET_VAR a type=kotlin.Boolean operator=null
WHEN type=kotlin.Boolean operator=OROR then: CONST Boolean type=kotlin.Boolean value='true'
if: GET_VAR a type=kotlin.Boolean operator=null else: GET_VAR b type=kotlin.Boolean operator=null
then: CONST Boolean type=kotlin.Boolean value='true' FUN public fun test1x(/*0*/ a: kotlin.Boolean, /*1*/ b: kotlin.Boolean): kotlin.Boolean
else: GET_VAR b type=kotlin.Boolean operator=null BLOCK_BODY
IrFunction public fun test1x(/*0*/ a: kotlin.Boolean, /*1*/ b: kotlin.Boolean): kotlin.Boolean RETURN type=<no-type>
IrExpressionBody CALL .and type=kotlin.Boolean operator=null
BLOCK type=<no-type> hasResult=false operator=null $this: GET_VAR a type=kotlin.Boolean operator=null
RETURN type=<no-type> other: GET_VAR b type=kotlin.Boolean operator=null
CALL .and type=kotlin.Boolean operator=null FUN public fun test2x(/*0*/ a: kotlin.Boolean, /*1*/ b: kotlin.Boolean): kotlin.Boolean
$this: GET_VAR a type=kotlin.Boolean operator=null BLOCK_BODY
other: GET_VAR b type=kotlin.Boolean operator=null RETURN type=<no-type>
IrFunction public fun test2x(/*0*/ a: kotlin.Boolean, /*1*/ b: kotlin.Boolean): kotlin.Boolean CALL .or type=kotlin.Boolean operator=null
IrExpressionBody $this: GET_VAR a type=kotlin.Boolean operator=null
BLOCK type=<no-type> hasResult=false operator=null other: GET_VAR b type=kotlin.Boolean operator=null
RETURN type=<no-type>
CALL .or type=kotlin.Boolean operator=null
$this: GET_VAR a type=kotlin.Boolean operator=null
other: GET_VAR b type=kotlin.Boolean operator=null
+5 -6
View File
@@ -1,6 +1,5 @@
IrFile /boxOk.kt FILE /boxOk.kt
IrFunction public fun box(): kotlin.String FUN public fun box(): kotlin.String
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null RETURN type=<no-type>
RETURN type=<no-type> CONST String type=kotlin.String value='OK'
CONST String type=kotlin.String value='OK'
+57 -60
View File
@@ -1,60 +1,57 @@
IrFile /breakContinue.kt FILE /breakContinue.kt
IrFunction public fun test1(): kotlin.Unit FUN public fun test1(): kotlin.Unit
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null WHILE label=null operator=WHILE_LOOP
WHILE label=null operator=WHILE_LOOP condition: CONST Boolean type=kotlin.Boolean value='true'
condition: CONST Boolean type=kotlin.Boolean value='true' body: BLOCK type=kotlin.Nothing operator=null
body: BLOCK type=<no-type> hasResult=false operator=null BREAK label=null depth=0
BREAK label=null depth=0 DO_WHILE label=null operator=DO_WHILE_LOOP
DO_WHILE label=null operator=DO_WHILE_LOOP body: BLOCK type=kotlin.Unit operator=null
body: BLOCK type=<no-type> hasResult=false operator=null BREAK label=null depth=0
BREAK label=null depth=0 condition: CONST Boolean type=kotlin.Boolean value='true'
condition: CONST Boolean type=kotlin.Boolean value='true' WHILE label=null operator=WHILE_LOOP
WHILE label=null operator=WHILE_LOOP condition: CONST Boolean type=kotlin.Boolean value='true'
condition: CONST Boolean type=kotlin.Boolean value='true' body: BLOCK type=kotlin.Nothing operator=null
body: BLOCK type=<no-type> hasResult=false operator=null CONTINUE label=null depth=0
CONTINUE label=null depth=0 DO_WHILE label=null operator=DO_WHILE_LOOP
DO_WHILE label=null operator=DO_WHILE_LOOP body: BLOCK type=kotlin.Unit operator=null
body: BLOCK type=<no-type> hasResult=false operator=null CONTINUE label=null depth=0
CONTINUE label=null depth=0 condition: CONST Boolean type=kotlin.Boolean value='true'
condition: CONST Boolean type=kotlin.Boolean value='true' FUN public fun test2(): kotlin.Unit
IrFunction public fun test2(): kotlin.Unit BLOCK_BODY
IrExpressionBody WHILE label=OUTER operator=WHILE_LOOP
BLOCK type=<no-type> hasResult=false operator=null condition: CONST Boolean type=kotlin.Boolean value='true'
WHILE label=OUTER operator=WHILE_LOOP body: BLOCK type=kotlin.Nothing operator=null
condition: CONST Boolean type=kotlin.Boolean value='true' WHILE label=INNER operator=WHILE_LOOP
body: BLOCK type=<no-type> hasResult=false operator=null condition: CONST Boolean type=kotlin.Boolean value='true'
WHILE label=INNER operator=WHILE_LOOP body: BLOCK type=kotlin.Nothing operator=null
condition: CONST Boolean type=kotlin.Boolean value='true' BREAK label=INNER depth=0
body: BLOCK type=<no-type> hasResult=false operator=null BREAK label=OUTER depth=1
BREAK label=INNER depth=0 BREAK label=OUTER depth=0
BREAK label=OUTER depth=1 WHILE label=OUTER operator=WHILE_LOOP
BREAK label=OUTER depth=0 condition: CONST Boolean type=kotlin.Boolean value='true'
WHILE label=OUTER operator=WHILE_LOOP body: BLOCK type=kotlin.Nothing operator=null
condition: CONST Boolean type=kotlin.Boolean value='true' WHILE label=INNER operator=WHILE_LOOP
body: BLOCK type=<no-type> hasResult=false operator=null condition: CONST Boolean type=kotlin.Boolean value='true'
WHILE label=INNER operator=WHILE_LOOP body: BLOCK type=kotlin.Nothing operator=null
condition: CONST Boolean type=kotlin.Boolean value='true' CONTINUE label=INNER depth=0
body: BLOCK type=<no-type> hasResult=false operator=null CONTINUE label=OUTER depth=1
CONTINUE label=INNER depth=0 CONTINUE label=OUTER depth=0
CONTINUE label=OUTER depth=1 FUN public fun test3(): kotlin.Unit
CONTINUE label=OUTER depth=0 BLOCK_BODY
IrFunction public fun test3(): kotlin.Unit WHILE label=L operator=WHILE_LOOP
IrExpressionBody condition: CONST Boolean type=kotlin.Boolean value='true'
BLOCK type=<no-type> hasResult=false operator=null body: BLOCK type=kotlin.Nothing operator=null
WHILE label=L operator=WHILE_LOOP WHILE label=L operator=WHILE_LOOP
condition: CONST Boolean type=kotlin.Boolean value='true' condition: CONST Boolean type=kotlin.Boolean value='true'
body: BLOCK type=<no-type> hasResult=false operator=null body: BLOCK type=kotlin.Nothing operator=null
WHILE label=L operator=WHILE_LOOP BREAK label=L depth=0
condition: CONST Boolean type=kotlin.Boolean value='true' BREAK label=L depth=0
body: BLOCK type=<no-type> hasResult=false operator=null WHILE label=L operator=WHILE_LOOP
BREAK label=L depth=0 condition: CONST Boolean type=kotlin.Boolean value='true'
BREAK label=L depth=0 body: BLOCK type=kotlin.Nothing operator=null
WHILE label=L operator=WHILE_LOOP WHILE label=L operator=WHILE_LOOP
condition: CONST Boolean type=kotlin.Boolean value='true' condition: CONST Boolean type=kotlin.Boolean value='true'
body: BLOCK type=<no-type> hasResult=false operator=null body: BLOCK type=kotlin.Nothing operator=null
WHILE label=L operator=WHILE_LOOP CONTINUE label=L depth=0
condition: CONST Boolean type=kotlin.Boolean value='true' CONTINUE label=L depth=0
body: BLOCK type=<no-type> hasResult=false operator=null
CONTINUE label=L depth=0
CONTINUE label=L depth=0
+37 -43
View File
@@ -1,44 +1,38 @@
IrFile /callWithReorderedArguments.kt FILE /callWithReorderedArguments.kt
IrFunction public fun foo(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Unit FUN public fun foo(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Unit
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null FUN public fun noReorder1(): kotlin.Int
IrFunction public fun noReorder1(): kotlin.Int BLOCK_BODY
IrExpressionBody RETURN type=<no-type>
BLOCK type=<no-type> hasResult=false operator=null CONST Int type=kotlin.Int value='1'
RETURN type=<no-type> FUN public fun noReorder2(): kotlin.Int
CONST Int type=kotlin.Int value='1' BLOCK_BODY
IrFunction public fun noReorder2(): kotlin.Int RETURN type=<no-type>
IrExpressionBody CONST Int type=kotlin.Int value='2'
BLOCK type=<no-type> hasResult=false operator=null FUN public fun reordered1(): kotlin.Int
RETURN type=<no-type> BLOCK_BODY
CONST Int type=kotlin.Int value='2' RETURN type=<no-type>
IrFunction public fun reordered1(): kotlin.Int CONST Int type=kotlin.Int value='1'
IrExpressionBody FUN public fun reordered2(): kotlin.Int
BLOCK type=<no-type> hasResult=false operator=null BLOCK_BODY
RETURN type=<no-type> RETURN type=<no-type>
CONST Int type=kotlin.Int value='1' CONST Int type=kotlin.Int value='2'
IrFunction public fun reordered2(): kotlin.Int FUN public fun test(): kotlin.Unit
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null CALL .foo type=kotlin.Unit operator=null
RETURN type=<no-type> a: CALL .noReorder1 type=kotlin.Int operator=null
CONST Int type=kotlin.Int value='2' b: CALL .noReorder2 type=kotlin.Int operator=null
IrFunction public fun test(): kotlin.Unit BLOCK type=kotlin.Unit operator=ARGUMENTS_REORDERING_FOR_CALL
IrExpressionBody VAR val tmp0_b: kotlin.Int
BLOCK type=<no-type> hasResult=false operator=null CALL .reordered1 type=kotlin.Int operator=null
VAR val tmp1_a: kotlin.Int
CALL .reordered2 type=kotlin.Int operator=null
CALL .foo type=kotlin.Unit operator=null CALL .foo type=kotlin.Unit operator=null
a: CALL .noReorder1 type=kotlin.Int operator=null a: GET_VAR tmp1_a type=kotlin.Int operator=null
b: CALL .noReorder2 type=kotlin.Int operator=null b: GET_VAR tmp0_b type=kotlin.Int operator=null
BLOCK type=kotlin.Unit hasResult=true operator=SYNTHETIC_BLOCK BLOCK type=kotlin.Unit operator=ARGUMENTS_REORDERING_FOR_CALL
VAR val tmp0_b: kotlin.Int VAR val tmp2_a: kotlin.Int
CALL .reordered1 type=kotlin.Int operator=null CALL .reordered2 type=kotlin.Int operator=null
VAR val tmp1_a: kotlin.Int CALL .foo type=kotlin.Unit operator=null
CALL .reordered2 type=kotlin.Int operator=null a: GET_VAR tmp2_a type=kotlin.Int operator=null
CALL .foo type=kotlin.Unit operator=null b: CONST Int type=kotlin.Int value='1'
a: GET_VAR tmp1_a type=kotlin.Int operator=null
b: GET_VAR tmp0_b type=kotlin.Int operator=null
BLOCK type=kotlin.Unit hasResult=true operator=SYNTHETIC_BLOCK
VAR val tmp2_a: kotlin.Int
CALL .reordered2 type=kotlin.Int operator=null
CALL .foo type=kotlin.Unit operator=null
a: GET_VAR tmp2_a type=kotlin.Int operator=null
b: CONST Int type=kotlin.Int value='1'
+34 -40
View File
@@ -1,42 +1,36 @@
IrFile /calls.kt FILE /calls.kt
IrFunction public fun foo(/*0*/ x: kotlin.Int, /*1*/ y: kotlin.Int): kotlin.Int FUN public fun foo(/*0*/ x: kotlin.Int, /*1*/ y: kotlin.Int): kotlin.Int
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null RETURN type=<no-type>
RETURN type=<no-type> GET_VAR x type=kotlin.Int operator=null
GET_VAR x type=kotlin.Int operator=null FUN public fun bar(/*0*/ x: kotlin.Int): kotlin.Int
IrFunction public fun bar(/*0*/ x: kotlin.Int): kotlin.Int BLOCK_BODY
IrExpressionBody RETURN type=<no-type>
BLOCK type=<no-type> hasResult=false operator=null CALL .foo type=kotlin.Int operator=null
RETURN type=<no-type> x: GET_VAR x type=kotlin.Int operator=null
CALL .foo type=kotlin.Int operator=null y: CONST Int type=kotlin.Int value='1'
FUN public fun qux(/*0*/ x: kotlin.Int): kotlin.Int
BLOCK_BODY
RETURN type=<no-type>
CALL .foo type=kotlin.Int operator=null
x: CALL .foo type=kotlin.Int operator=null
x: GET_VAR x type=kotlin.Int operator=null x: GET_VAR x type=kotlin.Int operator=null
y: CONST Int type=kotlin.Int value='1'
IrFunction public fun qux(/*0*/ x: kotlin.Int): kotlin.Int
IrExpressionBody
BLOCK type=<no-type> hasResult=false operator=null
RETURN type=<no-type>
CALL .foo type=kotlin.Int operator=null
x: CALL .foo type=kotlin.Int operator=null
x: GET_VAR x type=kotlin.Int operator=null
y: GET_VAR x type=kotlin.Int operator=null
y: GET_VAR x type=kotlin.Int operator=null
IrFunction public fun kotlin.Int.ext1(): kotlin.Int
IrExpressionBody
BLOCK type=<no-type> hasResult=false operator=null
RETURN type=<no-type>
$RECEIVER of: ext1 type=kotlin.Int
IrFunction public fun kotlin.Int.ext2(/*0*/ x: kotlin.Int): kotlin.Int
IrExpressionBody
BLOCK type=<no-type> hasResult=false operator=null
RETURN type=<no-type>
CALL .foo type=kotlin.Int operator=null
x: $RECEIVER of: ext2 type=kotlin.Int
y: GET_VAR x type=kotlin.Int operator=null
IrFunction public fun kotlin.Int.ext3(/*0*/ x: kotlin.Int): kotlin.Int
IrExpressionBody
BLOCK type=<no-type> hasResult=false operator=null
RETURN type=<no-type>
CALL .foo type=kotlin.Int operator=null
x: CALL .ext1 type=kotlin.Int operator=null
$receiver: $RECEIVER of: ext3 type=kotlin.Int
y: GET_VAR x type=kotlin.Int operator=null y: GET_VAR x type=kotlin.Int operator=null
y: GET_VAR x type=kotlin.Int operator=null
FUN public fun kotlin.Int.ext1(): kotlin.Int
BLOCK_BODY
RETURN type=<no-type>
$RECEIVER of: ext1 type=kotlin.Int
FUN public fun kotlin.Int.ext2(/*0*/ x: kotlin.Int): kotlin.Int
BLOCK_BODY
RETURN type=<no-type>
CALL .foo type=kotlin.Int operator=null
x: $RECEIVER of: ext2 type=kotlin.Int
y: GET_VAR x type=kotlin.Int operator=null
FUN public fun kotlin.Int.ext3(/*0*/ x: kotlin.Int): kotlin.Int
BLOCK_BODY
RETURN type=<no-type>
CALL .foo type=kotlin.Int operator=null
x: CALL .ext1 type=kotlin.Int operator=null
$receiver: $RECEIVER of: ext3 type=kotlin.Int
y: GET_VAR x type=kotlin.Int operator=null
+17 -18
View File
@@ -1,24 +1,23 @@
IrFile /chainOfSafeCalls.kt FILE /chainOfSafeCalls.kt
DUMMY C DUMMY C
IrFunction public fun test(/*0*/ nc: C?): C? FUN public fun test(/*0*/ nc: C?): C?
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null RETURN type=<no-type>
RETURN type=<no-type> BLOCK type=C? operator=SAFE_CALL
BLOCK type=C? hasResult=true operator=SAFE_CALL VAR val tmp2_safe_receiver: C?
VAR val tmp2_safe_receiver: C?
WHEN type=C? operator=SAFE_CALL
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR nc type=C? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null'
else: CALL .bar type=C? operator=null
$this: CALL .foo type=C operator=null
$this: GET_VAR nc type=C? operator=null
WHEN type=C? operator=SAFE_CALL WHEN type=C? operator=SAFE_CALL
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR tmp2_safe_receiver type=C? operator=null arg0: GET_VAR nc type=C? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null' arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null' then: CONST Null type=kotlin.Nothing? value='null'
else: CALL .foo type=C operator=null else: CALL .bar type=C? operator=null
$this: CALL .foo type=C operator=null $this: CALL .foo type=C operator=null
$this: GET_VAR tmp2_safe_receiver type=C? operator=null $this: GET_VAR nc type=C? operator=null
WHEN type=C? operator=SAFE_CALL
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR tmp2_safe_receiver type=C? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null'
else: CALL .foo type=C operator=null
$this: CALL .foo type=C operator=null
$this: GET_VAR tmp2_safe_receiver type=C? operator=null
+33 -37
View File
@@ -1,39 +1,35 @@
IrFile /conventionComparisons.kt FILE /conventionComparisons.kt
DUMMY IA DUMMY IA
DUMMY IB DUMMY IB
IrFunction public fun IB.test1(/*0*/ a1: IA, /*1*/ a2: IA): kotlin.Boolean FUN public fun IB.test1(/*0*/ a1: IA, /*1*/ a2: IA): kotlin.Boolean
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null RETURN type=<no-type>
RETURN type=<no-type> CALL .GT0 type=kotlin.Boolean operator=GT
CALL .GT0 type=kotlin.Boolean operator=GT arg0: CALL .compareTo type=kotlin.Int operator=GT
arg0: CALL .compareTo type=kotlin.Int operator=GT $this: $RECEIVER of: test1 type=IB
$this: $RECEIVER of: test1 type=IB $receiver: GET_VAR a1 type=IA operator=null
$receiver: GET_VAR a1 type=IA operator=null other: GET_VAR a2 type=IA operator=null
other: GET_VAR a2 type=IA operator=null FUN public fun IB.test2(/*0*/ a1: IA, /*1*/ a2: IA): kotlin.Boolean
IrFunction public fun IB.test2(/*0*/ a1: IA, /*1*/ a2: IA): kotlin.Boolean BLOCK_BODY
IrExpressionBody RETURN type=<no-type>
BLOCK type=<no-type> hasResult=false operator=null CALL .GTEQ0 type=kotlin.Boolean operator=GTEQ
RETURN type=<no-type> arg0: CALL .compareTo type=kotlin.Int operator=GTEQ
CALL .GTEQ0 type=kotlin.Boolean operator=GTEQ $this: $RECEIVER of: test2 type=IB
arg0: CALL .compareTo type=kotlin.Int operator=GTEQ $receiver: GET_VAR a1 type=IA operator=null
$this: $RECEIVER of: test2 type=IB other: GET_VAR a2 type=IA operator=null
$receiver: GET_VAR a1 type=IA operator=null FUN public fun IB.test3(/*0*/ a1: IA, /*1*/ a2: IA): kotlin.Boolean
other: GET_VAR a2 type=IA operator=null BLOCK_BODY
IrFunction public fun IB.test3(/*0*/ a1: IA, /*1*/ a2: IA): kotlin.Boolean RETURN type=<no-type>
IrExpressionBody CALL .LT0 type=kotlin.Boolean operator=LT
BLOCK type=<no-type> hasResult=false operator=null arg0: CALL .compareTo type=kotlin.Int operator=LT
RETURN type=<no-type> $this: $RECEIVER of: test3 type=IB
CALL .LT0 type=kotlin.Boolean operator=LT $receiver: GET_VAR a1 type=IA operator=null
arg0: CALL .compareTo type=kotlin.Int operator=LT other: GET_VAR a2 type=IA operator=null
$this: $RECEIVER of: test3 type=IB FUN public fun IB.test4(/*0*/ a1: IA, /*1*/ a2: IA): kotlin.Boolean
$receiver: GET_VAR a1 type=IA operator=null BLOCK_BODY
other: GET_VAR a2 type=IA operator=null RETURN type=<no-type>
IrFunction public fun IB.test4(/*0*/ a1: IA, /*1*/ a2: IA): kotlin.Boolean CALL .LTEQ0 type=kotlin.Boolean operator=LTEQ
IrExpressionBody arg0: CALL .compareTo type=kotlin.Int operator=LTEQ
BLOCK type=<no-type> hasResult=false operator=null $this: $RECEIVER of: test4 type=IB
RETURN type=<no-type> $receiver: GET_VAR a1 type=IA operator=null
CALL .LTEQ0 type=kotlin.Boolean operator=LTEQ other: GET_VAR a2 type=IA operator=null
arg0: CALL .compareTo type=kotlin.Int operator=LTEQ
$this: $RECEIVER of: test4 type=IB
$receiver: GET_VAR a1 type=IA operator=null
other: GET_VAR a2 type=IA operator=null
+13 -14
View File
@@ -1,14 +1,13 @@
IrFunction public fun B.test(): kotlin.Unit FUN public fun B.test(): kotlin.Unit
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null BLOCK type=kotlin.Unit operator=DESTRUCTURING_DECLARATION
BLOCK type=<no-type> hasResult=false operator=SYNTHETIC_BLOCK VAR val tmp0_container: A
VAR val tmp0_container: A GET_OBJECT A type=A
GET_OBJECT A type=A VAR val x: kotlin.Int
VAR val x: kotlin.Int CALL .component1 type=kotlin.Int operator=COMPONENT_N(index=1)
CALL .component1 type=kotlin.Int operator=COMPONENT_N(index=1) $this: $RECEIVER of: test type=B
$this: $RECEIVER of: test type=B $receiver: GET_VAR tmp0_container type=A operator=null
$receiver: GET_VAR tmp0_container type=A operator=null VAR val y: kotlin.Int
VAR val y: kotlin.Int CALL .component2 type=kotlin.Int operator=COMPONENT_N(index=2)
CALL .component2 type=kotlin.Int operator=COMPONENT_N(index=2) $this: $RECEIVER of: test type=B
$this: $RECEIVER of: test type=B $receiver: GET_VAR tmp0_container type=A operator=null
$receiver: GET_VAR tmp0_container type=A operator=null
+16 -18
View File
@@ -1,18 +1,16 @@
IrFile /dotQualified.kt FILE /dotQualified.kt
IrFunction public fun length(/*0*/ s: kotlin.String): kotlin.Int FUN public fun length(/*0*/ s: kotlin.String): kotlin.Int
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null RETURN type=<no-type>
RETURN type=<no-type> CALL .<get-length> type=kotlin.Int operator=GET_PROPERTY
CALL .<get-length> type=kotlin.Int operator=GET_PROPERTY $this: GET_VAR s type=kotlin.String operator=null
$this: GET_VAR s type=kotlin.String operator=null FUN public fun lengthN(/*0*/ s: kotlin.String?): kotlin.Int?
IrFunction public fun lengthN(/*0*/ s: kotlin.String?): kotlin.Int? BLOCK_BODY
IrExpressionBody RETURN type=<no-type>
BLOCK type=<no-type> hasResult=false operator=null WHEN type=kotlin.Int? operator=SAFE_CALL
RETURN type=<no-type> if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
WHEN type=kotlin.Int? operator=SAFE_CALL arg0: GET_VAR s type=kotlin.String? operator=null
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ arg1: CONST Null type=kotlin.Nothing? value='null'
arg0: GET_VAR s type=kotlin.String? operator=null then: CONST Null type=kotlin.Nothing? value='null'
arg1: CONST Null type=kotlin.Nothing? value='null' else: CALL .<get-length> type=kotlin.Int operator=GET_PROPERTY
then: CONST Null type=kotlin.Nothing? value='null' $this: GET_VAR s type=kotlin.String? operator=null
else: CALL .<get-length> type=kotlin.Int operator=GET_PROPERTY
$this: GET_VAR s type=kotlin.String? operator=null
+73 -79
View File
@@ -1,80 +1,74 @@
IrFile /elvis.kt FILE /elvis.kt
IrProperty public val p: kotlin.Any? = null getter=null setter=null PROPERTY public val p: kotlin.Any? = null getter=null setter=null
IrExpressionBody EXPRESSION_BODY
CONST Null type=kotlin.Nothing? value='null' CONST Null type=kotlin.Nothing? value='null'
IrFunction public fun foo(): kotlin.Any? FUN public fun foo(): kotlin.Any?
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null RETURN type=<no-type>
RETURN type=<no-type> CONST Null type=kotlin.Nothing? value='null'
CONST Null type=kotlin.Nothing? value='null' FUN public fun test1(/*0*/ a: kotlin.Any?, /*1*/ b: kotlin.Any): kotlin.Any
IrFunction public fun test1(/*0*/ a: kotlin.Any?, /*1*/ b: kotlin.Any): kotlin.Any BLOCK_BODY
IrExpressionBody RETURN type=<no-type>
BLOCK type=<no-type> hasResult=false operator=null BLOCK type=kotlin.Any operator=ELVIS
RETURN type=<no-type> WHEN type=kotlin.Any operator=null
BLOCK type=kotlin.Any hasResult=true operator=ELVIS if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
WHEN type=kotlin.Any operator=null arg0: GET_VAR a type=kotlin.Any? operator=null
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ arg1: CONST Null type=kotlin.Nothing? value='null'
arg0: GET_VAR a type=kotlin.Any? operator=null then: GET_VAR b type=kotlin.Any operator=null
arg1: CONST Null type=kotlin.Nothing? value='null' else: GET_VAR a type=kotlin.Any? operator=null
then: GET_VAR b type=kotlin.Any operator=null FUN public fun test2(/*0*/ a: kotlin.String?, /*1*/ b: kotlin.Any): kotlin.Any
else: GET_VAR a type=kotlin.Any? operator=null BLOCK_BODY
IrFunction public fun test2(/*0*/ a: kotlin.String?, /*1*/ b: kotlin.Any): kotlin.Any RETURN type=<no-type>
IrExpressionBody BLOCK type=kotlin.Any operator=ELVIS
BLOCK type=<no-type> hasResult=false operator=null WHEN type=kotlin.Any operator=null
RETURN type=<no-type> if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
BLOCK type=kotlin.Any hasResult=true operator=ELVIS arg0: GET_VAR a type=kotlin.String? operator=null
WHEN type=kotlin.Any operator=null arg1: CONST Null type=kotlin.Nothing? value='null'
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ then: GET_VAR b type=kotlin.Any operator=null
arg0: GET_VAR a type=kotlin.String? operator=null else: GET_VAR a type=kotlin.String? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null' FUN public fun test3(/*0*/ a: kotlin.Any?, /*1*/ b: kotlin.Any?): kotlin.String
then: GET_VAR b type=kotlin.Any operator=null BLOCK_BODY
else: GET_VAR a type=kotlin.String? operator=null WHEN type=kotlin.Unit operator=IF
IrFunction public fun test3(/*0*/ a: kotlin.Any?, /*1*/ b: kotlin.Any?): kotlin.String if: TYPE_OP operator=NOT_INSTANCEOF typeOperand=kotlin.String
IrExpressionBody GET_VAR b type=kotlin.Any? operator=null
BLOCK type=<no-type> hasResult=false operator=null then: RETURN type=<no-type>
WHEN type=kotlin.Unit operator=IF CONST String type=kotlin.String value=''
if: TYPE_OP operator=NOT_INSTANCEOF typeOperand=kotlin.String WHEN type=kotlin.Unit operator=IF
GET_VAR b type=kotlin.Any? operator=null if: TYPE_OP operator=NOT_INSTANCEOF typeOperand=kotlin.String?
then: RETURN type=<no-type> GET_VAR a type=kotlin.Any? operator=null
CONST String type=kotlin.String value='' then: RETURN type=<no-type>
WHEN type=kotlin.Unit operator=IF CONST String type=kotlin.String value=''
if: TYPE_OP operator=NOT_INSTANCEOF typeOperand=kotlin.String? RETURN type=<no-type>
GET_VAR a type=kotlin.Any? operator=null BLOCK type=kotlin.String operator=ELVIS
then: RETURN type=<no-type> WHEN type=kotlin.String operator=null
CONST String type=kotlin.String value='' if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
RETURN type=<no-type> arg0: GET_VAR a type=kotlin.Any? operator=null
BLOCK type=kotlin.String hasResult=true operator=ELVIS arg1: CONST Null type=kotlin.Nothing? value='null'
WHEN type=kotlin.String operator=null then: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.String
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ GET_VAR b type=kotlin.Any? operator=null
arg0: GET_VAR a type=kotlin.Any? operator=null else: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.String
arg1: CONST Null type=kotlin.Nothing? value='null' GET_VAR a type=kotlin.Any? operator=null
then: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.String FUN public fun test4(/*0*/ x: kotlin.Any): kotlin.Any
GET_VAR b type=kotlin.Any? operator=null BLOCK_BODY
else: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.String RETURN type=<no-type>
GET_VAR a type=kotlin.Any? operator=null BLOCK type=kotlin.Any operator=ELVIS
IrFunction public fun test4(/*0*/ x: kotlin.Any): kotlin.Any VAR val tmp0_elvis_lhs: kotlin.Any?
IrExpressionBody CALL .<get-p> type=kotlin.Any? operator=GET_PROPERTY
BLOCK type=<no-type> hasResult=false operator=null WHEN type=kotlin.Any operator=null
RETURN type=<no-type> if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
BLOCK type=kotlin.Any hasResult=true operator=ELVIS arg0: GET_VAR tmp0_elvis_lhs type=kotlin.Any? operator=null
VAR val tmp0_elvis_lhs: kotlin.Any? arg1: CONST Null type=kotlin.Nothing? value='null'
CALL .<get-p> type=kotlin.Any? operator=GET_PROPERTY then: GET_VAR x type=kotlin.Any operator=null
WHEN type=kotlin.Any operator=null else: GET_VAR tmp0_elvis_lhs type=kotlin.Any? operator=null
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ FUN public fun test5(/*0*/ x: kotlin.Any): kotlin.Any
arg0: GET_VAR tmp0_elvis_lhs type=kotlin.Any? operator=null BLOCK_BODY
arg1: CONST Null type=kotlin.Nothing? value='null' RETURN type=<no-type>
then: GET_VAR x type=kotlin.Any operator=null BLOCK type=kotlin.Any operator=ELVIS
else: GET_VAR tmp0_elvis_lhs type=kotlin.Any? operator=null VAR val tmp0_elvis_lhs: kotlin.Any?
IrFunction public fun test5(/*0*/ x: kotlin.Any): kotlin.Any CALL .foo type=kotlin.Any? operator=null
IrExpressionBody WHEN type=kotlin.Any operator=null
BLOCK type=<no-type> hasResult=false operator=null if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
RETURN type=<no-type> arg0: GET_VAR tmp0_elvis_lhs type=kotlin.Any? operator=null
BLOCK type=kotlin.Any hasResult=true operator=ELVIS arg1: CONST Null type=kotlin.Nothing? value='null'
VAR val tmp0_elvis_lhs: kotlin.Any? then: GET_VAR x type=kotlin.Any operator=null
CALL .foo type=kotlin.Any? operator=null else: GET_VAR tmp0_elvis_lhs type=kotlin.Any? operator=null
WHEN type=kotlin.Any operator=null
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR tmp0_elvis_lhs type=kotlin.Any? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null'
then: GET_VAR x type=kotlin.Any operator=null
else: GET_VAR tmp0_elvis_lhs type=kotlin.Any? operator=null
+18 -21
View File
@@ -1,23 +1,20 @@
IrFile /equality.kt FILE /equality.kt
IrFunction public fun test1(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Boolean FUN public fun test1(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Boolean
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null RETURN type=<no-type>
RETURN type=<no-type> CALL .EQEQ type=kotlin.Boolean operator=EQEQ
CALL .EQEQ type=kotlin.Boolean operator=EQEQ arg0: GET_VAR a type=kotlin.Int operator=null
arg1: GET_VAR b type=kotlin.Int operator=null
FUN public fun test2(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Boolean
BLOCK_BODY
RETURN type=<no-type>
CALL .NOT type=kotlin.Boolean operator=EXCLEQ
arg0: CALL .EQEQ type=kotlin.Boolean operator=EXCLEQ
arg0: GET_VAR a type=kotlin.Int operator=null arg0: GET_VAR a type=kotlin.Int operator=null
arg1: GET_VAR b type=kotlin.Int operator=null arg1: GET_VAR b type=kotlin.Int operator=null
IrFunction public fun test2(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Boolean FUN public fun test3(/*0*/ a: kotlin.Any?, /*1*/ b: kotlin.Any?): kotlin.Boolean
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null RETURN type=<no-type>
RETURN type=<no-type> CALL .EQEQ type=kotlin.Boolean operator=EQEQ
CALL .NOT type=kotlin.Boolean operator=EXCLEQ arg0: GET_VAR a type=kotlin.Any? operator=null
arg0: CALL .EQEQ type=kotlin.Boolean operator=EXCLEQ arg1: GET_VAR b type=kotlin.Any? operator=null
arg0: GET_VAR a type=kotlin.Int operator=null
arg1: GET_VAR b type=kotlin.Int operator=null
IrFunction public fun test3(/*0*/ a: kotlin.Any?, /*1*/ b: kotlin.Any?): kotlin.Boolean
IrExpressionBody
BLOCK type=<no-type> hasResult=false operator=null
RETURN type=<no-type>
CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR a type=kotlin.Any? operator=null
arg1: GET_VAR b type=kotlin.Any? operator=null
+11 -13
View File
@@ -1,13 +1,11 @@
IrFile /extensionPropertyGetterCall.kt FILE /extensionPropertyGetterCall.kt
IrProperty public val kotlin.String.okext: kotlin.String getter=<get-okext> setter=null PROPERTY public val kotlin.String.okext: kotlin.String getter=<get-okext> setter=null
IrPropertyGetter public fun kotlin.String.<get-okext>(): kotlin.String property=okext PROPERTY_GETTER public fun kotlin.String.<get-okext>(): kotlin.String property=okext
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null RETURN type=<no-type>
RETURN type=<no-type> CONST String type=kotlin.String value='OK'
CONST String type=kotlin.String value='OK' FUN public fun kotlin.String.test5(): kotlin.String
IrFunction public fun kotlin.String.test5(): kotlin.String BLOCK_BODY
IrExpressionBody RETURN type=<no-type>
BLOCK type=<no-type> hasResult=false operator=null CALL .<get-okext> type=kotlin.String operator=GET_PROPERTY
RETURN type=<no-type> $receiver: $RECEIVER of: test5 type=kotlin.String
CALL .<get-okext> type=kotlin.String operator=GET_PROPERTY
$receiver: $RECEIVER of: test5 type=kotlin.String
+41 -43
View File
@@ -1,43 +1,41 @@
IrFile /for.kt FILE /for.kt
IrFunction public fun testIterable(/*0*/ ss: kotlin.collections.List<kotlin.String>): kotlin.Unit FUN public fun testIterable(/*0*/ ss: kotlin.collections.List<kotlin.String>): kotlin.Unit
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null BLOCK type=kotlin.Unit operator=FOR_LOOP
BLOCK type=kotlin.Unit hasResult=false operator=FOR_LOOP VAR val tmp0_iterator: kotlin.collections.Iterator<kotlin.String>
VAR val tmp0_iterator: kotlin.collections.Iterator<kotlin.String> CALL .iterator type=kotlin.collections.Iterator<kotlin.String> operator=FOR_LOOP_ITERATOR
CALL .iterator type=kotlin.collections.Iterator<kotlin.String> operator=FOR_LOOP_ITERATOR $this: GET_VAR ss type=kotlin.collections.List<kotlin.String> operator=null
$this: GET_VAR ss type=kotlin.collections.List<kotlin.String> operator=null WHILE label=null operator=FOR_LOOP_INNER_WHILE
WHILE label=null operator=FOR_LOOP_INNER_WHILE condition: CALL .hasNext type=kotlin.Boolean operator=FOR_LOOP_HAS_NEXT
condition: CALL .hasNext type=kotlin.Boolean operator=FOR_LOOP_HAS_NEXT $this: GET_VAR tmp0_iterator type=kotlin.collections.Iterator<kotlin.String> operator=null
$this: GET_VAR tmp0_iterator type=kotlin.collections.Iterator<kotlin.String> operator=null body: BLOCK type=kotlin.Unit operator=FOR_LOOP_INNER_WHILE
body: BLOCK type=kotlin.Unit hasResult=false operator=FOR_LOOP_INNER_WHILE VAR val s: kotlin.String
VAR val s: kotlin.String CALL .next type=kotlin.String operator=FOR_LOOP_NEXT
CALL .next type=kotlin.String operator=FOR_LOOP_NEXT $this: GET_VAR tmp0_iterator type=kotlin.collections.Iterator<kotlin.String> operator=null
$this: GET_VAR tmp0_iterator type=kotlin.collections.Iterator<kotlin.String> operator=null BLOCK type=kotlin.Unit operator=null
BLOCK type=<no-type> hasResult=false operator=null CALL .println type=kotlin.Unit operator=null
CALL .println type=kotlin.Unit operator=null message: GET_VAR s type=kotlin.String operator=null
message: GET_VAR s type=kotlin.String operator=null FUN public fun testDestructuring(/*0*/ pp: kotlin.collections.List<kotlin.Pair<kotlin.Int, kotlin.String>>): kotlin.Unit
IrFunction public fun testDestructuring(/*0*/ pp: kotlin.collections.List<kotlin.Pair<kotlin.Int, kotlin.String>>): kotlin.Unit BLOCK_BODY
IrExpressionBody BLOCK type=kotlin.Unit operator=FOR_LOOP
BLOCK type=<no-type> hasResult=false operator=null VAR val tmp0_iterator: kotlin.collections.Iterator<kotlin.Pair<kotlin.Int, kotlin.String>>
BLOCK type=kotlin.Unit hasResult=false operator=FOR_LOOP CALL .iterator type=kotlin.collections.Iterator<kotlin.Pair<kotlin.Int, kotlin.String>> operator=FOR_LOOP_ITERATOR
VAR val tmp0_iterator: kotlin.collections.Iterator<kotlin.Pair<kotlin.Int, kotlin.String>> $this: GET_VAR pp type=kotlin.collections.List<kotlin.Pair<kotlin.Int, kotlin.String>> operator=null
CALL .iterator type=kotlin.collections.Iterator<kotlin.Pair<kotlin.Int, kotlin.String>> operator=FOR_LOOP_ITERATOR WHILE label=null operator=FOR_LOOP_INNER_WHILE
$this: GET_VAR pp type=kotlin.collections.List<kotlin.Pair<kotlin.Int, kotlin.String>> operator=null condition: CALL .hasNext type=kotlin.Boolean operator=FOR_LOOP_HAS_NEXT
WHILE label=null operator=FOR_LOOP_INNER_WHILE $this: GET_VAR tmp0_iterator type=kotlin.collections.Iterator<kotlin.Pair<kotlin.Int, kotlin.String>> operator=null
condition: CALL .hasNext type=kotlin.Boolean operator=FOR_LOOP_HAS_NEXT body: BLOCK type=kotlin.Unit operator=FOR_LOOP_INNER_WHILE
$this: GET_VAR tmp0_iterator type=kotlin.collections.Iterator<kotlin.Pair<kotlin.Int, kotlin.String>> operator=null VAR val tmp1_loop_parameter: kotlin.Pair<kotlin.Int, kotlin.String>
body: BLOCK type=kotlin.Unit hasResult=false operator=FOR_LOOP_INNER_WHILE CALL .next type=kotlin.Pair<kotlin.Int, kotlin.String> operator=FOR_LOOP_NEXT
VAR val tmp1_loop_parameter: kotlin.Pair<kotlin.Int, kotlin.String> $this: GET_VAR tmp0_iterator type=kotlin.collections.Iterator<kotlin.Pair<kotlin.Int, kotlin.String>> operator=null
CALL .next type=kotlin.Pair<kotlin.Int, kotlin.String> operator=FOR_LOOP_NEXT VAR val i: kotlin.Int
$this: GET_VAR tmp0_iterator type=kotlin.collections.Iterator<kotlin.Pair<kotlin.Int, kotlin.String>> operator=null CALL .component1 type=kotlin.Int operator=COMPONENT_N(index=1)
VAR val i: kotlin.Int $this: GET_VAR tmp1_loop_parameter type=kotlin.Pair<kotlin.Int, kotlin.String> operator=null
CALL .component1 type=kotlin.Int operator=COMPONENT_N(index=1) VAR val s: kotlin.String
$this: GET_VAR tmp1_loop_parameter type=kotlin.Pair<kotlin.Int, kotlin.String> operator=null CALL .component2 type=kotlin.String operator=COMPONENT_N(index=2)
VAR val s: kotlin.String $this: GET_VAR tmp1_loop_parameter type=kotlin.Pair<kotlin.Int, kotlin.String> operator=null
CALL .component2 type=kotlin.String operator=COMPONENT_N(index=2) BLOCK type=kotlin.Unit operator=null
$this: GET_VAR tmp1_loop_parameter type=kotlin.Pair<kotlin.Int, kotlin.String> operator=null CALL .println type=kotlin.Unit operator=null
BLOCK type=<no-type> hasResult=false operator=null message: GET_VAR i type=kotlin.Int operator=null
CALL .println type=kotlin.Unit operator=null CALL .println type=kotlin.Unit operator=null
message: GET_VAR i type=kotlin.Int operator=null message: GET_VAR s type=kotlin.String operator=null
CALL .println type=kotlin.Unit operator=null
message: GET_VAR s type=kotlin.String operator=null
+91 -95
View File
@@ -1,95 +1,91 @@
IrFile /forWithBreakContinue.kt FILE /forWithBreakContinue.kt
IrFunction public fun testForBreak1(/*0*/ ss: kotlin.collections.List<kotlin.String>): kotlin.Unit FUN public fun testForBreak1(/*0*/ ss: kotlin.collections.List<kotlin.String>): kotlin.Unit
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null BLOCK type=kotlin.Unit operator=FOR_LOOP
BLOCK type=kotlin.Unit hasResult=false operator=FOR_LOOP VAR val tmp0_iterator: kotlin.collections.Iterator<kotlin.String>
VAR val tmp0_iterator: kotlin.collections.Iterator<kotlin.String> CALL .iterator type=kotlin.collections.Iterator<kotlin.String> operator=FOR_LOOP_ITERATOR
CALL .iterator type=kotlin.collections.Iterator<kotlin.String> operator=FOR_LOOP_ITERATOR $this: GET_VAR ss type=kotlin.collections.List<kotlin.String> operator=null
$this: GET_VAR ss type=kotlin.collections.List<kotlin.String> operator=null WHILE label=null operator=FOR_LOOP_INNER_WHILE
WHILE label=null operator=FOR_LOOP_INNER_WHILE condition: CALL .hasNext type=kotlin.Boolean operator=FOR_LOOP_HAS_NEXT
condition: CALL .hasNext type=kotlin.Boolean operator=FOR_LOOP_HAS_NEXT $this: GET_VAR tmp0_iterator type=kotlin.collections.Iterator<kotlin.String> operator=null
$this: GET_VAR tmp0_iterator type=kotlin.collections.Iterator<kotlin.String> operator=null body: BLOCK type=kotlin.Unit operator=FOR_LOOP_INNER_WHILE
body: BLOCK type=kotlin.Unit hasResult=false operator=FOR_LOOP_INNER_WHILE VAR val s: kotlin.String
VAR val s: kotlin.String CALL .next type=kotlin.String operator=FOR_LOOP_NEXT
CALL .next type=kotlin.String operator=FOR_LOOP_NEXT $this: GET_VAR tmp0_iterator type=kotlin.collections.Iterator<kotlin.String> operator=null
$this: GET_VAR tmp0_iterator type=kotlin.collections.Iterator<kotlin.String> operator=null BLOCK type=kotlin.Nothing operator=null
BLOCK type=<no-type> hasResult=false operator=null BREAK label=null depth=0
BREAK label=null depth=0 FUN public fun testForBreak2(/*0*/ ss: kotlin.collections.List<kotlin.String>): kotlin.Unit
IrFunction public fun testForBreak2(/*0*/ ss: kotlin.collections.List<kotlin.String>): kotlin.Unit BLOCK_BODY
IrExpressionBody BLOCK type=kotlin.Unit operator=FOR_LOOP
BLOCK type=<no-type> hasResult=false operator=null VAR val tmp0_iterator: kotlin.collections.Iterator<kotlin.String>
BLOCK type=kotlin.Unit hasResult=false operator=FOR_LOOP CALL .iterator type=kotlin.collections.Iterator<kotlin.String> operator=FOR_LOOP_ITERATOR
VAR val tmp0_iterator: kotlin.collections.Iterator<kotlin.String> $this: GET_VAR ss type=kotlin.collections.List<kotlin.String> operator=null
CALL .iterator type=kotlin.collections.Iterator<kotlin.String> operator=FOR_LOOP_ITERATOR WHILE label=OUTER operator=FOR_LOOP_INNER_WHILE
$this: GET_VAR ss type=kotlin.collections.List<kotlin.String> operator=null condition: CALL .hasNext type=kotlin.Boolean operator=FOR_LOOP_HAS_NEXT
WHILE label=OUTER operator=FOR_LOOP_INNER_WHILE $this: GET_VAR tmp0_iterator type=kotlin.collections.Iterator<kotlin.String> operator=null
condition: CALL .hasNext type=kotlin.Boolean operator=FOR_LOOP_HAS_NEXT body: BLOCK type=kotlin.Unit operator=FOR_LOOP_INNER_WHILE
$this: GET_VAR tmp0_iterator type=kotlin.collections.Iterator<kotlin.String> operator=null VAR val s1: kotlin.String
body: BLOCK type=kotlin.Unit hasResult=false operator=FOR_LOOP_INNER_WHILE CALL .next type=kotlin.String operator=FOR_LOOP_NEXT
VAR val s1: kotlin.String $this: GET_VAR tmp0_iterator type=kotlin.collections.Iterator<kotlin.String> operator=null
CALL .next type=kotlin.String operator=FOR_LOOP_NEXT BLOCK type=kotlin.Nothing operator=null
$this: GET_VAR tmp0_iterator type=kotlin.collections.Iterator<kotlin.String> operator=null BLOCK type=kotlin.Unit operator=FOR_LOOP
BLOCK type=<no-type> hasResult=false operator=null VAR val tmp1_iterator: kotlin.collections.Iterator<kotlin.String>
BLOCK type=kotlin.Unit hasResult=false operator=FOR_LOOP CALL .iterator type=kotlin.collections.Iterator<kotlin.String> operator=FOR_LOOP_ITERATOR
VAR val tmp1_iterator: kotlin.collections.Iterator<kotlin.String> $this: GET_VAR ss type=kotlin.collections.List<kotlin.String> operator=null
CALL .iterator type=kotlin.collections.Iterator<kotlin.String> operator=FOR_LOOP_ITERATOR WHILE label=INNER operator=FOR_LOOP_INNER_WHILE
$this: GET_VAR ss type=kotlin.collections.List<kotlin.String> operator=null condition: CALL .hasNext type=kotlin.Boolean operator=FOR_LOOP_HAS_NEXT
WHILE label=INNER operator=FOR_LOOP_INNER_WHILE $this: GET_VAR tmp1_iterator type=kotlin.collections.Iterator<kotlin.String> operator=null
condition: CALL .hasNext type=kotlin.Boolean operator=FOR_LOOP_HAS_NEXT body: BLOCK type=kotlin.Unit operator=FOR_LOOP_INNER_WHILE
$this: GET_VAR tmp1_iterator type=kotlin.collections.Iterator<kotlin.String> operator=null VAR val s2: kotlin.String
body: BLOCK type=kotlin.Unit hasResult=false operator=FOR_LOOP_INNER_WHILE CALL .next type=kotlin.String operator=FOR_LOOP_NEXT
VAR val s2: kotlin.String $this: GET_VAR tmp1_iterator type=kotlin.collections.Iterator<kotlin.String> operator=null
CALL .next type=kotlin.String operator=FOR_LOOP_NEXT BLOCK type=kotlin.Nothing operator=null
$this: GET_VAR tmp1_iterator type=kotlin.collections.Iterator<kotlin.String> operator=null BREAK label=OUTER depth=1
BLOCK type=<no-type> hasResult=false operator=null BREAK label=INNER depth=0
BREAK label=OUTER depth=1 BREAK label=null depth=0
BREAK label=INNER depth=0 BREAK label=OUTER depth=0
BREAK label=null depth=0 FUN public fun testForContinue1(/*0*/ ss: kotlin.collections.List<kotlin.String>): kotlin.Unit
BREAK label=OUTER depth=0 BLOCK_BODY
IrFunction public fun testForContinue1(/*0*/ ss: kotlin.collections.List<kotlin.String>): kotlin.Unit BLOCK type=kotlin.Unit operator=FOR_LOOP
IrExpressionBody VAR val tmp0_iterator: kotlin.collections.Iterator<kotlin.String>
BLOCK type=<no-type> hasResult=false operator=null CALL .iterator type=kotlin.collections.Iterator<kotlin.String> operator=FOR_LOOP_ITERATOR
BLOCK type=kotlin.Unit hasResult=false operator=FOR_LOOP $this: GET_VAR ss type=kotlin.collections.List<kotlin.String> operator=null
VAR val tmp0_iterator: kotlin.collections.Iterator<kotlin.String> WHILE label=null operator=FOR_LOOP_INNER_WHILE
CALL .iterator type=kotlin.collections.Iterator<kotlin.String> operator=FOR_LOOP_ITERATOR condition: CALL .hasNext type=kotlin.Boolean operator=FOR_LOOP_HAS_NEXT
$this: GET_VAR ss type=kotlin.collections.List<kotlin.String> operator=null $this: GET_VAR tmp0_iterator type=kotlin.collections.Iterator<kotlin.String> operator=null
WHILE label=null operator=FOR_LOOP_INNER_WHILE body: BLOCK type=kotlin.Unit operator=FOR_LOOP_INNER_WHILE
condition: CALL .hasNext type=kotlin.Boolean operator=FOR_LOOP_HAS_NEXT VAR val s: kotlin.String
$this: GET_VAR tmp0_iterator type=kotlin.collections.Iterator<kotlin.String> operator=null CALL .next type=kotlin.String operator=FOR_LOOP_NEXT
body: BLOCK type=kotlin.Unit hasResult=false operator=FOR_LOOP_INNER_WHILE $this: GET_VAR tmp0_iterator type=kotlin.collections.Iterator<kotlin.String> operator=null
VAR val s: kotlin.String BLOCK type=kotlin.Nothing operator=null
CALL .next type=kotlin.String operator=FOR_LOOP_NEXT CONTINUE label=null depth=0
$this: GET_VAR tmp0_iterator type=kotlin.collections.Iterator<kotlin.String> operator=null FUN public fun testForContinue2(/*0*/ ss: kotlin.collections.List<kotlin.String>): kotlin.Unit
BLOCK type=<no-type> hasResult=false operator=null BLOCK_BODY
CONTINUE label=null depth=0 BLOCK type=kotlin.Unit operator=FOR_LOOP
IrFunction public fun testForContinue2(/*0*/ ss: kotlin.collections.List<kotlin.String>): kotlin.Unit VAR val tmp0_iterator: kotlin.collections.Iterator<kotlin.String>
IrExpressionBody CALL .iterator type=kotlin.collections.Iterator<kotlin.String> operator=FOR_LOOP_ITERATOR
BLOCK type=<no-type> hasResult=false operator=null $this: GET_VAR ss type=kotlin.collections.List<kotlin.String> operator=null
BLOCK type=kotlin.Unit hasResult=false operator=FOR_LOOP WHILE label=OUTER operator=FOR_LOOP_INNER_WHILE
VAR val tmp0_iterator: kotlin.collections.Iterator<kotlin.String> condition: CALL .hasNext type=kotlin.Boolean operator=FOR_LOOP_HAS_NEXT
CALL .iterator type=kotlin.collections.Iterator<kotlin.String> operator=FOR_LOOP_ITERATOR $this: GET_VAR tmp0_iterator type=kotlin.collections.Iterator<kotlin.String> operator=null
$this: GET_VAR ss type=kotlin.collections.List<kotlin.String> operator=null body: BLOCK type=kotlin.Unit operator=FOR_LOOP_INNER_WHILE
WHILE label=OUTER operator=FOR_LOOP_INNER_WHILE VAR val s1: kotlin.String
condition: CALL .hasNext type=kotlin.Boolean operator=FOR_LOOP_HAS_NEXT CALL .next type=kotlin.String operator=FOR_LOOP_NEXT
$this: GET_VAR tmp0_iterator type=kotlin.collections.Iterator<kotlin.String> operator=null $this: GET_VAR tmp0_iterator type=kotlin.collections.Iterator<kotlin.String> operator=null
body: BLOCK type=kotlin.Unit hasResult=false operator=FOR_LOOP_INNER_WHILE BLOCK type=kotlin.Nothing operator=null
VAR val s1: kotlin.String BLOCK type=kotlin.Unit operator=FOR_LOOP
CALL .next type=kotlin.String operator=FOR_LOOP_NEXT VAR val tmp1_iterator: kotlin.collections.Iterator<kotlin.String>
$this: GET_VAR tmp0_iterator type=kotlin.collections.Iterator<kotlin.String> operator=null CALL .iterator type=kotlin.collections.Iterator<kotlin.String> operator=FOR_LOOP_ITERATOR
BLOCK type=<no-type> hasResult=false operator=null $this: GET_VAR ss type=kotlin.collections.List<kotlin.String> operator=null
BLOCK type=kotlin.Unit hasResult=false operator=FOR_LOOP WHILE label=INNER operator=FOR_LOOP_INNER_WHILE
VAR val tmp1_iterator: kotlin.collections.Iterator<kotlin.String> condition: CALL .hasNext type=kotlin.Boolean operator=FOR_LOOP_HAS_NEXT
CALL .iterator type=kotlin.collections.Iterator<kotlin.String> operator=FOR_LOOP_ITERATOR $this: GET_VAR tmp1_iterator type=kotlin.collections.Iterator<kotlin.String> operator=null
$this: GET_VAR ss type=kotlin.collections.List<kotlin.String> operator=null body: BLOCK type=kotlin.Unit operator=FOR_LOOP_INNER_WHILE
WHILE label=INNER operator=FOR_LOOP_INNER_WHILE VAR val s2: kotlin.String
condition: CALL .hasNext type=kotlin.Boolean operator=FOR_LOOP_HAS_NEXT CALL .next type=kotlin.String operator=FOR_LOOP_NEXT
$this: GET_VAR tmp1_iterator type=kotlin.collections.Iterator<kotlin.String> operator=null $this: GET_VAR tmp1_iterator type=kotlin.collections.Iterator<kotlin.String> operator=null
body: BLOCK type=kotlin.Unit hasResult=false operator=FOR_LOOP_INNER_WHILE BLOCK type=kotlin.Nothing operator=null
VAR val s2: kotlin.String CONTINUE label=OUTER depth=1
CALL .next type=kotlin.String operator=FOR_LOOP_NEXT CONTINUE label=INNER depth=0
$this: GET_VAR tmp1_iterator type=kotlin.collections.Iterator<kotlin.String> operator=null CONTINUE label=null depth=0
BLOCK type=<no-type> hasResult=false operator=null CONTINUE label=OUTER depth=0
CONTINUE label=OUTER depth=1
CONTINUE label=INNER depth=0
CONTINUE label=null depth=0
CONTINUE label=OUTER depth=0
+20 -21
View File
@@ -1,24 +1,23 @@
IrFile /forWithImplicitReceivers.kt FILE /forWithImplicitReceivers.kt
DUMMY FiveTimes DUMMY FiveTimes
DUMMY IntCell DUMMY IntCell
DUMMY IReceiver DUMMY IReceiver
IrFunction public fun IReceiver.test(): kotlin.Unit FUN public fun IReceiver.test(): kotlin.Unit
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null BLOCK type=kotlin.Unit operator=FOR_LOOP
BLOCK type=kotlin.Unit hasResult=false operator=FOR_LOOP VAR val tmp0_iterator: IntCell
VAR val tmp0_iterator: IntCell CALL .iterator type=IntCell operator=FOR_LOOP_ITERATOR
CALL .iterator type=IntCell operator=FOR_LOOP_ITERATOR $this: $RECEIVER of: test type=IReceiver
$this: $RECEIVER of: test type=IReceiver $receiver: GET_OBJECT FiveTimes type=FiveTimes
$receiver: GET_OBJECT FiveTimes type=FiveTimes WHILE label=null operator=FOR_LOOP_INNER_WHILE
WHILE label=null operator=FOR_LOOP_INNER_WHILE condition: CALL .hasNext type=kotlin.Boolean operator=FOR_LOOP_HAS_NEXT
condition: CALL .hasNext type=kotlin.Boolean operator=FOR_LOOP_HAS_NEXT $this: $RECEIVER of: test type=IReceiver
$this: $RECEIVER of: test type=IReceiver $receiver: GET_VAR tmp0_iterator type=IntCell operator=null
$receiver: GET_VAR tmp0_iterator type=IntCell operator=null body: BLOCK type=kotlin.Unit operator=FOR_LOOP_INNER_WHILE
body: BLOCK type=kotlin.Unit hasResult=false operator=FOR_LOOP_INNER_WHILE VAR val i: kotlin.Int
VAR val i: kotlin.Int CALL .next type=kotlin.Int operator=FOR_LOOP_NEXT
CALL .next type=kotlin.Int operator=FOR_LOOP_NEXT $this: $RECEIVER of: test type=IReceiver
$this: $RECEIVER of: test type=IReceiver $receiver: GET_VAR tmp0_iterator type=IntCell operator=null
$receiver: GET_VAR tmp0_iterator type=IntCell operator=null BLOCK type=kotlin.Unit operator=null
BLOCK type=<no-type> hasResult=false operator=null CALL .println type=kotlin.Unit operator=null
CALL .println type=kotlin.Unit operator=null message: GET_VAR i type=kotlin.Int operator=null
message: GET_VAR i type=kotlin.Int operator=null
+18 -21
View File
@@ -1,23 +1,20 @@
IrFile /identity.kt FILE /identity.kt
IrFunction public fun test1(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Boolean FUN public fun test1(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Boolean
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null RETURN type=<no-type>
RETURN type=<no-type> CALL .EQEQEQ type=kotlin.Boolean operator=EQEQEQ
CALL .EQEQEQ type=kotlin.Boolean operator=EQEQEQ arg0: GET_VAR a type=kotlin.Int operator=null
arg1: GET_VAR b type=kotlin.Int operator=null
FUN public fun test2(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Boolean
BLOCK_BODY
RETURN type=<no-type>
CALL .NOT type=kotlin.Boolean operator=EXCLEQEQ
arg0: CALL .EQEQEQ type=kotlin.Boolean operator=EXCLEQEQ
arg0: GET_VAR a type=kotlin.Int operator=null arg0: GET_VAR a type=kotlin.Int operator=null
arg1: GET_VAR b type=kotlin.Int operator=null arg1: GET_VAR b type=kotlin.Int operator=null
IrFunction public fun test2(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Boolean FUN public fun test3(/*0*/ a: kotlin.Any?, /*1*/ b: kotlin.Any?): kotlin.Boolean
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null RETURN type=<no-type>
RETURN type=<no-type> CALL .EQEQEQ type=kotlin.Boolean operator=EQEQEQ
CALL .NOT type=kotlin.Boolean operator=EXCLEQEQ arg0: GET_VAR a type=kotlin.Any? operator=null
arg0: CALL .EQEQEQ type=kotlin.Boolean operator=EXCLEQEQ arg1: GET_VAR b type=kotlin.Any? operator=null
arg0: GET_VAR a type=kotlin.Int operator=null
arg1: GET_VAR b type=kotlin.Int operator=null
IrFunction public fun test3(/*0*/ a: kotlin.Any?, /*1*/ b: kotlin.Any?): kotlin.Boolean
IrExpressionBody
BLOCK type=<no-type> hasResult=false operator=null
RETURN type=<no-type>
CALL .EQEQEQ type=kotlin.Boolean operator=EQEQEQ
arg0: GET_VAR a type=kotlin.Any? operator=null
arg1: GET_VAR b type=kotlin.Any? operator=null
+17 -18
View File
@@ -1,18 +1,17 @@
IrFile /ifElseIf.kt FILE /ifElseIf.kt
IrFunction public fun test(/*0*/ i: kotlin.Int): kotlin.Int FUN public fun test(/*0*/ i: kotlin.Int): kotlin.Int
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null RETURN type=<no-type>
RETURN type=<no-type> WHEN type=kotlin.Int operator=WHEN
WHEN type=kotlin.Int operator=WHEN if: CALL .GT0 type=kotlin.Boolean operator=GT
if: CALL .GT0 type=kotlin.Boolean operator=GT arg0: CALL .compareTo type=kotlin.Int operator=GT
arg0: CALL .compareTo type=kotlin.Int operator=GT $this: GET_VAR i type=kotlin.Int operator=null
$this: GET_VAR i type=kotlin.Int operator=null other: CONST Int type=kotlin.Int value='0'
other: CONST Int type=kotlin.Int value='0' then: CONST Int type=kotlin.Int value='1'
then: CONST Int type=kotlin.Int value='1' if: CALL .LT0 type=kotlin.Boolean operator=LT
if: CALL .LT0 type=kotlin.Boolean operator=LT arg0: CALL .compareTo type=kotlin.Int operator=LT
arg0: CALL .compareTo type=kotlin.Int operator=LT $this: GET_VAR i type=kotlin.Int operator=null
$this: GET_VAR i type=kotlin.Int operator=null other: CONST Int type=kotlin.Int value='0'
other: CONST Int type=kotlin.Int value='0' then: CALL .unaryMinus type=kotlin.Int operator=UMINUS
then: CALL .unaryMinus type=kotlin.Int operator=UMINUS $this: CONST Int type=kotlin.Int value='1'
$this: CONST Int type=kotlin.Int value='1' else: CONST Int type=kotlin.Int value='0'
else: CONST Int type=kotlin.Int value='0'
+7 -8
View File
@@ -1,8 +1,7 @@
IrFile /implicitCastOnPlatformType.kt FILE /implicitCastOnPlatformType.kt
IrFunction public fun test(): kotlin.String FUN public fun test(): kotlin.String
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null RETURN type=<no-type>
RETURN type=<no-type> TYPE_OP operator=IMPLICIT_NOTNULL typeOperand=kotlin.String
TYPE_OP operator=IMPLICIT_NOTNULL typeOperand=kotlin.String CALL .getProperty type=kotlin.String! operator=null
CALL .getProperty type=kotlin.String! operator=null p0: CONST String type=kotlin.String value='test'
p0: CONST String type=kotlin.String value='test'
+23 -27
View File
@@ -1,31 +1,27 @@
IrFile /in.kt FILE /in.kt
IrFunction public fun test1(/*0*/ a: kotlin.Any, /*1*/ x: kotlin.collections.Collection<kotlin.Any>): kotlin.Boolean FUN public fun test1(/*0*/ a: kotlin.Any, /*1*/ x: kotlin.collections.Collection<kotlin.Any>): kotlin.Boolean
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null RETURN type=<no-type>
RETURN type=<no-type> CALL .contains type=kotlin.Boolean operator=IN
CALL .contains type=kotlin.Boolean operator=IN $this: GET_VAR x type=kotlin.collections.Collection<kotlin.Any> operator=null
element: GET_VAR a type=kotlin.Any operator=null
FUN public fun test2(/*0*/ a: kotlin.Any, /*1*/ x: kotlin.collections.Collection<kotlin.Any>): kotlin.Boolean
BLOCK_BODY
RETURN type=<no-type>
CALL .NOT type=kotlin.Boolean operator=NOT_IN
arg0: CALL .contains type=kotlin.Boolean operator=NOT_IN
$this: GET_VAR x type=kotlin.collections.Collection<kotlin.Any> operator=null $this: GET_VAR x type=kotlin.collections.Collection<kotlin.Any> operator=null
element: GET_VAR a type=kotlin.Any operator=null element: GET_VAR a type=kotlin.Any operator=null
IrFunction public fun test2(/*0*/ a: kotlin.Any, /*1*/ x: kotlin.collections.Collection<kotlin.Any>): kotlin.Boolean FUN public fun </*0*/ T> test3(/*0*/ a: T, /*1*/ x: kotlin.collections.Collection<T>): kotlin.Boolean
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null RETURN type=<no-type>
RETURN type=<no-type> CALL .contains type=kotlin.Boolean operator=IN
CALL .NOT type=kotlin.Boolean operator=NOT_IN $this: GET_VAR x type=kotlin.collections.Collection<T> operator=null
arg0: CALL .contains type=kotlin.Boolean operator=NOT_IN element: GET_VAR a type=T operator=null
$this: GET_VAR x type=kotlin.collections.Collection<kotlin.Any> operator=null FUN public fun </*0*/ T> test4(/*0*/ a: T, /*1*/ x: kotlin.collections.Collection<T>): kotlin.Boolean
element: GET_VAR a type=kotlin.Any operator=null BLOCK_BODY
IrFunction public fun </*0*/ T> test3(/*0*/ a: T, /*1*/ x: kotlin.collections.Collection<T>): kotlin.Boolean RETURN type=<no-type>
IrExpressionBody CALL .NOT type=kotlin.Boolean operator=NOT_IN
BLOCK type=<no-type> hasResult=false operator=null arg0: CALL .contains type=kotlin.Boolean operator=NOT_IN
RETURN type=<no-type>
CALL .contains type=kotlin.Boolean operator=IN
$this: GET_VAR x type=kotlin.collections.Collection<T> operator=null $this: GET_VAR x type=kotlin.collections.Collection<T> operator=null
element: GET_VAR a type=T operator=null element: GET_VAR a type=T operator=null
IrFunction public fun </*0*/ T> test4(/*0*/ a: T, /*1*/ x: kotlin.collections.Collection<T>): kotlin.Boolean
IrExpressionBody
BLOCK type=<no-type> hasResult=false operator=null
RETURN type=<no-type>
CALL .NOT type=kotlin.Boolean operator=NOT_IN
arg0: CALL .contains type=kotlin.Boolean operator=NOT_IN
$this: GET_VAR x type=kotlin.collections.Collection<T> operator=null
element: GET_VAR a type=T operator=null
+133 -139
View File
@@ -1,151 +1,145 @@
IrFile /incrementDecrement.kt FILE /incrementDecrement.kt
IrProperty public var p: kotlin.Int getter=null setter=null PROPERTY public var p: kotlin.Int getter=null setter=null
IrExpressionBody EXPRESSION_BODY
CONST Int type=kotlin.Int value='0' CONST Int type=kotlin.Int value='0'
IrProperty public val arr: kotlin.IntArray getter=null setter=null PROPERTY public val arr: kotlin.IntArray getter=null setter=null
IrExpressionBody EXPRESSION_BODY
CALL .intArrayOf type=kotlin.IntArray operator=null CALL .intArrayOf type=kotlin.IntArray operator=null
elements: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.IntArray elements: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.IntArray
DUMMY vararg type=kotlin.Int DUMMY vararg type=kotlin.Int
IrFunction public fun testVarPrefix(): kotlin.Unit FUN public fun testVarPrefix(): kotlin.Unit
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null VAR var x: kotlin.Int
VAR var x: kotlin.Int CONST Int type=kotlin.Int value='0'
CONST Int type=kotlin.Int value='0' VAR val x1: kotlin.Int
VAR val x1: kotlin.Int BLOCK type=kotlin.Int operator=PREFIX_INCR
BLOCK type=kotlin.Int hasResult=true operator=PREFIX_INCR VAR val tmp0: kotlin.Int
VAR val tmp0: kotlin.Int CALL .inc type=kotlin.Int operator=PREFIX_INCR
CALL .inc type=kotlin.Int operator=PREFIX_INCR $this: GET_VAR x type=kotlin.Int operator=PREFIX_INCR
$this: GET_VAR x type=kotlin.Int operator=PREFIX_INCR SET_VAR x type=<no-type> operator=PREFIX_INCR
SET_VAR x type=<no-type> operator=PREFIX_INCR
GET_VAR tmp0 type=kotlin.Int operator=null
GET_VAR tmp0 type=kotlin.Int operator=null GET_VAR tmp0 type=kotlin.Int operator=null
VAR val x2: kotlin.Int GET_VAR tmp0 type=kotlin.Int operator=null
BLOCK type=kotlin.Int hasResult=true operator=PREFIX_DECR VAR val x2: kotlin.Int
VAR val tmp1: kotlin.Int BLOCK type=kotlin.Int operator=PREFIX_DECR
CALL .dec type=kotlin.Int operator=PREFIX_DECR VAR val tmp1: kotlin.Int
$this: GET_VAR x type=kotlin.Int operator=PREFIX_DECR CALL .dec type=kotlin.Int operator=PREFIX_DECR
SET_VAR x type=<no-type> operator=PREFIX_DECR $this: GET_VAR x type=kotlin.Int operator=PREFIX_DECR
GET_VAR tmp1 type=kotlin.Int operator=null SET_VAR x type=<no-type> operator=PREFIX_DECR
GET_VAR tmp1 type=kotlin.Int operator=null GET_VAR tmp1 type=kotlin.Int operator=null
IrFunction public fun testVarPostfix(): kotlin.Unit GET_VAR tmp1 type=kotlin.Int operator=null
IrExpressionBody FUN public fun testVarPostfix(): kotlin.Unit
BLOCK type=<no-type> hasResult=false operator=null BLOCK_BODY
VAR var x: kotlin.Int VAR var x: kotlin.Int
CONST Int type=kotlin.Int value='0' CONST Int type=kotlin.Int value='0'
VAR val x1: kotlin.Int VAR val x1: kotlin.Int
BLOCK type=kotlin.Int hasResult=true operator=POSTFIX_INCR BLOCK type=kotlin.Int operator=POSTFIX_INCR
VAR val tmp0: kotlin.Int VAR val tmp0: kotlin.Int
GET_VAR x type=kotlin.Int operator=POSTFIX_INCR GET_VAR x type=kotlin.Int operator=POSTFIX_INCR
SET_VAR x type=<no-type> operator=POSTFIX_INCR SET_VAR x type=<no-type> operator=POSTFIX_INCR
CALL .inc type=kotlin.Int operator=POSTFIX_INCR CALL .inc type=kotlin.Int operator=POSTFIX_INCR
$this: GET_VAR tmp0 type=kotlin.Int operator=null $this: GET_VAR tmp0 type=kotlin.Int operator=null
GET_VAR tmp0 type=kotlin.Int operator=null GET_VAR tmp0 type=kotlin.Int operator=null
VAR val x2: kotlin.Int VAR val x2: kotlin.Int
BLOCK type=kotlin.Int hasResult=true operator=POSTFIX_DECR BLOCK type=kotlin.Int operator=POSTFIX_DECR
VAR val tmp1: kotlin.Int VAR val tmp1: kotlin.Int
GET_VAR x type=kotlin.Int operator=POSTFIX_DECR GET_VAR x type=kotlin.Int operator=POSTFIX_DECR
SET_VAR x type=<no-type> operator=POSTFIX_DECR SET_VAR x type=<no-type> operator=POSTFIX_DECR
CALL .dec type=kotlin.Int operator=POSTFIX_DECR CALL .dec type=kotlin.Int operator=POSTFIX_DECR
$this: GET_VAR tmp1 type=kotlin.Int operator=null $this: GET_VAR tmp1 type=kotlin.Int operator=null
GET_VAR tmp1 type=kotlin.Int operator=null GET_VAR tmp1 type=kotlin.Int operator=null
IrFunction public fun testPropPrefix(): kotlin.Unit FUN public fun testPropPrefix(): kotlin.Unit
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null VAR val p1: kotlin.Int
VAR val p1: kotlin.Int BLOCK type=kotlin.Int operator=PREFIX_INCR
BLOCK type=kotlin.Int hasResult=true operator=PREFIX_INCR VAR val tmp0: kotlin.Int
VAR val tmp0: kotlin.Int CALL .inc type=kotlin.Int operator=PREFIX_INCR
CALL .inc type=kotlin.Int operator=PREFIX_INCR $this: CALL .<get-p> type=kotlin.Int operator=PREFIX_INCR
$this: CALL .<get-p> type=kotlin.Int operator=PREFIX_INCR CALL .<set-p> type=kotlin.Unit operator=PREFIX_INCR
CALL .<set-p> type=kotlin.Unit operator=PREFIX_INCR <set-?>: GET_VAR tmp0 type=kotlin.Int operator=null
<set-?>: GET_VAR tmp0 type=kotlin.Int operator=null GET_VAR tmp0 type=kotlin.Int operator=null
GET_VAR tmp0 type=kotlin.Int operator=null VAR val p2: kotlin.Int
VAR val p2: kotlin.Int BLOCK type=kotlin.Int operator=PREFIX_DECR
BLOCK type=kotlin.Int hasResult=true operator=PREFIX_DECR VAR val tmp1: kotlin.Int
VAR val tmp1: kotlin.Int CALL .dec type=kotlin.Int operator=PREFIX_DECR
CALL .dec type=kotlin.Int operator=PREFIX_DECR $this: CALL .<get-p> type=kotlin.Int operator=PREFIX_DECR
$this: CALL .<get-p> type=kotlin.Int operator=PREFIX_DECR CALL .<set-p> type=kotlin.Unit operator=PREFIX_DECR
CALL .<set-p> type=kotlin.Unit operator=PREFIX_DECR <set-?>: GET_VAR tmp1 type=kotlin.Int operator=null
<set-?>: GET_VAR tmp1 type=kotlin.Int operator=null GET_VAR tmp1 type=kotlin.Int operator=null
GET_VAR tmp1 type=kotlin.Int operator=null FUN public fun testPropPostfix(): kotlin.Unit
IrFunction public fun testPropPostfix(): kotlin.Unit BLOCK_BODY
IrExpressionBody VAR val p1: kotlin.Int
BLOCK type=<no-type> hasResult=false operator=null BLOCK type=kotlin.Int operator=POSTFIX_INCR
VAR val p1: kotlin.Int VAR val tmp0: kotlin.Int
BLOCK type=kotlin.Int hasResult=true operator=POSTFIX_INCR CALL .<get-p> type=kotlin.Int operator=POSTFIX_INCR
VAR val tmp0: kotlin.Int CALL .<set-p> type=kotlin.Unit operator=POSTFIX_INCR
CALL .<get-p> type=kotlin.Int operator=POSTFIX_INCR <set-?>: CALL .inc type=kotlin.Int operator=POSTFIX_INCR
CALL .<set-p> type=kotlin.Unit operator=POSTFIX_INCR $this: GET_VAR tmp0 type=kotlin.Int operator=null
<set-?>: CALL .inc type=kotlin.Int operator=POSTFIX_INCR GET_VAR tmp0 type=kotlin.Int operator=null
$this: GET_VAR tmp0 type=kotlin.Int operator=null VAR val p2: kotlin.Int
GET_VAR tmp0 type=kotlin.Int operator=null BLOCK type=kotlin.Int operator=PREFIX_DECR
VAR val p2: kotlin.Int VAR val tmp1: kotlin.Int
BLOCK type=kotlin.Int hasResult=true operator=PREFIX_DECR CALL .dec type=kotlin.Int operator=PREFIX_DECR
VAR val tmp1: kotlin.Int $this: CALL .<get-p> type=kotlin.Int operator=PREFIX_DECR
CALL .dec type=kotlin.Int operator=PREFIX_DECR CALL .<set-p> type=kotlin.Unit operator=PREFIX_DECR
$this: CALL .<get-p> type=kotlin.Int operator=PREFIX_DECR <set-?>: GET_VAR tmp1 type=kotlin.Int operator=null
CALL .<set-p> type=kotlin.Unit operator=PREFIX_DECR GET_VAR tmp1 type=kotlin.Int operator=null
<set-?>: GET_VAR tmp1 type=kotlin.Int operator=null FUN public fun testArrayPrefix(): kotlin.Unit
GET_VAR tmp1 type=kotlin.Int operator=null BLOCK_BODY
IrFunction public fun testArrayPrefix(): kotlin.Unit VAR val a1: kotlin.Int
IrExpressionBody BLOCK type=kotlin.Int operator=PREFIX_INCR
BLOCK type=<no-type> hasResult=false operator=null VAR val tmp0_array: kotlin.IntArray
VAR val a1: kotlin.Int CALL .<get-arr> type=kotlin.IntArray operator=GET_PROPERTY
BLOCK type=kotlin.Int hasResult=true operator=PREFIX_INCR VAR val tmp1: kotlin.Int
VAR val tmp0_array: kotlin.IntArray CALL .inc type=kotlin.Int operator=PREFIX_INCR
CALL .<get-arr> type=kotlin.IntArray operator=GET_PROPERTY $this: CALL .get type=kotlin.Int operator=PREFIX_INCR
VAR val tmp1: kotlin.Int
CALL .inc type=kotlin.Int operator=PREFIX_INCR
$this: CALL .get type=kotlin.Int operator=PREFIX_INCR
$this: GET_VAR tmp0_array type=kotlin.IntArray operator=null
index: CONST Int type=kotlin.Int value='0'
CALL .set type=kotlin.Unit operator=PREFIX_INCR
$this: GET_VAR tmp0_array type=kotlin.IntArray operator=null
index: CONST Int type=kotlin.Int value='0'
value: GET_VAR tmp1 type=kotlin.Int operator=null
GET_VAR tmp1 type=kotlin.Int operator=null
VAR val a2: kotlin.Int
BLOCK type=kotlin.Int hasResult=true operator=PREFIX_DECR
VAR val tmp2_array: kotlin.IntArray
CALL .<get-arr> type=kotlin.IntArray operator=GET_PROPERTY
VAR val tmp3: kotlin.Int
CALL .dec type=kotlin.Int operator=PREFIX_DECR
$this: CALL .get type=kotlin.Int operator=PREFIX_DECR
$this: GET_VAR tmp2_array type=kotlin.IntArray operator=null
index: CONST Int type=kotlin.Int value='0'
CALL .set type=kotlin.Unit operator=PREFIX_DECR
$this: GET_VAR tmp2_array type=kotlin.IntArray operator=null
index: CONST Int type=kotlin.Int value='0'
value: GET_VAR tmp3 type=kotlin.Int operator=null
GET_VAR tmp3 type=kotlin.Int operator=null
IrFunction public fun testArrayPostfix(): kotlin.Unit
IrExpressionBody
BLOCK type=<no-type> hasResult=false operator=null
VAR val a1: kotlin.Int
BLOCK type=kotlin.Int hasResult=true operator=POSTFIX_INCR
VAR val tmp0_array: kotlin.IntArray
CALL .<get-arr> type=kotlin.IntArray operator=GET_PROPERTY
VAR val tmp1: kotlin.Int
CALL .get type=kotlin.Int operator=POSTFIX_INCR
$this: GET_VAR tmp0_array type=kotlin.IntArray operator=null $this: GET_VAR tmp0_array type=kotlin.IntArray operator=null
index: CONST Int type=kotlin.Int value='0' index: CONST Int type=kotlin.Int value='0'
CALL .set type=kotlin.Unit operator=POSTFIX_INCR CALL .set type=kotlin.Unit operator=PREFIX_INCR
$this: GET_VAR tmp0_array type=kotlin.IntArray operator=null $this: GET_VAR tmp0_array type=kotlin.IntArray operator=null
index: CONST Int type=kotlin.Int value='0' index: CONST Int type=kotlin.Int value='0'
value: CALL .inc type=kotlin.Int operator=POSTFIX_INCR value: GET_VAR tmp1 type=kotlin.Int operator=null
$this: GET_VAR tmp1 type=kotlin.Int operator=null GET_VAR tmp1 type=kotlin.Int operator=null
GET_VAR tmp1 type=kotlin.Int operator=null VAR val a2: kotlin.Int
VAR val a2: kotlin.Int BLOCK type=kotlin.Int operator=PREFIX_DECR
BLOCK type=kotlin.Int hasResult=true operator=POSTFIX_DECR VAR val tmp2_array: kotlin.IntArray
VAR val tmp2_array: kotlin.IntArray CALL .<get-arr> type=kotlin.IntArray operator=GET_PROPERTY
CALL .<get-arr> type=kotlin.IntArray operator=GET_PROPERTY VAR val tmp3: kotlin.Int
VAR val tmp3: kotlin.Int CALL .dec type=kotlin.Int operator=PREFIX_DECR
CALL .get type=kotlin.Int operator=POSTFIX_DECR $this: CALL .get type=kotlin.Int operator=PREFIX_DECR
$this: GET_VAR tmp2_array type=kotlin.IntArray operator=null $this: GET_VAR tmp2_array type=kotlin.IntArray operator=null
index: CONST Int type=kotlin.Int value='0' index: CONST Int type=kotlin.Int value='0'
CALL .set type=kotlin.Unit operator=POSTFIX_DECR CALL .set type=kotlin.Unit operator=PREFIX_DECR
$this: GET_VAR tmp2_array type=kotlin.IntArray operator=null
index: CONST Int type=kotlin.Int value='0'
value: GET_VAR tmp3 type=kotlin.Int operator=null
GET_VAR tmp3 type=kotlin.Int operator=null
FUN public fun testArrayPostfix(): kotlin.Unit
BLOCK_BODY
VAR val a1: kotlin.Int
BLOCK type=kotlin.Int operator=POSTFIX_INCR
VAR val tmp0_array: kotlin.IntArray
CALL .<get-arr> type=kotlin.IntArray operator=GET_PROPERTY
VAR val tmp1: kotlin.Int
CALL .get type=kotlin.Int operator=POSTFIX_INCR
$this: GET_VAR tmp0_array type=kotlin.IntArray operator=null
index: CONST Int type=kotlin.Int value='0'
CALL .set type=kotlin.Unit operator=POSTFIX_INCR
$this: GET_VAR tmp0_array type=kotlin.IntArray operator=null
index: CONST Int type=kotlin.Int value='0'
value: CALL .inc type=kotlin.Int operator=POSTFIX_INCR
$this: GET_VAR tmp1 type=kotlin.Int operator=null
GET_VAR tmp1 type=kotlin.Int operator=null
VAR val a2: kotlin.Int
BLOCK type=kotlin.Int operator=POSTFIX_DECR
VAR val tmp2_array: kotlin.IntArray
CALL .<get-arr> type=kotlin.IntArray operator=GET_PROPERTY
VAR val tmp3: kotlin.Int
CALL .get type=kotlin.Int operator=POSTFIX_DECR
$this: GET_VAR tmp2_array type=kotlin.IntArray operator=null $this: GET_VAR tmp2_array type=kotlin.IntArray operator=null
index: CONST Int type=kotlin.Int value='0' index: CONST Int type=kotlin.Int value='0'
value: CALL .dec type=kotlin.Int operator=POSTFIX_DECR CALL .set type=kotlin.Unit operator=POSTFIX_DECR
$this: GET_VAR tmp3 type=kotlin.Int operator=null $this: GET_VAR tmp2_array type=kotlin.IntArray operator=null
GET_VAR tmp3 type=kotlin.Int operator=null index: CONST Int type=kotlin.Int value='0'
value: CALL .dec type=kotlin.Int operator=POSTFIX_DECR
$this: GET_VAR tmp3 type=kotlin.Int operator=null
GET_VAR tmp3 type=kotlin.Int operator=null
+13 -13
View File
@@ -1,20 +1,20 @@
IrFile /literals.kt FILE /literals.kt
IrProperty public val test1: kotlin.Int = 1 getter=null setter=null PROPERTY public val test1: kotlin.Int = 1 getter=null setter=null
IrExpressionBody EXPRESSION_BODY
CONST Int type=kotlin.Int value='1' CONST Int type=kotlin.Int value='1'
IrProperty public val test2: kotlin.Int = -1 getter=null setter=null PROPERTY public val test2: kotlin.Int = -1 getter=null setter=null
IrExpressionBody EXPRESSION_BODY
CALL .unaryMinus type=kotlin.Int operator=UMINUS CALL .unaryMinus type=kotlin.Int operator=UMINUS
$this: CONST Int type=kotlin.Int value='1' $this: CONST Int type=kotlin.Int value='1'
IrProperty public val test3: kotlin.Boolean = true getter=null setter=null PROPERTY public val test3: kotlin.Boolean = true getter=null setter=null
IrExpressionBody EXPRESSION_BODY
CONST Boolean type=kotlin.Boolean value='true' CONST Boolean type=kotlin.Boolean value='true'
IrProperty public val test4: kotlin.Boolean = false getter=null setter=null PROPERTY public val test4: kotlin.Boolean = false getter=null setter=null
IrExpressionBody EXPRESSION_BODY
CONST Boolean type=kotlin.Boolean value='false' CONST Boolean type=kotlin.Boolean value='false'
IrProperty public val test5: kotlin.String = "abc" getter=null setter=null PROPERTY public val test5: kotlin.String = "abc" getter=null setter=null
IrExpressionBody EXPRESSION_BODY
CONST String type=kotlin.String value='abc' CONST String type=kotlin.String value='abc'
IrProperty public val test6: kotlin.Nothing? = null getter=null setter=null PROPERTY public val test6: kotlin.Nothing? = null getter=null setter=null
IrExpressionBody EXPRESSION_BODY
CONST Null type=kotlin.Nothing? value='null' CONST Null type=kotlin.Nothing? value='null'
+169 -193
View File
@@ -1,193 +1,169 @@
IrFile /primitiveComparisons.kt FILE /primitiveComparisons.kt
IrFunction public fun btest1(/*0*/ a: kotlin.Byte, /*1*/ b: kotlin.Byte): kotlin.Boolean FUN public fun btest1(/*0*/ a: kotlin.Byte, /*1*/ b: kotlin.Byte): kotlin.Boolean
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null RETURN type=<no-type>
RETURN type=<no-type> CALL .GT0 type=kotlin.Boolean operator=GT
CALL .GT0 type=kotlin.Boolean operator=GT arg0: CALL .compareTo type=kotlin.Int operator=GT
arg0: CALL .compareTo type=kotlin.Int operator=GT $this: GET_VAR a type=kotlin.Byte operator=null
$this: GET_VAR a type=kotlin.Byte operator=null other: GET_VAR b type=kotlin.Byte operator=null
other: GET_VAR b type=kotlin.Byte operator=null FUN public fun btest2(/*0*/ a: kotlin.Byte, /*1*/ b: kotlin.Byte): kotlin.Boolean
IrFunction public fun btest2(/*0*/ a: kotlin.Byte, /*1*/ b: kotlin.Byte): kotlin.Boolean BLOCK_BODY
IrExpressionBody RETURN type=<no-type>
BLOCK type=<no-type> hasResult=false operator=null CALL .LT0 type=kotlin.Boolean operator=LT
RETURN type=<no-type> arg0: CALL .compareTo type=kotlin.Int operator=LT
CALL .LT0 type=kotlin.Boolean operator=LT $this: GET_VAR a type=kotlin.Byte operator=null
arg0: CALL .compareTo type=kotlin.Int operator=LT other: GET_VAR b type=kotlin.Byte operator=null
$this: GET_VAR a type=kotlin.Byte operator=null FUN public fun btest3(/*0*/ a: kotlin.Byte, /*1*/ b: kotlin.Byte): kotlin.Boolean
other: GET_VAR b type=kotlin.Byte operator=null BLOCK_BODY
IrFunction public fun btest3(/*0*/ a: kotlin.Byte, /*1*/ b: kotlin.Byte): kotlin.Boolean RETURN type=<no-type>
IrExpressionBody CALL .GTEQ0 type=kotlin.Boolean operator=GTEQ
BLOCK type=<no-type> hasResult=false operator=null arg0: CALL .compareTo type=kotlin.Int operator=GTEQ
RETURN type=<no-type> $this: GET_VAR a type=kotlin.Byte operator=null
CALL .GTEQ0 type=kotlin.Boolean operator=GTEQ other: GET_VAR b type=kotlin.Byte operator=null
arg0: CALL .compareTo type=kotlin.Int operator=GTEQ FUN public fun btest4(/*0*/ a: kotlin.Byte, /*1*/ b: kotlin.Byte): kotlin.Boolean
$this: GET_VAR a type=kotlin.Byte operator=null BLOCK_BODY
other: GET_VAR b type=kotlin.Byte operator=null RETURN type=<no-type>
IrFunction public fun btest4(/*0*/ a: kotlin.Byte, /*1*/ b: kotlin.Byte): kotlin.Boolean CALL .LTEQ0 type=kotlin.Boolean operator=LTEQ
IrExpressionBody arg0: CALL .compareTo type=kotlin.Int operator=LTEQ
BLOCK type=<no-type> hasResult=false operator=null $this: GET_VAR a type=kotlin.Byte operator=null
RETURN type=<no-type> other: GET_VAR b type=kotlin.Byte operator=null
CALL .LTEQ0 type=kotlin.Boolean operator=LTEQ FUN public fun stest1(/*0*/ a: kotlin.Short, /*1*/ b: kotlin.Short): kotlin.Boolean
arg0: CALL .compareTo type=kotlin.Int operator=LTEQ BLOCK_BODY
$this: GET_VAR a type=kotlin.Byte operator=null RETURN type=<no-type>
other: GET_VAR b type=kotlin.Byte operator=null CALL .GT0 type=kotlin.Boolean operator=GT
IrFunction public fun stest1(/*0*/ a: kotlin.Short, /*1*/ b: kotlin.Short): kotlin.Boolean arg0: CALL .compareTo type=kotlin.Int operator=GT
IrExpressionBody $this: GET_VAR a type=kotlin.Short operator=null
BLOCK type=<no-type> hasResult=false operator=null other: GET_VAR b type=kotlin.Short operator=null
RETURN type=<no-type> FUN public fun stest2(/*0*/ a: kotlin.Short, /*1*/ b: kotlin.Short): kotlin.Boolean
CALL .GT0 type=kotlin.Boolean operator=GT BLOCK_BODY
arg0: CALL .compareTo type=kotlin.Int operator=GT RETURN type=<no-type>
$this: GET_VAR a type=kotlin.Short operator=null CALL .LT0 type=kotlin.Boolean operator=LT
other: GET_VAR b type=kotlin.Short operator=null arg0: CALL .compareTo type=kotlin.Int operator=LT
IrFunction public fun stest2(/*0*/ a: kotlin.Short, /*1*/ b: kotlin.Short): kotlin.Boolean $this: GET_VAR a type=kotlin.Short operator=null
IrExpressionBody other: GET_VAR b type=kotlin.Short operator=null
BLOCK type=<no-type> hasResult=false operator=null FUN public fun stest3(/*0*/ a: kotlin.Short, /*1*/ b: kotlin.Short): kotlin.Boolean
RETURN type=<no-type> BLOCK_BODY
CALL .LT0 type=kotlin.Boolean operator=LT RETURN type=<no-type>
arg0: CALL .compareTo type=kotlin.Int operator=LT CALL .GTEQ0 type=kotlin.Boolean operator=GTEQ
$this: GET_VAR a type=kotlin.Short operator=null arg0: CALL .compareTo type=kotlin.Int operator=GTEQ
other: GET_VAR b type=kotlin.Short operator=null $this: GET_VAR a type=kotlin.Short operator=null
IrFunction public fun stest3(/*0*/ a: kotlin.Short, /*1*/ b: kotlin.Short): kotlin.Boolean other: GET_VAR b type=kotlin.Short operator=null
IrExpressionBody FUN public fun stest4(/*0*/ a: kotlin.Short, /*1*/ b: kotlin.Short): kotlin.Boolean
BLOCK type=<no-type> hasResult=false operator=null BLOCK_BODY
RETURN type=<no-type> RETURN type=<no-type>
CALL .GTEQ0 type=kotlin.Boolean operator=GTEQ CALL .LTEQ0 type=kotlin.Boolean operator=LTEQ
arg0: CALL .compareTo type=kotlin.Int operator=GTEQ arg0: CALL .compareTo type=kotlin.Int operator=LTEQ
$this: GET_VAR a type=kotlin.Short operator=null $this: GET_VAR a type=kotlin.Short operator=null
other: GET_VAR b type=kotlin.Short operator=null other: GET_VAR b type=kotlin.Short operator=null
IrFunction public fun stest4(/*0*/ a: kotlin.Short, /*1*/ b: kotlin.Short): kotlin.Boolean FUN public fun itest1(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Boolean
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null RETURN type=<no-type>
RETURN type=<no-type> CALL .GT0 type=kotlin.Boolean operator=GT
CALL .LTEQ0 type=kotlin.Boolean operator=LTEQ arg0: CALL .compareTo type=kotlin.Int operator=GT
arg0: CALL .compareTo type=kotlin.Int operator=LTEQ $this: GET_VAR a type=kotlin.Int operator=null
$this: GET_VAR a type=kotlin.Short operator=null other: GET_VAR b type=kotlin.Int operator=null
other: GET_VAR b type=kotlin.Short operator=null FUN public fun itest2(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Boolean
IrFunction public fun itest1(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Boolean BLOCK_BODY
IrExpressionBody RETURN type=<no-type>
BLOCK type=<no-type> hasResult=false operator=null CALL .LT0 type=kotlin.Boolean operator=LT
RETURN type=<no-type> arg0: CALL .compareTo type=kotlin.Int operator=LT
CALL .GT0 type=kotlin.Boolean operator=GT $this: GET_VAR a type=kotlin.Int operator=null
arg0: CALL .compareTo type=kotlin.Int operator=GT other: GET_VAR b type=kotlin.Int operator=null
$this: GET_VAR a type=kotlin.Int operator=null FUN public fun itest3(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Boolean
other: GET_VAR b type=kotlin.Int operator=null BLOCK_BODY
IrFunction public fun itest2(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Boolean RETURN type=<no-type>
IrExpressionBody CALL .GTEQ0 type=kotlin.Boolean operator=GTEQ
BLOCK type=<no-type> hasResult=false operator=null arg0: CALL .compareTo type=kotlin.Int operator=GTEQ
RETURN type=<no-type> $this: GET_VAR a type=kotlin.Int operator=null
CALL .LT0 type=kotlin.Boolean operator=LT other: GET_VAR b type=kotlin.Int operator=null
arg0: CALL .compareTo type=kotlin.Int operator=LT FUN public fun itest4(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Boolean
$this: GET_VAR a type=kotlin.Int operator=null BLOCK_BODY
other: GET_VAR b type=kotlin.Int operator=null RETURN type=<no-type>
IrFunction public fun itest3(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Boolean CALL .LTEQ0 type=kotlin.Boolean operator=LTEQ
IrExpressionBody arg0: CALL .compareTo type=kotlin.Int operator=LTEQ
BLOCK type=<no-type> hasResult=false operator=null $this: GET_VAR a type=kotlin.Int operator=null
RETURN type=<no-type> other: GET_VAR b type=kotlin.Int operator=null
CALL .GTEQ0 type=kotlin.Boolean operator=GTEQ FUN public fun ltest1(/*0*/ a: kotlin.Long, /*1*/ b: kotlin.Long): kotlin.Boolean
arg0: CALL .compareTo type=kotlin.Int operator=GTEQ BLOCK_BODY
$this: GET_VAR a type=kotlin.Int operator=null RETURN type=<no-type>
other: GET_VAR b type=kotlin.Int operator=null CALL .GT0 type=kotlin.Boolean operator=GT
IrFunction public fun itest4(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Boolean arg0: CALL .compareTo type=kotlin.Int operator=GT
IrExpressionBody $this: GET_VAR a type=kotlin.Long operator=null
BLOCK type=<no-type> hasResult=false operator=null other: GET_VAR b type=kotlin.Long operator=null
RETURN type=<no-type> FUN public fun ltest2(/*0*/ a: kotlin.Long, /*1*/ b: kotlin.Long): kotlin.Boolean
CALL .LTEQ0 type=kotlin.Boolean operator=LTEQ BLOCK_BODY
arg0: CALL .compareTo type=kotlin.Int operator=LTEQ RETURN type=<no-type>
$this: GET_VAR a type=kotlin.Int operator=null CALL .LT0 type=kotlin.Boolean operator=LT
other: GET_VAR b type=kotlin.Int operator=null arg0: CALL .compareTo type=kotlin.Int operator=LT
IrFunction public fun ltest1(/*0*/ a: kotlin.Long, /*1*/ b: kotlin.Long): kotlin.Boolean $this: GET_VAR a type=kotlin.Long operator=null
IrExpressionBody other: GET_VAR b type=kotlin.Long operator=null
BLOCK type=<no-type> hasResult=false operator=null FUN public fun ltest3(/*0*/ a: kotlin.Long, /*1*/ b: kotlin.Long): kotlin.Boolean
RETURN type=<no-type> BLOCK_BODY
CALL .GT0 type=kotlin.Boolean operator=GT RETURN type=<no-type>
arg0: CALL .compareTo type=kotlin.Int operator=GT CALL .GTEQ0 type=kotlin.Boolean operator=GTEQ
$this: GET_VAR a type=kotlin.Long operator=null arg0: CALL .compareTo type=kotlin.Int operator=GTEQ
other: GET_VAR b type=kotlin.Long operator=null $this: GET_VAR a type=kotlin.Long operator=null
IrFunction public fun ltest2(/*0*/ a: kotlin.Long, /*1*/ b: kotlin.Long): kotlin.Boolean other: GET_VAR b type=kotlin.Long operator=null
IrExpressionBody FUN public fun ltest4(/*0*/ a: kotlin.Long, /*1*/ b: kotlin.Long): kotlin.Boolean
BLOCK type=<no-type> hasResult=false operator=null BLOCK_BODY
RETURN type=<no-type> RETURN type=<no-type>
CALL .LT0 type=kotlin.Boolean operator=LT CALL .LTEQ0 type=kotlin.Boolean operator=LTEQ
arg0: CALL .compareTo type=kotlin.Int operator=LT arg0: CALL .compareTo type=kotlin.Int operator=LTEQ
$this: GET_VAR a type=kotlin.Long operator=null $this: GET_VAR a type=kotlin.Long operator=null
other: GET_VAR b type=kotlin.Long operator=null other: GET_VAR b type=kotlin.Long operator=null
IrFunction public fun ltest3(/*0*/ a: kotlin.Long, /*1*/ b: kotlin.Long): kotlin.Boolean FUN public fun ftest1(/*0*/ a: kotlin.Float, /*1*/ b: kotlin.Float): kotlin.Boolean
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null RETURN type=<no-type>
RETURN type=<no-type> CALL .GT0 type=kotlin.Boolean operator=GT
CALL .GTEQ0 type=kotlin.Boolean operator=GTEQ arg0: CALL .compareTo type=kotlin.Int operator=GT
arg0: CALL .compareTo type=kotlin.Int operator=GTEQ $this: GET_VAR a type=kotlin.Float operator=null
$this: GET_VAR a type=kotlin.Long operator=null other: GET_VAR b type=kotlin.Float operator=null
other: GET_VAR b type=kotlin.Long operator=null FUN public fun ftest2(/*0*/ a: kotlin.Float, /*1*/ b: kotlin.Float): kotlin.Boolean
IrFunction public fun ltest4(/*0*/ a: kotlin.Long, /*1*/ b: kotlin.Long): kotlin.Boolean BLOCK_BODY
IrExpressionBody RETURN type=<no-type>
BLOCK type=<no-type> hasResult=false operator=null CALL .LT0 type=kotlin.Boolean operator=LT
RETURN type=<no-type> arg0: CALL .compareTo type=kotlin.Int operator=LT
CALL .LTEQ0 type=kotlin.Boolean operator=LTEQ $this: GET_VAR a type=kotlin.Float operator=null
arg0: CALL .compareTo type=kotlin.Int operator=LTEQ other: GET_VAR b type=kotlin.Float operator=null
$this: GET_VAR a type=kotlin.Long operator=null FUN public fun ftest3(/*0*/ a: kotlin.Float, /*1*/ b: kotlin.Float): kotlin.Boolean
other: GET_VAR b type=kotlin.Long operator=null BLOCK_BODY
IrFunction public fun ftest1(/*0*/ a: kotlin.Float, /*1*/ b: kotlin.Float): kotlin.Boolean RETURN type=<no-type>
IrExpressionBody CALL .GTEQ0 type=kotlin.Boolean operator=GTEQ
BLOCK type=<no-type> hasResult=false operator=null arg0: CALL .compareTo type=kotlin.Int operator=GTEQ
RETURN type=<no-type> $this: GET_VAR a type=kotlin.Float operator=null
CALL .GT0 type=kotlin.Boolean operator=GT other: GET_VAR b type=kotlin.Float operator=null
arg0: CALL .compareTo type=kotlin.Int operator=GT FUN public fun ftest4(/*0*/ a: kotlin.Float, /*1*/ b: kotlin.Float): kotlin.Boolean
$this: GET_VAR a type=kotlin.Float operator=null BLOCK_BODY
other: GET_VAR b type=kotlin.Float operator=null RETURN type=<no-type>
IrFunction public fun ftest2(/*0*/ a: kotlin.Float, /*1*/ b: kotlin.Float): kotlin.Boolean CALL .LTEQ0 type=kotlin.Boolean operator=LTEQ
IrExpressionBody arg0: CALL .compareTo type=kotlin.Int operator=LTEQ
BLOCK type=<no-type> hasResult=false operator=null $this: GET_VAR a type=kotlin.Float operator=null
RETURN type=<no-type> other: GET_VAR b type=kotlin.Float operator=null
CALL .LT0 type=kotlin.Boolean operator=LT FUN public fun dtest1(/*0*/ a: kotlin.Double, /*1*/ b: kotlin.Double): kotlin.Boolean
arg0: CALL .compareTo type=kotlin.Int operator=LT BLOCK_BODY
$this: GET_VAR a type=kotlin.Float operator=null RETURN type=<no-type>
other: GET_VAR b type=kotlin.Float operator=null CALL .GT0 type=kotlin.Boolean operator=GT
IrFunction public fun ftest3(/*0*/ a: kotlin.Float, /*1*/ b: kotlin.Float): kotlin.Boolean arg0: CALL .compareTo type=kotlin.Int operator=GT
IrExpressionBody $this: GET_VAR a type=kotlin.Double operator=null
BLOCK type=<no-type> hasResult=false operator=null other: GET_VAR b type=kotlin.Double operator=null
RETURN type=<no-type> FUN public fun dtest2(/*0*/ a: kotlin.Double, /*1*/ b: kotlin.Double): kotlin.Boolean
CALL .GTEQ0 type=kotlin.Boolean operator=GTEQ BLOCK_BODY
arg0: CALL .compareTo type=kotlin.Int operator=GTEQ RETURN type=<no-type>
$this: GET_VAR a type=kotlin.Float operator=null CALL .LT0 type=kotlin.Boolean operator=LT
other: GET_VAR b type=kotlin.Float operator=null arg0: CALL .compareTo type=kotlin.Int operator=LT
IrFunction public fun ftest4(/*0*/ a: kotlin.Float, /*1*/ b: kotlin.Float): kotlin.Boolean $this: GET_VAR a type=kotlin.Double operator=null
IrExpressionBody other: GET_VAR b type=kotlin.Double operator=null
BLOCK type=<no-type> hasResult=false operator=null FUN public fun dtest3(/*0*/ a: kotlin.Double, /*1*/ b: kotlin.Double): kotlin.Boolean
RETURN type=<no-type> BLOCK_BODY
CALL .LTEQ0 type=kotlin.Boolean operator=LTEQ RETURN type=<no-type>
arg0: CALL .compareTo type=kotlin.Int operator=LTEQ CALL .GTEQ0 type=kotlin.Boolean operator=GTEQ
$this: GET_VAR a type=kotlin.Float operator=null arg0: CALL .compareTo type=kotlin.Int operator=GTEQ
other: GET_VAR b type=kotlin.Float operator=null $this: GET_VAR a type=kotlin.Double operator=null
IrFunction public fun dtest1(/*0*/ a: kotlin.Double, /*1*/ b: kotlin.Double): kotlin.Boolean other: GET_VAR b type=kotlin.Double operator=null
IrExpressionBody FUN public fun dtest4(/*0*/ a: kotlin.Double, /*1*/ b: kotlin.Double): kotlin.Boolean
BLOCK type=<no-type> hasResult=false operator=null BLOCK_BODY
RETURN type=<no-type> RETURN type=<no-type>
CALL .GT0 type=kotlin.Boolean operator=GT CALL .LTEQ0 type=kotlin.Boolean operator=LTEQ
arg0: CALL .compareTo type=kotlin.Int operator=GT arg0: CALL .compareTo type=kotlin.Int operator=LTEQ
$this: GET_VAR a type=kotlin.Double operator=null $this: GET_VAR a type=kotlin.Double operator=null
other: GET_VAR b type=kotlin.Double operator=null other: GET_VAR b type=kotlin.Double operator=null
IrFunction public fun dtest2(/*0*/ a: kotlin.Double, /*1*/ b: kotlin.Double): kotlin.Boolean
IrExpressionBody
BLOCK type=<no-type> hasResult=false operator=null
RETURN type=<no-type>
CALL .LT0 type=kotlin.Boolean operator=LT
arg0: CALL .compareTo type=kotlin.Int operator=LT
$this: GET_VAR a type=kotlin.Double operator=null
other: GET_VAR b type=kotlin.Double operator=null
IrFunction public fun dtest3(/*0*/ a: kotlin.Double, /*1*/ b: kotlin.Double): kotlin.Boolean
IrExpressionBody
BLOCK type=<no-type> hasResult=false operator=null
RETURN type=<no-type>
CALL .GTEQ0 type=kotlin.Boolean operator=GTEQ
arg0: CALL .compareTo type=kotlin.Int operator=GTEQ
$this: GET_VAR a type=kotlin.Double operator=null
other: GET_VAR b type=kotlin.Double operator=null
IrFunction public fun dtest4(/*0*/ a: kotlin.Double, /*1*/ b: kotlin.Double): kotlin.Boolean
IrExpressionBody
BLOCK type=<no-type> hasResult=false operator=null
RETURN type=<no-type>
CALL .LTEQ0 type=kotlin.Boolean operator=LTEQ
arg0: CALL .compareTo type=kotlin.Int operator=LTEQ
$this: GET_VAR a type=kotlin.Double operator=null
other: GET_VAR b type=kotlin.Double operator=null
+38 -45
View File
@@ -1,47 +1,40 @@
IrFile /references.kt FILE /references.kt
IrProperty public val ok: kotlin.String = "OK" getter=null setter=null PROPERTY public val ok: kotlin.String = "OK" getter=null setter=null
IrExpressionBody EXPRESSION_BODY
CONST String type=kotlin.String value='OK' CONST String type=kotlin.String value='OK'
IrProperty public val ok2: kotlin.String = "OK" getter=null setter=null PROPERTY public val ok2: kotlin.String = "OK" getter=null setter=null
IrExpressionBody EXPRESSION_BODY
CALL .<get-ok> type=kotlin.String operator=GET_PROPERTY CALL .<get-ok> type=kotlin.String operator=GET_PROPERTY
IrProperty public val ok3: kotlin.String getter=<get-ok3> setter=null PROPERTY public val ok3: kotlin.String getter=<get-ok3> setter=null
IrPropertyGetter public fun <get-ok3>(): kotlin.String property=ok3 PROPERTY_GETTER public fun <get-ok3>(): kotlin.String property=ok3
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null RETURN type=<no-type>
RETURN type=<no-type> CONST String type=kotlin.String value='OK'
CONST String type=kotlin.String value='OK' FUN public fun test1(): kotlin.String
IrFunction public fun test1(): kotlin.String BLOCK_BODY
IrExpressionBody RETURN type=<no-type>
BLOCK type=<no-type> hasResult=false operator=null CALL .<get-ok> type=kotlin.String operator=GET_PROPERTY
RETURN type=<no-type> FUN public fun test2(/*0*/ x: kotlin.String): kotlin.String
CALL .<get-ok> type=kotlin.String operator=GET_PROPERTY BLOCK_BODY
IrFunction public fun test2(/*0*/ x: kotlin.String): kotlin.String RETURN type=<no-type>
IrExpressionBody GET_VAR x type=kotlin.String operator=null
BLOCK type=<no-type> hasResult=false operator=null FUN public fun test3(): kotlin.String
RETURN type=<no-type> BLOCK_BODY
GET_VAR x type=kotlin.String operator=null VAR val x: kotlin.String = "OK"
IrFunction public fun test3(): kotlin.String CONST String type=kotlin.String value='OK'
IrExpressionBody RETURN type=<no-type>
BLOCK type=<no-type> hasResult=false operator=null GET_VAR x type=kotlin.String operator=null
VAR val x: kotlin.String = "OK" FUN public fun test4(): kotlin.String
CONST String type=kotlin.String value='OK' BLOCK_BODY
RETURN type=<no-type> RETURN type=<no-type>
GET_VAR x type=kotlin.String operator=null CALL .<get-ok3> type=kotlin.String operator=GET_PROPERTY
IrFunction public fun test4(): kotlin.String PROPERTY public val kotlin.String.okext: kotlin.String getter=<get-okext> setter=null
IrExpressionBody PROPERTY_GETTER public fun kotlin.String.<get-okext>(): kotlin.String property=okext
BLOCK type=<no-type> hasResult=false operator=null BLOCK_BODY
RETURN type=<no-type> RETURN type=<no-type>
CALL .<get-ok3> type=kotlin.String operator=GET_PROPERTY CONST String type=kotlin.String value='OK'
IrProperty public val kotlin.String.okext: kotlin.String getter=<get-okext> setter=null FUN public fun kotlin.String.test5(): kotlin.String
IrPropertyGetter public fun kotlin.String.<get-okext>(): kotlin.String property=okext BLOCK_BODY
IrExpressionBody RETURN type=<no-type>
BLOCK type=<no-type> hasResult=false operator=null CALL .<get-okext> type=kotlin.String operator=GET_PROPERTY
RETURN type=<no-type> $receiver: $RECEIVER of: test5 type=kotlin.String
CONST String type=kotlin.String value='OK'
IrFunction public fun kotlin.String.test5(): kotlin.String
IrExpressionBody
BLOCK type=<no-type> hasResult=false operator=null
RETURN type=<no-type>
CALL .<get-okext> type=kotlin.String operator=GET_PROPERTY
$receiver: $RECEIVER of: test5 type=kotlin.String
@@ -1,69 +1,62 @@
IrFile /safeCallWithIncrementDecrement.kt FILE /safeCallWithIncrementDecrement.kt
DUMMY C DUMMY C
IrProperty public var test.C?.p: kotlin.Int getter=<get-p> setter=<set-p> PROPERTY public var test.C?.p: kotlin.Int getter=<get-p> setter=<set-p>
IrPropertyGetter public fun test.C?.<get-p>(): kotlin.Int property=p PROPERTY_GETTER public fun test.C?.<get-p>(): kotlin.Int property=p
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null RETURN type=<no-type>
RETURN type=<no-type> CONST Int type=kotlin.Int value='42'
CONST Int type=kotlin.Int value='42' PROPERTY_SETTER public fun test.C?.<set-p>(/*0*/ value: kotlin.Int): kotlin.Unit property=p
IrPropertySetter public fun test.C?.<set-p>(/*0*/ value: kotlin.Int): kotlin.Unit property=p BLOCK_BODY
IrExpressionBody FUN public operator fun kotlin.Int?.inc(): kotlin.Int?
BLOCK type=<no-type> hasResult=false operator=null BLOCK_BODY
IrFunction public operator fun kotlin.Int?.inc(): kotlin.Int? RETURN type=<no-type>
IrExpressionBody
BLOCK type=<no-type> hasResult=false operator=null
RETURN type=<no-type>
WHEN type=kotlin.Int? operator=SAFE_CALL
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: $RECEIVER of: inc type=kotlin.Int?
arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null'
else: CALL .inc type=kotlin.Int operator=null
$this: $RECEIVER of: inc type=kotlin.Int?
IrFunction public operator fun kotlin.Int?.get(/*0*/ index: kotlin.Int): kotlin.Int
IrExpressionBody
BLOCK type=<no-type> hasResult=false operator=null
RETURN type=<no-type>
CONST Int type=kotlin.Int value='42'
IrFunction public operator fun kotlin.Int?.set(/*0*/ index: kotlin.Int, /*1*/ value: kotlin.Int): kotlin.Unit
IrExpressionBody
BLOCK type=<no-type> hasResult=false operator=null
IrFunction public fun testProperty(/*0*/ nc: test.C?): kotlin.Unit
IrExpressionBody
BLOCK type=<no-type> hasResult=false operator=null
WHEN type=kotlin.Int? operator=SAFE_CALL WHEN type=kotlin.Int? operator=SAFE_CALL
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR nc type=test.C? operator=null arg0: $RECEIVER of: inc type=kotlin.Int?
arg1: CONST Null type=kotlin.Nothing? value='null' arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null' then: CONST Null type=kotlin.Nothing? value='null'
else: BLOCK type=kotlin.Int hasResult=true operator=POSTFIX_INCR else: CALL .inc type=kotlin.Int operator=null
VAR val tmp1: kotlin.Int $this: $RECEIVER of: inc type=kotlin.Int?
CALL .<get-p> type=kotlin.Int operator=POSTFIX_INCR FUN public operator fun kotlin.Int?.get(/*0*/ index: kotlin.Int): kotlin.Int
$this: GET_VAR nc type=test.C? operator=null BLOCK_BODY
CALL .<set-p> type=kotlin.Unit operator=POSTFIX_INCR RETURN type=<no-type>
CONST Int type=kotlin.Int value='42'
FUN public operator fun kotlin.Int?.set(/*0*/ index: kotlin.Int, /*1*/ value: kotlin.Int): kotlin.Unit
BLOCK_BODY
FUN public fun testProperty(/*0*/ nc: test.C?): kotlin.Unit
BLOCK_BODY
WHEN type=kotlin.Int? operator=SAFE_CALL
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR nc type=test.C? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null'
else: BLOCK type=kotlin.Int operator=POSTFIX_INCR
VAR val tmp1: kotlin.Int
CALL .<get-p> type=kotlin.Int operator=POSTFIX_INCR
$this: GET_VAR nc type=test.C? operator=null $this: GET_VAR nc type=test.C? operator=null
value: CALL .inc type=kotlin.Int? operator=POSTFIX_INCR CALL .<set-p> type=kotlin.Unit operator=POSTFIX_INCR
$receiver: GET_VAR tmp1 type=kotlin.Int operator=null $this: GET_VAR nc type=test.C? operator=null
GET_VAR tmp1 type=kotlin.Int operator=null value: CALL .inc type=kotlin.Int? operator=POSTFIX_INCR
IrFunction public fun testArrayAccess(/*0*/ nc: test.C?): kotlin.Unit $receiver: GET_VAR tmp1 type=kotlin.Int operator=null
IrExpressionBody GET_VAR tmp1 type=kotlin.Int operator=null
BLOCK type=<no-type> hasResult=false operator=null FUN public fun testArrayAccess(/*0*/ nc: test.C?): kotlin.Unit
BLOCK type=kotlin.Int hasResult=true operator=POSTFIX_INCR BLOCK_BODY
VAR val tmp3_array: kotlin.Int? BLOCK type=kotlin.Int operator=POSTFIX_INCR
WHEN type=kotlin.Int? operator=SAFE_CALL VAR val tmp3_array: kotlin.Int?
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ WHEN type=kotlin.Int? operator=SAFE_CALL
arg0: GET_VAR nc type=test.C? operator=null if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg1: CONST Null type=kotlin.Nothing? value='null' arg0: GET_VAR nc type=test.C? operator=null
then: CONST Null type=kotlin.Nothing? value='null' arg1: CONST Null type=kotlin.Nothing? value='null'
else: CALL .<get-p> type=kotlin.Int operator=GET_PROPERTY then: CONST Null type=kotlin.Nothing? value='null'
$this: GET_VAR nc type=test.C? operator=null else: CALL .<get-p> type=kotlin.Int operator=GET_PROPERTY
VAR val tmp4: kotlin.Int $this: GET_VAR nc type=test.C? operator=null
CALL .get type=kotlin.Int operator=POSTFIX_INCR VAR val tmp4: kotlin.Int
$receiver: GET_VAR tmp3_array type=kotlin.Int? operator=null CALL .get type=kotlin.Int operator=POSTFIX_INCR
index: CONST Int type=kotlin.Int value='0'
CALL .set type=kotlin.Unit operator=POSTFIX_INCR
$receiver: GET_VAR tmp3_array type=kotlin.Int? operator=null $receiver: GET_VAR tmp3_array type=kotlin.Int? operator=null
index: CONST Int type=kotlin.Int value='0' index: CONST Int type=kotlin.Int value='0'
value: CALL .inc type=kotlin.Int operator=POSTFIX_INCR CALL .set type=kotlin.Unit operator=POSTFIX_INCR
$this: GET_VAR tmp4 type=kotlin.Int operator=null $receiver: GET_VAR tmp3_array type=kotlin.Int? operator=null
GET_VAR tmp4 type=kotlin.Int operator=null index: CONST Int type=kotlin.Int value='0'
value: CALL .inc type=kotlin.Int operator=POSTFIX_INCR
$this: GET_VAR tmp4 type=kotlin.Int operator=null
GET_VAR tmp4 type=kotlin.Int operator=null
+50 -55
View File
@@ -1,60 +1,55 @@
IrFile /safeCalls.kt FILE /safeCalls.kt
DUMMY Ref DUMMY Ref
DUMMY IHost DUMMY IHost
IrFunction public fun test1(/*0*/ x: kotlin.String?): kotlin.Int? FUN public fun test1(/*0*/ x: kotlin.String?): kotlin.Int?
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null RETURN type=<no-type>
RETURN type=<no-type> WHEN type=kotlin.Int? operator=SAFE_CALL
WHEN type=kotlin.Int? operator=SAFE_CALL
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR x type=kotlin.String? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null'
else: CALL .<get-length> type=kotlin.Int operator=GET_PROPERTY
$this: GET_VAR x type=kotlin.String? operator=null
IrFunction public fun test2(/*0*/ x: kotlin.String?): kotlin.Int?
IrExpressionBody
BLOCK type=<no-type> hasResult=false operator=null
RETURN type=<no-type>
WHEN type=kotlin.Int? operator=SAFE_CALL
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR x type=kotlin.String? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null'
else: CALL .hashCode type=kotlin.Int operator=null
$this: GET_VAR x type=kotlin.String? operator=null
IrFunction public fun test3(/*0*/ x: kotlin.String?, /*1*/ y: kotlin.Any?): kotlin.Boolean?
IrExpressionBody
BLOCK type=<no-type> hasResult=false operator=null
RETURN type=<no-type>
WHEN type=kotlin.Boolean? operator=SAFE_CALL
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR x type=kotlin.String? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null'
else: CALL .equals type=kotlin.Boolean operator=null
$this: GET_VAR x type=kotlin.String? operator=null
other: GET_VAR y type=kotlin.Any? operator=null
IrFunction public fun test4(/*0*/ x: Ref?): kotlin.Unit
IrExpressionBody
BLOCK type=<no-type> hasResult=false operator=null
WHEN type=kotlin.Unit? operator=SAFE_CALL
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR x type=Ref? operator=null arg0: GET_VAR x type=kotlin.String? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null' arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null' then: CONST Null type=kotlin.Nothing? value='null'
else: CALL .<set-value> type=kotlin.Unit operator=EQ else: CALL .<get-length> type=kotlin.Int operator=GET_PROPERTY
$this: GET_VAR x type=Ref? operator=null $this: GET_VAR x type=kotlin.String? operator=null
<set-?>: CONST Int type=kotlin.Int value='0' FUN public fun test2(/*0*/ x: kotlin.String?): kotlin.Int?
IrFunction public fun IHost.test5(/*0*/ s: kotlin.String?): kotlin.Int? BLOCK_BODY
IrExpressionBody RETURN type=<no-type>
BLOCK type=<no-type> hasResult=false operator=null WHEN type=kotlin.Int? operator=SAFE_CALL
RETURN type=<no-type> if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
WHEN type=kotlin.Int? operator=SAFE_CALL arg0: GET_VAR x type=kotlin.String? operator=null
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ arg1: CONST Null type=kotlin.Nothing? value='null'
arg0: GET_VAR s type=kotlin.String? operator=null then: CONST Null type=kotlin.Nothing? value='null'
arg1: CONST Null type=kotlin.Nothing? value='null' else: CALL .hashCode type=kotlin.Int operator=null
then: CONST Null type=kotlin.Nothing? value='null' $this: GET_VAR x type=kotlin.String? operator=null
else: CALL .extLength type=kotlin.Int operator=null FUN public fun test3(/*0*/ x: kotlin.String?, /*1*/ y: kotlin.Any?): kotlin.Boolean?
$this: $RECEIVER of: test5 type=IHost BLOCK_BODY
$receiver: GET_VAR s type=kotlin.String? operator=null RETURN type=<no-type>
WHEN type=kotlin.Boolean? operator=SAFE_CALL
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR x type=kotlin.String? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null'
else: CALL .equals type=kotlin.Boolean operator=null
$this: GET_VAR x type=kotlin.String? operator=null
other: GET_VAR y type=kotlin.Any? operator=null
FUN public fun test4(/*0*/ x: Ref?): kotlin.Unit
BLOCK_BODY
WHEN type=kotlin.Unit? operator=SAFE_CALL
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR x type=Ref? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null'
else: CALL .<set-value> type=kotlin.Unit operator=EQ
$this: GET_VAR x type=Ref? operator=null
<set-?>: CONST Int type=kotlin.Int value='0'
FUN public fun IHost.test5(/*0*/ s: kotlin.String?): kotlin.Int?
BLOCK_BODY
RETURN type=<no-type>
WHEN type=kotlin.Int? operator=SAFE_CALL
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR s type=kotlin.String? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null'
else: CALL .extLength type=kotlin.Int operator=null
$this: $RECEIVER of: test5 type=IHost
$receiver: GET_VAR s type=kotlin.String? operator=null
+67 -78
View File
@@ -1,78 +1,67 @@
IrFile /simpleOperators.kt FILE /simpleOperators.kt
IrFunction public fun test1(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Int FUN public fun test1(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Int
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null RETURN type=<no-type>
RETURN type=<no-type> CALL .plus type=kotlin.Int operator=PLUS
CALL .plus type=kotlin.Int operator=PLUS $this: GET_VAR a type=kotlin.Int operator=null
$this: GET_VAR a type=kotlin.Int operator=null other: GET_VAR b type=kotlin.Int operator=null
other: GET_VAR b type=kotlin.Int operator=null FUN public fun test2(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Int
IrFunction public fun test2(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Int BLOCK_BODY
IrExpressionBody RETURN type=<no-type>
BLOCK type=<no-type> hasResult=false operator=null CALL .minus type=kotlin.Int operator=MINUS
RETURN type=<no-type> $this: GET_VAR a type=kotlin.Int operator=null
CALL .minus type=kotlin.Int operator=MINUS other: GET_VAR b type=kotlin.Int operator=null
$this: GET_VAR a type=kotlin.Int operator=null FUN public fun test3(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Int
other: GET_VAR b type=kotlin.Int operator=null BLOCK_BODY
IrFunction public fun test3(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Int RETURN type=<no-type>
IrExpressionBody CALL .times type=kotlin.Int operator=MUL
BLOCK type=<no-type> hasResult=false operator=null $this: GET_VAR a type=kotlin.Int operator=null
RETURN type=<no-type> other: GET_VAR b type=kotlin.Int operator=null
CALL .times type=kotlin.Int operator=MUL FUN public fun test4(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Int
$this: GET_VAR a type=kotlin.Int operator=null BLOCK_BODY
other: GET_VAR b type=kotlin.Int operator=null RETURN type=<no-type>
IrFunction public fun test4(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Int CALL .div type=kotlin.Int operator=DIV
IrExpressionBody $this: GET_VAR a type=kotlin.Int operator=null
BLOCK type=<no-type> hasResult=false operator=null other: GET_VAR b type=kotlin.Int operator=null
RETURN type=<no-type> FUN public fun test5(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Int
CALL .div type=kotlin.Int operator=DIV BLOCK_BODY
$this: GET_VAR a type=kotlin.Int operator=null RETURN type=<no-type>
other: GET_VAR b type=kotlin.Int operator=null CALL .mod type=kotlin.Int operator=PERC
IrFunction public fun test5(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Int $this: GET_VAR a type=kotlin.Int operator=null
IrExpressionBody other: GET_VAR b type=kotlin.Int operator=null
BLOCK type=<no-type> hasResult=false operator=null FUN public fun test6(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.ranges.IntRange
RETURN type=<no-type> BLOCK_BODY
CALL .mod type=kotlin.Int operator=PERC RETURN type=<no-type>
$this: GET_VAR a type=kotlin.Int operator=null CALL .rangeTo type=kotlin.ranges.IntRange operator=RANGE
other: GET_VAR b type=kotlin.Int operator=null $this: GET_VAR a type=kotlin.Int operator=null
IrFunction public fun test6(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.ranges.IntRange other: GET_VAR b type=kotlin.Int operator=null
IrExpressionBody FUN public fun test1x(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Int
BLOCK type=<no-type> hasResult=false operator=null BLOCK_BODY
RETURN type=<no-type> RETURN type=<no-type>
CALL .rangeTo type=kotlin.ranges.IntRange operator=RANGE CALL .plus type=kotlin.Int operator=null
$this: GET_VAR a type=kotlin.Int operator=null $this: GET_VAR a type=kotlin.Int operator=null
other: GET_VAR b type=kotlin.Int operator=null other: GET_VAR b type=kotlin.Int operator=null
IrFunction public fun test1x(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Int FUN public fun test2x(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Int
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null RETURN type=<no-type>
RETURN type=<no-type> CALL .minus type=kotlin.Int operator=null
CALL .plus type=kotlin.Int operator=null $this: GET_VAR a type=kotlin.Int operator=null
$this: GET_VAR a type=kotlin.Int operator=null other: GET_VAR b type=kotlin.Int operator=null
other: GET_VAR b type=kotlin.Int operator=null FUN public fun test3x(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Int
IrFunction public fun test2x(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Int BLOCK_BODY
IrExpressionBody RETURN type=<no-type>
BLOCK type=<no-type> hasResult=false operator=null CALL .times type=kotlin.Int operator=null
RETURN type=<no-type> $this: GET_VAR a type=kotlin.Int operator=null
CALL .minus type=kotlin.Int operator=null other: GET_VAR b type=kotlin.Int operator=null
$this: GET_VAR a type=kotlin.Int operator=null FUN public fun test4x(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Int
other: GET_VAR b type=kotlin.Int operator=null BLOCK_BODY
IrFunction public fun test3x(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Int RETURN type=<no-type>
IrExpressionBody CALL .div type=kotlin.Int operator=null
BLOCK type=<no-type> hasResult=false operator=null $this: GET_VAR a type=kotlin.Int operator=null
RETURN type=<no-type> other: GET_VAR b type=kotlin.Int operator=null
CALL .times type=kotlin.Int operator=null FUN public fun test5x(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Int
$this: GET_VAR a type=kotlin.Int operator=null BLOCK_BODY
other: GET_VAR b type=kotlin.Int operator=null RETURN type=<no-type>
IrFunction public fun test4x(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Int CALL .mod type=kotlin.Int operator=null
IrExpressionBody $this: GET_VAR a type=kotlin.Int operator=null
BLOCK type=<no-type> hasResult=false operator=null other: GET_VAR b type=kotlin.Int operator=null
RETURN type=<no-type>
CALL .div type=kotlin.Int operator=null
$this: GET_VAR a type=kotlin.Int operator=null
other: GET_VAR b type=kotlin.Int operator=null
IrFunction public fun test5x(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Int
IrExpressionBody
BLOCK type=<no-type> hasResult=false operator=null
RETURN type=<no-type>
CALL .mod type=kotlin.Int operator=null
$this: GET_VAR a type=kotlin.Int operator=null
other: GET_VAR b type=kotlin.Int operator=null
+31 -37
View File
@@ -1,37 +1,31 @@
IrFile /simpleUnaryOperators.kt FILE /simpleUnaryOperators.kt
IrFunction public fun test1(/*0*/ x: kotlin.Int): kotlin.Int FUN public fun test1(/*0*/ x: kotlin.Int): kotlin.Int
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null RETURN type=<no-type>
RETURN type=<no-type> CALL .unaryMinus type=kotlin.Int operator=UMINUS
CALL .unaryMinus type=kotlin.Int operator=UMINUS $this: GET_VAR x type=kotlin.Int operator=null
$this: GET_VAR x type=kotlin.Int operator=null FUN public fun test2(): kotlin.Int
IrFunction public fun test2(): kotlin.Int BLOCK_BODY
IrExpressionBody RETURN type=<no-type>
BLOCK type=<no-type> hasResult=false operator=null CALL .unaryMinus type=kotlin.Int operator=UMINUS
RETURN type=<no-type> $this: CONST Int type=kotlin.Int value='42'
CALL .unaryMinus type=kotlin.Int operator=UMINUS FUN public fun test3(/*0*/ x: kotlin.Int): kotlin.Int
$this: CONST Int type=kotlin.Int value='42' BLOCK_BODY
IrFunction public fun test3(/*0*/ x: kotlin.Int): kotlin.Int RETURN type=<no-type>
IrExpressionBody CALL .unaryPlus type=kotlin.Int operator=UPLUS
BLOCK type=<no-type> hasResult=false operator=null $this: GET_VAR x type=kotlin.Int operator=null
RETURN type=<no-type> FUN public fun test4(): kotlin.Int
CALL .unaryPlus type=kotlin.Int operator=UPLUS BLOCK_BODY
$this: GET_VAR x type=kotlin.Int operator=null RETURN type=<no-type>
IrFunction public fun test4(): kotlin.Int CALL .unaryPlus type=kotlin.Int operator=UPLUS
IrExpressionBody $this: CONST Int type=kotlin.Int value='42'
BLOCK type=<no-type> hasResult=false operator=null FUN public fun test5(/*0*/ x: kotlin.Boolean): kotlin.Boolean
RETURN type=<no-type> BLOCK_BODY
CALL .unaryPlus type=kotlin.Int operator=UPLUS RETURN type=<no-type>
$this: CONST Int type=kotlin.Int value='42' CALL .not type=kotlin.Boolean operator=EXCL
IrFunction public fun test5(/*0*/ x: kotlin.Boolean): kotlin.Boolean $this: GET_VAR x type=kotlin.Boolean operator=null
IrExpressionBody FUN public fun test6(): kotlin.Boolean
BLOCK type=<no-type> hasResult=false operator=null BLOCK_BODY
RETURN type=<no-type> RETURN type=<no-type>
CALL .not type=kotlin.Boolean operator=EXCL CALL .not type=kotlin.Boolean operator=EXCL
$this: GET_VAR x type=kotlin.Boolean operator=null $this: CONST Boolean type=kotlin.Boolean value='true'
IrFunction public fun test6(): kotlin.Boolean
IrExpressionBody
BLOCK type=<no-type> hasResult=false operator=null
RETURN type=<no-type>
CALL .not type=kotlin.Boolean operator=EXCL
$this: CONST Boolean type=kotlin.Boolean value='true'
+50 -57
View File
@@ -1,62 +1,55 @@
IrFile /smartCasts.kt FILE /smartCasts.kt
IrFunction public fun expectsString(/*0*/ s: kotlin.String): kotlin.Unit FUN public fun expectsString(/*0*/ s: kotlin.String): kotlin.Unit
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null FUN public fun expectsInt(/*0*/ i: kotlin.Int): kotlin.Unit
IrFunction public fun expectsInt(/*0*/ i: kotlin.Int): kotlin.Unit BLOCK_BODY
IrExpressionBody FUN public fun overloaded(/*0*/ s: kotlin.String): kotlin.String
BLOCK type=<no-type> hasResult=false operator=null BLOCK_BODY
IrFunction public fun overloaded(/*0*/ s: kotlin.String): kotlin.String RETURN type=<no-type>
IrExpressionBody GET_VAR s type=kotlin.String operator=null
BLOCK type=<no-type> hasResult=false operator=null FUN public fun overloaded(/*0*/ x: kotlin.Any): kotlin.Any
RETURN type=<no-type> BLOCK_BODY
GET_VAR s type=kotlin.String operator=null RETURN type=<no-type>
IrFunction public fun overloaded(/*0*/ x: kotlin.Any): kotlin.Any GET_VAR x type=kotlin.Any operator=null
IrExpressionBody FUN public fun test1(/*0*/ x: kotlin.Any): kotlin.Unit
BLOCK type=<no-type> hasResult=false operator=null BLOCK_BODY
RETURN type=<no-type> WHEN type=kotlin.Unit operator=IF
if: TYPE_OP operator=NOT_INSTANCEOF typeOperand=kotlin.String
GET_VAR x type=kotlin.Any operator=null GET_VAR x type=kotlin.Any operator=null
IrFunction public fun test1(/*0*/ x: kotlin.Any): kotlin.Unit then: RETURN type=<no-type>
IrExpressionBody CALL .println type=kotlin.Unit operator=null
BLOCK type=<no-type> hasResult=false operator=null message: CALL .<get-length> type=kotlin.Int operator=GET_PROPERTY
WHEN type=kotlin.Unit operator=IF $this: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.String
if: TYPE_OP operator=NOT_INSTANCEOF typeOperand=kotlin.String
GET_VAR x type=kotlin.Any operator=null GET_VAR x type=kotlin.Any operator=null
then: RETURN type=<no-type> CALL .expectsString type=kotlin.Unit operator=null
CALL .println type=kotlin.Unit operator=null s: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.String
message: CALL .<get-length> type=kotlin.Int operator=GET_PROPERTY GET_VAR x type=kotlin.Any operator=null
$this: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.String CALL .expectsInt type=kotlin.Unit operator=null
GET_VAR x type=kotlin.Any operator=null i: CALL .<get-length> type=kotlin.Int operator=GET_PROPERTY
CALL .expectsString type=kotlin.Unit operator=null $this: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.String
GET_VAR x type=kotlin.Any operator=null
CALL .expectsString type=kotlin.Unit operator=null
s: CALL .overloaded type=kotlin.String operator=null
s: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.String s: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.String
GET_VAR x type=kotlin.Any operator=null GET_VAR x type=kotlin.Any operator=null
CALL .expectsInt type=kotlin.Unit operator=null FUN public fun test2(/*0*/ x: kotlin.Any): kotlin.String
i: CALL .<get-length> type=kotlin.Int operator=GET_PROPERTY BLOCK_BODY
$this: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.String WHEN type=kotlin.Unit operator=IF
GET_VAR x type=kotlin.Any operator=null if: TYPE_OP operator=NOT_INSTANCEOF typeOperand=kotlin.String
CALL .expectsString type=kotlin.Unit operator=null GET_VAR x type=kotlin.Any operator=null
s: CALL .overloaded type=kotlin.String operator=null then: RETURN type=<no-type>
s: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.String CONST String type=kotlin.String value=''
GET_VAR x type=kotlin.Any operator=null RETURN type=<no-type>
IrFunction public fun test2(/*0*/ x: kotlin.Any): kotlin.String CALL .overloaded type=kotlin.String operator=null
IrExpressionBody s: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.String
BLOCK type=<no-type> hasResult=false operator=null
WHEN type=kotlin.Unit operator=IF
if: TYPE_OP operator=NOT_INSTANCEOF typeOperand=kotlin.String
GET_VAR x type=kotlin.Any operator=null
then: RETURN type=<no-type>
CONST String type=kotlin.String value=''
RETURN type=<no-type>
CALL .overloaded type=kotlin.String operator=null
s: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.String
GET_VAR x type=kotlin.Any operator=null
IrFunction public fun test3(/*0*/ x: kotlin.Any): kotlin.String
IrExpressionBody
BLOCK type=<no-type> hasResult=false operator=null
WHEN type=kotlin.Unit operator=IF
if: TYPE_OP operator=NOT_INSTANCEOF typeOperand=kotlin.String
GET_VAR x type=kotlin.Any operator=null
then: RETURN type=<no-type>
CONST String type=kotlin.String value=''
RETURN type=<no-type>
TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.String
GET_VAR x type=kotlin.Any operator=null GET_VAR x type=kotlin.Any operator=null
FUN public fun test3(/*0*/ x: kotlin.Any): kotlin.String
BLOCK_BODY
WHEN type=kotlin.Unit operator=IF
if: TYPE_OP operator=NOT_INSTANCEOF typeOperand=kotlin.String
GET_VAR x type=kotlin.Any operator=null
then: RETURN type=<no-type>
CONST String type=kotlin.String value=''
RETURN type=<no-type>
TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.String
GET_VAR x type=kotlin.Any operator=null
+23 -26
View File
@@ -1,28 +1,25 @@
IrFile /smartCastsWithDestructuring.kt FILE /smartCastsWithDestructuring.kt
DUMMY I1 DUMMY I1
DUMMY I2 DUMMY I2
IrFunction public operator fun I1.component1(): kotlin.Int FUN public operator fun I1.component1(): kotlin.Int
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null RETURN type=<no-type>
RETURN type=<no-type> CONST Int type=kotlin.Int value='1'
CONST Int type=kotlin.Int value='1' FUN public operator fun I2.component2(): kotlin.String
IrFunction public operator fun I2.component2(): kotlin.String BLOCK_BODY
IrExpressionBody RETURN type=<no-type>
BLOCK type=<no-type> hasResult=false operator=null CONST String type=kotlin.String value=''
RETURN type=<no-type> FUN public fun test(/*0*/ x: I1): kotlin.Unit
CONST String type=kotlin.String value='' BLOCK_BODY
IrFunction public fun test(/*0*/ x: I1): kotlin.Unit WHEN type=kotlin.Unit operator=IF
IrExpressionBody if: TYPE_OP operator=NOT_INSTANCEOF typeOperand=I2
BLOCK type=<no-type> hasResult=false operator=null GET_VAR x type=I1 operator=null
WHEN type=kotlin.Unit operator=IF then: RETURN type=<no-type>
if: TYPE_OP operator=NOT_INSTANCEOF typeOperand=I2 BLOCK type=kotlin.Unit operator=DESTRUCTURING_DECLARATION
GET_VAR x type=I1 operator=null VAR val c1: kotlin.Int
then: RETURN type=<no-type> CALL .component1 type=kotlin.Int operator=COMPONENT_N(index=1)
BLOCK type=<no-type> hasResult=false operator=SYNTHETIC_BLOCK $receiver: GET_VAR x type=I1 operator=null
VAR val c1: kotlin.Int VAR val c2: kotlin.String
CALL .component1 type=kotlin.Int operator=COMPONENT_N(index=1) CALL .component2 type=kotlin.String operator=COMPONENT_N(index=2)
$receiver: GET_VAR x type=I1 operator=null $receiver: TYPE_OP operator=IMPLICIT_CAST typeOperand=I2
VAR val c2: kotlin.String GET_VAR x type=I1 operator=null
CALL .component2 type=kotlin.String operator=COMPONENT_N(index=2)
$receiver: TYPE_OP operator=IMPLICIT_CAST typeOperand=I2
GET_VAR x type=I1 operator=null
+4 -7
View File
@@ -6,10 +6,7 @@ var testVarWithAccessors: Int
get() = 42 get() = 42
set(v) {} set(v) {}
// 1 IrFunction public fun testFun // 1 FUN public fun testFun
// 1 IrProperty public val testSimpleVal // 1 PROPERTY public val testSimpleVal
// 1 IrProperty public val testValWithGetter // 2 PROPERTY_GETTER
// 2 IrPropertyGetter // 1 PROPERTY_SETTER
// 1 IrPropertySetter
// 1 IrProperty public var testSimpleVar
// 1 IrProperty public var testVarWithAccessors
+21 -25
View File
@@ -1,27 +1,23 @@
IrFile /smoke.kt FILE /smoke.kt
IrFunction public fun testFun(): kotlin.String FUN public fun testFun(): kotlin.String
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null RETURN type=<no-type>
RETURN type=<no-type> CONST String type=kotlin.String value='OK'
CONST String type=kotlin.String value='OK' PROPERTY public val testSimpleVal: kotlin.Int = 1 getter=null setter=null
IrProperty public val testSimpleVal: kotlin.Int = 1 getter=null setter=null EXPRESSION_BODY
IrExpressionBody
CONST Int type=kotlin.Int value='1' CONST Int type=kotlin.Int value='1'
IrProperty public val testValWithGetter: kotlin.Int getter=<get-testValWithGetter> setter=null PROPERTY public val testValWithGetter: kotlin.Int getter=<get-testValWithGetter> setter=null
IrPropertyGetter public fun <get-testValWithGetter>(): kotlin.Int property=testValWithGetter PROPERTY_GETTER public fun <get-testValWithGetter>(): kotlin.Int property=testValWithGetter
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null RETURN type=<no-type>
RETURN type=<no-type> CONST Int type=kotlin.Int value='42'
CONST Int type=kotlin.Int value='42' PROPERTY public var testSimpleVar: kotlin.Int getter=null setter=null
IrProperty public var testSimpleVar: kotlin.Int getter=null setter=null EXPRESSION_BODY
IrExpressionBody
CONST Int type=kotlin.Int value='2' CONST Int type=kotlin.Int value='2'
IrProperty public var testVarWithAccessors: kotlin.Int getter=<get-testVarWithAccessors> setter=<set-testVarWithAccessors> PROPERTY public var testVarWithAccessors: kotlin.Int getter=<get-testVarWithAccessors> setter=<set-testVarWithAccessors>
IrPropertyGetter public fun <get-testVarWithAccessors>(): kotlin.Int property=testVarWithAccessors PROPERTY_GETTER public fun <get-testVarWithAccessors>(): kotlin.Int property=testVarWithAccessors
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null RETURN type=<no-type>
RETURN type=<no-type> CONST Int type=kotlin.Int value='42'
CONST Int type=kotlin.Int value='42' PROPERTY_SETTER public fun <set-testVarWithAccessors>(/*0*/ v: kotlin.Int): kotlin.Unit property=testVarWithAccessors
IrPropertySetter public fun <set-testVarWithAccessors>(/*0*/ v: kotlin.Int): kotlin.Unit property=testVarWithAccessors BLOCK_BODY
IrExpressionBody
BLOCK type=<no-type> hasResult=false operator=null
+29 -33
View File
@@ -1,33 +1,29 @@
IrFile /stringComparisons.kt FILE /stringComparisons.kt
IrFunction public fun test1(/*0*/ a: kotlin.String, /*1*/ b: kotlin.String): kotlin.Boolean FUN public fun test1(/*0*/ a: kotlin.String, /*1*/ b: kotlin.String): kotlin.Boolean
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null RETURN type=<no-type>
RETURN type=<no-type> CALL .GT0 type=kotlin.Boolean operator=GT
CALL .GT0 type=kotlin.Boolean operator=GT arg0: CALL .compareTo type=kotlin.Int operator=GT
arg0: CALL .compareTo type=kotlin.Int operator=GT $this: GET_VAR a type=kotlin.String operator=null
$this: GET_VAR a type=kotlin.String operator=null other: GET_VAR b type=kotlin.String operator=null
other: GET_VAR b type=kotlin.String operator=null FUN public fun test2(/*0*/ a: kotlin.String, /*1*/ b: kotlin.String): kotlin.Boolean
IrFunction public fun test2(/*0*/ a: kotlin.String, /*1*/ b: kotlin.String): kotlin.Boolean BLOCK_BODY
IrExpressionBody RETURN type=<no-type>
BLOCK type=<no-type> hasResult=false operator=null CALL .LT0 type=kotlin.Boolean operator=LT
RETURN type=<no-type> arg0: CALL .compareTo type=kotlin.Int operator=LT
CALL .LT0 type=kotlin.Boolean operator=LT $this: GET_VAR a type=kotlin.String operator=null
arg0: CALL .compareTo type=kotlin.Int operator=LT other: GET_VAR b type=kotlin.String operator=null
$this: GET_VAR a type=kotlin.String operator=null FUN public fun test3(/*0*/ a: kotlin.String, /*1*/ b: kotlin.String): kotlin.Boolean
other: GET_VAR b type=kotlin.String operator=null BLOCK_BODY
IrFunction public fun test3(/*0*/ a: kotlin.String, /*1*/ b: kotlin.String): kotlin.Boolean RETURN type=<no-type>
IrExpressionBody CALL .GTEQ0 type=kotlin.Boolean operator=GTEQ
BLOCK type=<no-type> hasResult=false operator=null arg0: CALL .compareTo type=kotlin.Int operator=GTEQ
RETURN type=<no-type> $this: GET_VAR a type=kotlin.String operator=null
CALL .GTEQ0 type=kotlin.Boolean operator=GTEQ other: GET_VAR b type=kotlin.String operator=null
arg0: CALL .compareTo type=kotlin.Int operator=GTEQ FUN public fun test4(/*0*/ a: kotlin.String, /*1*/ b: kotlin.String): kotlin.Boolean
$this: GET_VAR a type=kotlin.String operator=null BLOCK_BODY
other: GET_VAR b type=kotlin.String operator=null RETURN type=<no-type>
IrFunction public fun test4(/*0*/ a: kotlin.String, /*1*/ b: kotlin.String): kotlin.Boolean CALL .LTEQ0 type=kotlin.Boolean operator=LTEQ
IrExpressionBody arg0: CALL .compareTo type=kotlin.Int operator=LTEQ
BLOCK type=<no-type> hasResult=false operator=null $this: GET_VAR a type=kotlin.String operator=null
RETURN type=<no-type> other: GET_VAR b type=kotlin.String operator=null
CALL .LTEQ0 type=kotlin.Boolean operator=LTEQ
arg0: CALL .compareTo type=kotlin.Int operator=LTEQ
$this: GET_VAR a type=kotlin.String operator=null
other: GET_VAR b type=kotlin.String operator=null
+24 -27
View File
@@ -1,27 +1,24 @@
IrFile /stringPlus.kt FILE /stringPlus.kt
IrFunction public fun test1(/*0*/ a: kotlin.String, /*1*/ b: kotlin.Any): kotlin.String FUN public fun test1(/*0*/ a: kotlin.String, /*1*/ b: kotlin.Any): kotlin.String
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null RETURN type=<no-type>
RETURN type=<no-type> STRING_CONCATENATION type=kotlin.String
STRING_CONCATENATION type=kotlin.String GET_VAR a type=kotlin.String operator=null
GET_VAR a type=kotlin.String operator=null GET_VAR b type=kotlin.Any operator=null
GET_VAR b type=kotlin.Any operator=null FUN public fun test2(/*0*/ a: kotlin.String, /*1*/ b: kotlin.Int): kotlin.String
IrFunction public fun test2(/*0*/ a: kotlin.String, /*1*/ b: kotlin.Int): kotlin.String BLOCK_BODY
IrExpressionBody RETURN type=<no-type>
BLOCK type=<no-type> hasResult=false operator=null STRING_CONCATENATION type=kotlin.String
RETURN type=<no-type> GET_VAR a type=kotlin.String operator=null
STRING_CONCATENATION type=kotlin.String CONST String type=kotlin.String value='+'
GET_VAR a type=kotlin.String operator=null GET_VAR b type=kotlin.Int operator=null
CONST String type=kotlin.String value='+' FUN public fun test3(/*0*/ a: kotlin.String, /*1*/ b: kotlin.Int): kotlin.String
GET_VAR b type=kotlin.Int operator=null BLOCK_BODY
IrFunction public fun test3(/*0*/ a: kotlin.String, /*1*/ b: kotlin.Int): kotlin.String RETURN type=<no-type>
IrExpressionBody STRING_CONCATENATION type=kotlin.String
BLOCK type=<no-type> hasResult=false operator=null GET_VAR a type=kotlin.String operator=null
RETURN type=<no-type> CONST String type=kotlin.String value='+'
STRING_CONCATENATION type=kotlin.String CALL .plus type=kotlin.Int operator=PLUS
GET_VAR a type=kotlin.String operator=null $this: GET_VAR b type=kotlin.Int operator=null
CONST String type=kotlin.String value='+' other: CONST Int type=kotlin.Int value='1'
CALL .plus type=kotlin.Int operator=PLUS GET_VAR a type=kotlin.String operator=null
$this: GET_VAR b type=kotlin.Int operator=null
other: CONST Int type=kotlin.Int value='1'
GET_VAR a type=kotlin.String operator=null
+14 -16
View File
@@ -1,16 +1,14 @@
IrFile /throw.kt FILE /throw.kt
IrFunction public fun test1(): kotlin.Unit FUN public fun test1(): kotlin.Unit
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null THROW type=<no-type>
THROW type=<no-type> CALL .<init> type=kotlin.Throwable operator=null
CALL .<init> type=kotlin.Throwable operator=null FUN public fun testImplicitCast(/*0*/ a: kotlin.Any): kotlin.Unit
IrFunction public fun testImplicitCast(/*0*/ a: kotlin.Any): kotlin.Unit BLOCK_BODY
IrExpressionBody WHEN type=kotlin.Unit operator=IF
BLOCK type=<no-type> hasResult=false operator=null if: TYPE_OP operator=INSTANCEOF typeOperand=kotlin.Throwable
WHEN type=kotlin.Unit operator=IF GET_VAR a type=kotlin.Any operator=null
if: TYPE_OP operator=INSTANCEOF typeOperand=kotlin.Throwable then: BLOCK type=kotlin.Nothing operator=null
GET_VAR a type=kotlin.Any operator=null THROW type=<no-type>
then: BLOCK type=<no-type> hasResult=false operator=null TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.Throwable
THROW type=<no-type> GET_VAR a type=kotlin.Any operator=null
TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.Throwable
GET_VAR a type=kotlin.Any operator=null
-6
View File
@@ -23,9 +23,3 @@ fun test2(): Int {
println() println()
} }
} }
fun testImplicitCast(a: Any) {
if (a !is String) return
val t: String = try { a } catch (e: Throwable) { "" }
}
+19 -35
View File
@@ -1,38 +1,22 @@
IrFile /tryCatch.kt FILE /tryCatch.kt
IrFunction public fun test1(): kotlin.Unit FUN public fun test1(): kotlin.Unit
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null TRY_CATCH type=kotlin.Unit
TRY_CATCH type=kotlin.Unit try: BLOCK type=kotlin.Unit operator=null
try: BLOCK type=<no-type> hasResult=false operator=null CALL .println type=kotlin.Unit operator=null
catch e: BLOCK type=kotlin.Unit operator=null
CALL .println type=kotlin.Unit operator=null
finally: BLOCK type=kotlin.Unit operator=null
CALL .println type=kotlin.Unit operator=null
FUN public fun test2(): kotlin.Int
BLOCK_BODY
RETURN type=<no-type>
TRY_CATCH type=kotlin.Int
try: BLOCK type=kotlin.Int operator=null
CALL .println type=kotlin.Unit operator=null CALL .println type=kotlin.Unit operator=null
catch e: BLOCK type=<no-type> hasResult=false operator=null CONST Int type=kotlin.Int value='42'
catch e: BLOCK type=kotlin.Int operator=null
CALL .println type=kotlin.Unit operator=null CALL .println type=kotlin.Unit operator=null
finally: BLOCK type=<no-type> hasResult=false operator=null CONST Int type=kotlin.Int value='24'
finally: BLOCK type=kotlin.Unit operator=null
CALL .println type=kotlin.Unit operator=null CALL .println type=kotlin.Unit operator=null
IrFunction public fun test2(): kotlin.Int
IrExpressionBody
BLOCK type=<no-type> hasResult=false operator=null
RETURN type=<no-type>
TRY_CATCH type=kotlin.Int
try: BLOCK type=kotlin.Int hasResult=true operator=null
CALL .println type=kotlin.Unit operator=null
CONST Int type=kotlin.Int value='42'
catch e: BLOCK type=kotlin.Int hasResult=true operator=null
CALL .println type=kotlin.Unit operator=null
CONST Int type=kotlin.Int value='24'
finally: BLOCK type=<no-type> hasResult=false operator=null
CALL .println type=kotlin.Unit operator=null
IrFunction public fun testImplicitCast(/*0*/ a: kotlin.Any): kotlin.Unit
IrExpressionBody
BLOCK type=<no-type> hasResult=false operator=null
WHEN type=kotlin.Unit operator=IF
if: TYPE_OP operator=NOT_INSTANCEOF typeOperand=kotlin.String
GET_VAR a type=kotlin.Any operator=null
then: RETURN type=<no-type>
VAR val t: kotlin.String
TRY_CATCH type=kotlin.String
try: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.String
BLOCK type=kotlin.Any hasResult=true operator=null
GET_VAR a type=kotlin.Any operator=null
catch e: BLOCK type=kotlin.String hasResult=true operator=null
CONST String type=kotlin.String value=''
@@ -0,0 +1,5 @@
fun testImplicitCast(a: Any) {
if (a !is String) return
val t: String = try { a } catch (e: Throwable) { "" }
}
@@ -0,0 +1,14 @@
FILE /tryCatchWithImplicitCast.kt
FUN public fun testImplicitCast(/*0*/ a: kotlin.Any): kotlin.Unit
BLOCK_BODY
WHEN type=kotlin.Unit operator=IF
if: TYPE_OP operator=NOT_INSTANCEOF typeOperand=kotlin.String
GET_VAR a type=kotlin.Any operator=null
then: RETURN type=<no-type>
VAR val t: kotlin.String
TRY_CATCH type=kotlin.String
try: BLOCK type=kotlin.String operator=null
TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.String
GET_VAR a type=kotlin.Any operator=null
catch e: BLOCK type=kotlin.String operator=null
CONST String type=kotlin.String value=''
+21 -25
View File
@@ -1,26 +1,22 @@
IrFile /typeOperators.kt FILE /typeOperators.kt
DUMMY IThing DUMMY IThing
IrFunction public fun test1(/*0*/ x: kotlin.Any): kotlin.Boolean FUN public fun test1(/*0*/ x: kotlin.Any): kotlin.Boolean
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null RETURN type=<no-type>
RETURN type=<no-type> TYPE_OP operator=INSTANCEOF typeOperand=IThing
TYPE_OP operator=INSTANCEOF typeOperand=IThing GET_VAR x type=kotlin.Any operator=null
GET_VAR x type=kotlin.Any operator=null FUN public fun test2(/*0*/ x: kotlin.Any): kotlin.Boolean
IrFunction public fun test2(/*0*/ x: kotlin.Any): kotlin.Boolean BLOCK_BODY
IrExpressionBody RETURN type=<no-type>
BLOCK type=<no-type> hasResult=false operator=null TYPE_OP operator=NOT_INSTANCEOF typeOperand=IThing
RETURN type=<no-type> GET_VAR x type=kotlin.Any operator=null
TYPE_OP operator=NOT_INSTANCEOF typeOperand=IThing FUN public fun test3(/*0*/ x: kotlin.Any): IThing
GET_VAR x type=kotlin.Any operator=null BLOCK_BODY
IrFunction public fun test3(/*0*/ x: kotlin.Any): IThing RETURN type=<no-type>
IrExpressionBody TYPE_OP operator=CAST typeOperand=IThing
BLOCK type=<no-type> hasResult=false operator=null GET_VAR x type=kotlin.Any operator=null
RETURN type=<no-type> FUN public fun test4(/*0*/ x: kotlin.Any): IThing?
TYPE_OP operator=CAST typeOperand=IThing BLOCK_BODY
GET_VAR x type=kotlin.Any operator=null RETURN type=<no-type>
IrFunction public fun test4(/*0*/ x: kotlin.Any): IThing? TYPE_OP operator=SAFE_CAST typeOperand=IThing
IrExpressionBody GET_VAR x type=kotlin.Any operator=null
BLOCK type=<no-type> hasResult=false operator=null
RETURN type=<no-type>
TYPE_OP operator=SAFE_CAST typeOperand=IThing
GET_VAR x type=kotlin.Any operator=null
+19 -23
View File
@@ -1,27 +1,23 @@
IrFile /values.kt FILE /values.kt
DUMMY Enum DUMMY Enum
DUMMY A DUMMY A
IrProperty public val a: kotlin.Int = 0 getter=null setter=null PROPERTY public val a: kotlin.Int = 0 getter=null setter=null
IrExpressionBody EXPRESSION_BODY
CONST Int type=kotlin.Int value='0' CONST Int type=kotlin.Int value='0'
DUMMY Z DUMMY Z
IrFunction public fun test1(): Enum FUN public fun test1(): Enum
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null RETURN type=<no-type>
RETURN type=<no-type> GET_ENUM_VALUE A type=Enum
GET_ENUM_VALUE A type=Enum FUN public fun test2(): A
IrFunction public fun test2(): A BLOCK_BODY
IrExpressionBody RETURN type=<no-type>
BLOCK type=<no-type> hasResult=false operator=null GET_OBJECT A type=A
RETURN type=<no-type> FUN public fun test3(): kotlin.Int
GET_OBJECT A type=A BLOCK_BODY
IrFunction public fun test3(): kotlin.Int RETURN type=<no-type>
IrExpressionBody CALL .<get-a> type=kotlin.Int operator=GET_PROPERTY
BLOCK type=<no-type> hasResult=false operator=null FUN public fun test4(): Z.Companion
RETURN type=<no-type> BLOCK_BODY
CALL .<get-a> type=kotlin.Int operator=GET_PROPERTY RETURN type=<no-type>
IrFunction public fun test4(): Z.Companion GET_OBJECT Companion type=Z.Companion
IrExpressionBody
BLOCK type=<no-type> hasResult=false operator=null
RETURN type=<no-type>
GET_OBJECT Companion type=Z.Companion
+31 -36
View File
@@ -1,38 +1,33 @@
IrFile /variableAsFunctionCall.kt FILE /variableAsFunctionCall.kt
IrFunction public fun kotlin.String.k(): () -> kotlin.String FUN public fun kotlin.String.k(): () -> kotlin.String
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null RETURN type=<no-type>
RETURN type=<no-type> DUMMY KtLambdaExpression type=() -> kotlin.String
DUMMY KtLambdaExpression type=() -> kotlin.String FUN public fun test1(/*0*/ f: () -> kotlin.Unit): kotlin.Unit
IrFunction public fun test1(/*0*/ f: () -> kotlin.Unit): kotlin.Unit BLOCK_BODY
IrExpressionBody RETURN type=<no-type>
BLOCK type=<no-type> hasResult=false operator=null CALL .invoke type=kotlin.Unit operator=INVOKE
RETURN type=<no-type> $this: GET_VAR f type=() -> kotlin.Unit operator=VARIABLE_AS_FUNCTION
CALL .invoke type=kotlin.Unit operator=INVOKE FUN public fun test2(/*0*/ f: kotlin.String.() -> kotlin.Unit): kotlin.Unit
$this: GET_VAR f type=() -> kotlin.Unit operator=VARIABLE_AS_FUNCTION BLOCK_BODY
IrFunction public fun test2(/*0*/ f: kotlin.String.() -> kotlin.Unit): kotlin.Unit RETURN type=<no-type>
IrExpressionBody CALL .invoke type=kotlin.Unit operator=INVOKE
BLOCK type=<no-type> hasResult=false operator=null $this: GET_VAR f type=kotlin.String.() -> kotlin.Unit operator=VARIABLE_AS_FUNCTION
RETURN type=<no-type> $receiver: CONST String type=kotlin.String value='hello'
CALL .invoke type=kotlin.Unit operator=INVOKE FUN public fun test3(): kotlin.String
$this: GET_VAR f type=kotlin.String.() -> kotlin.Unit operator=VARIABLE_AS_FUNCTION BLOCK_BODY
RETURN type=<no-type>
CALL .invoke type=kotlin.String operator=null
$this: CALL .k type=() -> kotlin.String operator=null
$receiver: CONST String type=kotlin.String value='hello' $receiver: CONST String type=kotlin.String value='hello'
IrFunction public fun test3(): kotlin.String FUN public fun test4(/*0*/ ns: kotlin.String?): kotlin.String?
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null RETURN type=<no-type>
RETURN type=<no-type> WHEN type=kotlin.String? operator=SAFE_CALL
CALL .invoke type=kotlin.String operator=null if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR ns type=kotlin.String? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null'
else: CALL .invoke type=kotlin.String operator=null
$this: CALL .k type=() -> kotlin.String operator=null $this: CALL .k type=() -> kotlin.String operator=null
$receiver: CONST String type=kotlin.String value='hello' $this: GET_VAR ns type=kotlin.String? operator=null
IrFunction public fun test4(/*0*/ ns: kotlin.String?): kotlin.String?
IrExpressionBody
BLOCK type=<no-type> hasResult=false operator=null
RETURN type=<no-type>
WHEN type=kotlin.String? operator=SAFE_CALL
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR ns type=kotlin.String? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST Null type=kotlin.Nothing? value='null'
else: CALL .invoke type=kotlin.String operator=null
$this: CALL .k type=() -> kotlin.String operator=null
$this: GET_VAR ns type=kotlin.String? operator=null
+65 -68
View File
@@ -1,98 +1,95 @@
IrFile /when.kt FILE /when.kt
DUMMY A DUMMY A
IrFunction public fun testWithSubject(/*0*/ x: kotlin.Any?): kotlin.String FUN public fun testWithSubject(/*0*/ x: kotlin.Any?): kotlin.String
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null RETURN type=<no-type>
RETURN type=<no-type> BLOCK type=kotlin.String operator=WHEN
BLOCK type=kotlin.String hasResult=true operator=WHEN VAR val tmp0_subject: kotlin.Any?
VAR val tmp0_subject: kotlin.Any? GET_VAR x type=kotlin.Any? operator=null
GET_VAR x type=kotlin.Any? operator=null
WHEN type=kotlin.String operator=WHEN
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR tmp0_subject type=kotlin.Any? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST String type=kotlin.String value='null'
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR tmp0_subject type=kotlin.Any? operator=null
arg1: GET_OBJECT A type=A
then: CONST String type=kotlin.String value='A'
if: TYPE_OP operator=INSTANCEOF typeOperand=kotlin.String
GET_VAR tmp0_subject type=kotlin.Any? operator=null
then: CONST String type=kotlin.String value='String'
if: CALL .contains type=kotlin.Boolean operator=IN
$receiver: CALL .setOf type=kotlin.collections.Set<kotlin.Nothing> operator=null
element: GET_VAR tmp0_subject type=kotlin.Any? operator=null
then: CONST String type=kotlin.String value='nothingness?'
else: CONST String type=kotlin.String value='something'
IrFunction public fun test(/*0*/ x: kotlin.Any?): kotlin.String
IrExpressionBody
BLOCK type=<no-type> hasResult=false operator=null
RETURN type=<no-type>
WHEN type=kotlin.String operator=WHEN WHEN type=kotlin.String operator=WHEN
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR x type=kotlin.Any? operator=null arg0: GET_VAR tmp0_subject type=kotlin.Any? operator=null
arg1: CONST Null type=kotlin.Nothing? value='null' arg1: CONST Null type=kotlin.Nothing? value='null'
then: CONST String type=kotlin.String value='null' then: CONST String type=kotlin.String value='null'
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR x type=kotlin.Any? operator=null arg0: GET_VAR tmp0_subject type=kotlin.Any? operator=null
arg1: GET_OBJECT A type=A arg1: GET_OBJECT A type=A
then: CONST String type=kotlin.String value='A' then: CONST String type=kotlin.String value='A'
if: TYPE_OP operator=INSTANCEOF typeOperand=kotlin.String if: TYPE_OP operator=INSTANCEOF typeOperand=kotlin.String
GET_VAR x type=kotlin.Any? operator=null GET_VAR tmp0_subject type=kotlin.Any? operator=null
then: CONST String type=kotlin.String value='String' then: CONST String type=kotlin.String value='String'
if: CALL .contains type=kotlin.Boolean operator=IN if: CALL .contains type=kotlin.Boolean operator=IN
$receiver: CALL .setOf type=kotlin.collections.Set<kotlin.Nothing> operator=null $receiver: CALL .setOf type=kotlin.collections.Set<kotlin.Nothing> operator=null
element: GET_VAR x type=kotlin.Any? operator=null element: GET_VAR tmp0_subject type=kotlin.Any? operator=null
then: CONST String type=kotlin.String value='nothingness?' then: CONST String type=kotlin.String value='nothingness?'
else: CONST String type=kotlin.String value='something' else: CONST String type=kotlin.String value='something'
IrFunction public fun testComma(/*0*/ x: kotlin.Int): kotlin.String FUN public fun test(/*0*/ x: kotlin.Any?): kotlin.String
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null RETURN type=<no-type>
RETURN type=<no-type> WHEN type=kotlin.String operator=WHEN
BLOCK type=kotlin.String hasResult=true operator=WHEN if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
VAR val tmp0_subject: kotlin.Int arg0: GET_VAR x type=kotlin.Any? operator=null
GET_VAR x type=kotlin.Int operator=null arg1: CONST Null type=kotlin.Nothing? value='null'
WHEN type=kotlin.String operator=WHEN then: CONST String type=kotlin.String value='null'
if: WHEN type=kotlin.Boolean operator=WHEN_COMMA if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
if: WHEN type=kotlin.Boolean operator=WHEN_COMMA arg0: GET_VAR x type=kotlin.Any? operator=null
if: WHEN type=kotlin.Boolean operator=WHEN_COMMA arg1: GET_OBJECT A type=A
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ then: CONST String type=kotlin.String value='A'
arg0: GET_VAR tmp0_subject type=kotlin.Int operator=null if: TYPE_OP operator=INSTANCEOF typeOperand=kotlin.String
arg1: CONST Int type=kotlin.Int value='1' GET_VAR x type=kotlin.Any? operator=null
then: CONST Boolean type=kotlin.Boolean value='true' then: CONST String type=kotlin.String value='String'
else: CALL .EQEQ type=kotlin.Boolean operator=EQEQ if: CALL .contains type=kotlin.Boolean operator=IN
arg0: GET_VAR tmp0_subject type=kotlin.Int operator=null $receiver: CALL .setOf type=kotlin.collections.Set<kotlin.Nothing> operator=null
arg1: CONST Int type=kotlin.Int value='2' element: GET_VAR x type=kotlin.Any? operator=null
then: CONST Boolean type=kotlin.Boolean value='true' then: CONST String type=kotlin.String value='nothingness?'
else: CALL .EQEQ type=kotlin.Boolean operator=EQEQ else: CONST String type=kotlin.String value='something'
arg0: GET_VAR tmp0_subject type=kotlin.Int operator=null FUN public fun testComma(/*0*/ x: kotlin.Int): kotlin.String
arg1: CONST Int type=kotlin.Int value='3' BLOCK_BODY
then: CONST Boolean type=kotlin.Boolean value='true' RETURN type=<no-type>
else: CALL .EQEQ type=kotlin.Boolean operator=EQEQ BLOCK type=kotlin.String operator=WHEN
arg0: GET_VAR tmp0_subject type=kotlin.Int operator=null VAR val tmp0_subject: kotlin.Int
arg1: CONST Int type=kotlin.Int value='4' GET_VAR x type=kotlin.Int operator=null
then: CONST String type=kotlin.String value='1234' WHEN type=kotlin.String operator=WHEN
if: WHEN type=kotlin.Boolean operator=WHEN_COMMA
if: WHEN type=kotlin.Boolean operator=WHEN_COMMA if: WHEN type=kotlin.Boolean operator=WHEN_COMMA
if: WHEN type=kotlin.Boolean operator=WHEN_COMMA if: WHEN type=kotlin.Boolean operator=WHEN_COMMA
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR tmp0_subject type=kotlin.Int operator=null arg0: GET_VAR tmp0_subject type=kotlin.Int operator=null
arg1: CONST Int type=kotlin.Int value='5' arg1: CONST Int type=kotlin.Int value='1'
then: CONST Boolean type=kotlin.Boolean value='true' then: CONST Boolean type=kotlin.Boolean value='true'
else: CALL .EQEQ type=kotlin.Boolean operator=EQEQ else: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR tmp0_subject type=kotlin.Int operator=null arg0: GET_VAR tmp0_subject type=kotlin.Int operator=null
arg1: CONST Int type=kotlin.Int value='6' arg1: CONST Int type=kotlin.Int value='2'
then: CONST Boolean type=kotlin.Boolean value='true' then: CONST Boolean type=kotlin.Boolean value='true'
else: CALL .EQEQ type=kotlin.Boolean operator=EQEQ else: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR tmp0_subject type=kotlin.Int operator=null arg0: GET_VAR tmp0_subject type=kotlin.Int operator=null
arg1: CONST Int type=kotlin.Int value='7' arg1: CONST Int type=kotlin.Int value='3'
then: CONST String type=kotlin.String value='567' then: CONST Boolean type=kotlin.Boolean value='true'
else: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR tmp0_subject type=kotlin.Int operator=null
arg1: CONST Int type=kotlin.Int value='4'
then: CONST String type=kotlin.String value='1234'
if: WHEN type=kotlin.Boolean operator=WHEN_COMMA
if: WHEN type=kotlin.Boolean operator=WHEN_COMMA if: WHEN type=kotlin.Boolean operator=WHEN_COMMA
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR tmp0_subject type=kotlin.Int operator=null arg0: GET_VAR tmp0_subject type=kotlin.Int operator=null
arg1: CONST Int type=kotlin.Int value='8' arg1: CONST Int type=kotlin.Int value='5'
then: CONST Boolean type=kotlin.Boolean value='true' then: CONST Boolean type=kotlin.Boolean value='true'
else: CALL .EQEQ type=kotlin.Boolean operator=EQEQ else: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR tmp0_subject type=kotlin.Int operator=null arg0: GET_VAR tmp0_subject type=kotlin.Int operator=null
arg1: CONST Int type=kotlin.Int value='9' arg1: CONST Int type=kotlin.Int value='6'
then: CONST String type=kotlin.String value='89' then: CONST Boolean type=kotlin.Boolean value='true'
else: CONST String type=kotlin.String value='?' else: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR tmp0_subject type=kotlin.Int operator=null
arg1: CONST Int type=kotlin.Int value='7'
then: CONST String type=kotlin.String value='567'
if: WHEN type=kotlin.Boolean operator=WHEN_COMMA
if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR tmp0_subject type=kotlin.Int operator=null
arg1: CONST Int type=kotlin.Int value='8'
then: CONST Boolean type=kotlin.Boolean value='true'
else: CALL .EQEQ type=kotlin.Boolean operator=EQEQ
arg0: GET_VAR tmp0_subject type=kotlin.Int operator=null
arg1: CONST Int type=kotlin.Int value='9'
then: CONST String type=kotlin.String value='89'
else: CONST String type=kotlin.String value='?'
+65 -67
View File
@@ -1,73 +1,71 @@
IrFile /whileDoWhile.kt FILE /whileDoWhile.kt
IrFunction public fun test(): kotlin.Unit FUN public fun test(): kotlin.Unit
IrExpressionBody BLOCK_BODY
BLOCK type=<no-type> hasResult=false operator=null VAR var x: kotlin.Int
VAR var x: kotlin.Int CONST Int type=kotlin.Int value='0'
CONST Int type=kotlin.Int value='0' WHILE label=null operator=WHILE_LOOP
WHILE label=null operator=WHILE_LOOP condition: CALL .LT0 type=kotlin.Boolean operator=LT
condition: CALL .LT0 type=kotlin.Boolean operator=LT arg0: CALL .compareTo type=kotlin.Int operator=LT
arg0: CALL .compareTo type=kotlin.Int operator=LT $this: GET_VAR x type=kotlin.Int operator=null
$this: GET_VAR x type=kotlin.Int operator=null other: CONST Int type=kotlin.Int value='5'
other: CONST Int type=kotlin.Int value='5' body: BLOCK type=kotlin.Int operator=POSTFIX_INCR
body: BLOCK type=kotlin.Int hasResult=true operator=POSTFIX_INCR VAR val tmp0: kotlin.Int
VAR val tmp0: kotlin.Int GET_VAR x type=kotlin.Int operator=POSTFIX_INCR
SET_VAR x type=<no-type> operator=POSTFIX_INCR
CALL .inc type=kotlin.Int operator=POSTFIX_INCR
$this: GET_VAR tmp0 type=kotlin.Int operator=null
GET_VAR tmp0 type=kotlin.Int operator=null
WHILE label=null operator=WHILE_LOOP
condition: CALL .LT0 type=kotlin.Boolean operator=LT
arg0: CALL .compareTo type=kotlin.Int operator=LT
$this: GET_VAR x type=kotlin.Int operator=null
other: CONST Int type=kotlin.Int value='10'
body: BLOCK type=kotlin.Int operator=null
BLOCK type=kotlin.Int operator=POSTFIX_INCR
VAR val tmp1: kotlin.Int
GET_VAR x type=kotlin.Int operator=POSTFIX_INCR GET_VAR x type=kotlin.Int operator=POSTFIX_INCR
SET_VAR x type=<no-type> operator=POSTFIX_INCR SET_VAR x type=<no-type> operator=POSTFIX_INCR
CALL .inc type=kotlin.Int operator=POSTFIX_INCR CALL .inc type=kotlin.Int operator=POSTFIX_INCR
$this: GET_VAR tmp0 type=kotlin.Int operator=null $this: GET_VAR tmp1 type=kotlin.Int operator=null
GET_VAR tmp0 type=kotlin.Int operator=null GET_VAR tmp1 type=kotlin.Int operator=null
WHILE label=null operator=WHILE_LOOP DO_WHILE label=null operator=DO_WHILE_LOOP
condition: CALL .LT0 type=kotlin.Boolean operator=LT body: BLOCK type=kotlin.Int operator=POSTFIX_INCR
arg0: CALL .compareTo type=kotlin.Int operator=LT VAR val tmp2: kotlin.Int
$this: GET_VAR x type=kotlin.Int operator=null GET_VAR x type=kotlin.Int operator=POSTFIX_INCR
other: CONST Int type=kotlin.Int value='10' SET_VAR x type=<no-type> operator=POSTFIX_INCR
body: BLOCK type=kotlin.Int hasResult=true operator=null CALL .inc type=kotlin.Int operator=POSTFIX_INCR
BLOCK type=kotlin.Int hasResult=true operator=POSTFIX_INCR $this: GET_VAR tmp2 type=kotlin.Int operator=null
VAR val tmp1: kotlin.Int GET_VAR tmp2 type=kotlin.Int operator=null
GET_VAR x type=kotlin.Int operator=POSTFIX_INCR condition: CALL .LT0 type=kotlin.Boolean operator=LT
SET_VAR x type=<no-type> operator=POSTFIX_INCR arg0: CALL .compareTo type=kotlin.Int operator=LT
CALL .inc type=kotlin.Int operator=POSTFIX_INCR $this: GET_VAR x type=kotlin.Int operator=null
$this: GET_VAR tmp1 type=kotlin.Int operator=null other: CONST Int type=kotlin.Int value='15'
GET_VAR tmp1 type=kotlin.Int operator=null DO_WHILE label=null operator=DO_WHILE_LOOP
DO_WHILE label=null operator=DO_WHILE_LOOP body: BLOCK type=kotlin.Unit operator=null
body: BLOCK type=kotlin.Int hasResult=true operator=POSTFIX_INCR BLOCK type=kotlin.Int operator=POSTFIX_INCR
VAR val tmp2: kotlin.Int VAR val tmp3: kotlin.Int
GET_VAR x type=kotlin.Int operator=POSTFIX_INCR GET_VAR x type=kotlin.Int operator=POSTFIX_INCR
SET_VAR x type=<no-type> operator=POSTFIX_INCR SET_VAR x type=<no-type> operator=POSTFIX_INCR
CALL .inc type=kotlin.Int operator=POSTFIX_INCR CALL .inc type=kotlin.Int operator=POSTFIX_INCR
$this: GET_VAR tmp2 type=kotlin.Int operator=null $this: GET_VAR tmp3 type=kotlin.Int operator=null
GET_VAR tmp2 type=kotlin.Int operator=null GET_VAR tmp3 type=kotlin.Int operator=null
condition: CALL .LT0 type=kotlin.Boolean operator=LT condition: CALL .LT0 type=kotlin.Boolean operator=LT
arg0: CALL .compareTo type=kotlin.Int operator=LT arg0: CALL .compareTo type=kotlin.Int operator=LT
$this: GET_VAR x type=kotlin.Int operator=null $this: GET_VAR x type=kotlin.Int operator=null
other: CONST Int type=kotlin.Int value='15' other: CONST Int type=kotlin.Int value='20'
DO_WHILE label=null operator=DO_WHILE_LOOP FUN public fun testSmartcastInCondition(): kotlin.Unit
body: BLOCK type=kotlin.Int hasResult=true operator=null BLOCK_BODY
BLOCK type=kotlin.Int hasResult=true operator=POSTFIX_INCR VAR val a: kotlin.Any? = null
VAR val tmp3: kotlin.Int CONST Null type=kotlin.Nothing? value='null'
GET_VAR x type=kotlin.Int operator=POSTFIX_INCR WHEN type=kotlin.Unit operator=IF
SET_VAR x type=<no-type> operator=POSTFIX_INCR if: TYPE_OP operator=INSTANCEOF typeOperand=kotlin.Boolean
CALL .inc type=kotlin.Int operator=POSTFIX_INCR GET_VAR a type=kotlin.Any? operator=null
$this: GET_VAR tmp3 type=kotlin.Int operator=null then: BLOCK type=kotlin.Unit operator=null
GET_VAR tmp3 type=kotlin.Int operator=null WHILE label=null operator=WHILE_LOOP
condition: CALL .LT0 type=kotlin.Boolean operator=LT condition: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.Boolean
arg0: CALL .compareTo type=kotlin.Int operator=LT GET_VAR a type=kotlin.Any? operator=null
$this: GET_VAR x type=kotlin.Int operator=null body: BLOCK type=kotlin.Unit operator=null
other: CONST Int type=kotlin.Int value='20' DO_WHILE label=null operator=DO_WHILE_LOOP
IrFunction public fun testSmartcastInCondition(): kotlin.Unit body: BLOCK type=kotlin.Unit operator=null
IrExpressionBody condition: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.Boolean
BLOCK type=<no-type> hasResult=false operator=null GET_VAR a type=kotlin.Any? operator=null
VAR val a: kotlin.Any? = null
CONST Null type=kotlin.Nothing? value='null'
WHEN type=kotlin.Unit operator=IF
if: TYPE_OP operator=INSTANCEOF typeOperand=kotlin.Boolean
GET_VAR a type=kotlin.Any? operator=null
then: BLOCK type=<no-type> hasResult=false operator=null
WHILE label=null operator=WHILE_LOOP
condition: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.Boolean
GET_VAR a type=kotlin.Any? operator=null
body: BLOCK type=<no-type> hasResult=false operator=null
DO_WHILE label=null operator=DO_WHILE_LOOP
body: BLOCK type=<no-type> hasResult=false operator=null
condition: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.Boolean
GET_VAR a type=kotlin.Any? operator=null
@@ -281,6 +281,12 @@ public class IrTextTestCaseGenerated extends AbstractIrTextTestCase {
doTest(fileName); doTest(fileName);
} }
@TestMetadata("tryCatchWithImplicitCast.kt")
public void testTryCatchWithImplicitCast() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irText/tryCatchWithImplicitCast.kt");
doTest(fileName);
}
@TestMetadata("typeOperators.kt") @TestMetadata("typeOperators.kt")
public void testTypeOperators() throws Exception { public void testTypeOperators() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irText/typeOperators.kt"); String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irText/typeOperators.kt");