diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/builders/ExpressionHelpers.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/builders/ExpressionHelpers.kt index db3576d802a..e23273b4941 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/builders/ExpressionHelpers.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/builders/ExpressionHelpers.kt @@ -30,13 +30,13 @@ import org.jetbrains.kotlin.types.KotlinType inline fun IrBuilderWithScope.irLet( value: IrExpression, - operator: IrOperator? = null, + origin: IrStatementOrigin? = null, nameHint: String? = null, body: (VariableDescriptor) -> IrExpression ): IrExpression { val irTemporary = scope.createTemporaryVariable(value, nameHint) val irResult = body(irTemporary.descriptor) - val irBlock = IrBlockImpl(startOffset, endOffset, irResult.type, operator) + val irBlock = IrBlockImpl(startOffset, endOffset, irResult.type, origin) irBlock.addStatement(irTemporary) irBlock.addStatement(irResult) return irBlock @@ -63,8 +63,8 @@ fun IrBuilderWithScope.irIfThenElse(type: KotlinType, condition: IrExpression, t fun IrBuilderWithScope.irIfNull(type: KotlinType, subject: IrExpression, thenPart: IrExpression, elsePart: IrExpression) = irIfThenElse(type, irEqualsNull(subject), thenPart, elsePart) -fun IrBuilderWithScope.irThrowNpe(operator: IrOperator) = - IrNullaryPrimitiveImpl(startOffset, endOffset, operator, context.irBuiltIns.throwNpe) +fun IrBuilderWithScope.irThrowNpe(origin: IrStatementOrigin) = + IrNullaryPrimitiveImpl(startOffset, endOffset, origin, context.irBuiltIns.throwNpe) fun IrBuilderWithScope.irIfThenReturnTrue(condition: IrExpression) = IrIfThenElseImpl(startOffset, endOffset, context.builtIns.unitType, condition, irReturnTrue()) @@ -81,7 +81,7 @@ fun IrBuilderWithScope.irGet(variable: VariableDescriptor) = IrGetVariableImpl(startOffset, endOffset, variable) fun IrBuilderWithScope.irSetVar(variable: VariableDescriptor, value: IrExpression) = - IrSetVariableImpl(startOffset, endOffset, variable, value, IrOperator.EQ) + IrSetVariableImpl(startOffset, endOffset, variable, value, IrStatementOrigin.EQ) fun IrBuilderWithScope.irOther() = irGet(scope.functionOwner().valueParameters.single()) @@ -93,16 +93,16 @@ fun IrBuilderWithScope.irNull() = IrConstImpl.constNull(startOffset, endOffset, context.builtIns.nullableNothingType) fun IrBuilderWithScope.irEqualsNull(argument: IrExpression) = - primitiveOp2(startOffset, endOffset, context.irBuiltIns.eqeq, IrOperator.EQEQ, + primitiveOp2(startOffset, endOffset, context.irBuiltIns.eqeq, IrStatementOrigin.EQEQ, argument, irNull()) fun IrBuilderWithScope.irNotEquals(arg1: IrExpression, arg2: IrExpression) = - primitiveOp1(startOffset, endOffset, context.irBuiltIns.booleanNot, IrOperator.EXCLEQ, - primitiveOp2(startOffset, endOffset, context.irBuiltIns.eqeq, IrOperator.EXCLEQ, + primitiveOp1(startOffset, endOffset, context.irBuiltIns.booleanNot, IrStatementOrigin.EXCLEQ, + primitiveOp2(startOffset, endOffset, context.irBuiltIns.eqeq, IrStatementOrigin.EXCLEQ, arg1, arg2)) fun IrBuilderWithScope.irGet(receiver: IrExpression, property: PropertyDescriptor): IrExpression = - IrGetterCallImpl(startOffset, endOffset, property.getter!!, receiver, null, IrOperator.GET_PROPERTY) + IrGetterCallImpl(startOffset, endOffset, property.getter!!, receiver, null, IrStatementOrigin.GET_PROPERTY) fun IrBuilderWithScope.irCall(callee: CallableDescriptor) = IrCallImpl(startOffset, endOffset, callee.returnType!!, callee) diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/builders/IrBuilder.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/builders/IrBuilder.kt index f3b7d074d67..60cec914c87 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/builders/IrBuilder.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/builders/IrBuilder.kt @@ -83,11 +83,9 @@ open class IrBlockBodyBuilder( } class IrBlockBuilder( - context: GeneratorContext, - scope: Scope, - startOffset: Int, - endOffset: Int, - val operator: IrOperator? = null, + context: GeneratorContext, scope: Scope, + startOffset: Int, endOffset: Int, + val origin: IrStatementOrigin? = null, var resultType: KotlinType? = null ) : IrStatementsBuilder(context, scope, startOffset, endOffset) { private val statements = ArrayList() @@ -105,7 +103,7 @@ class IrBlockBuilder( val resultType = this.resultType ?: (statements.lastOrNull() as? IrExpression)?.type ?: context.builtIns.unitType - val irBlock = IrBlockImpl(startOffset, endOffset, resultType, operator) + val irBlock = IrBlockImpl(startOffset, endOffset, resultType, origin) irBlock.addAll(statements) return irBlock } @@ -123,13 +121,13 @@ fun T.at(psiElement: PsiElement): T { return this } -inline fun GeneratorWithScope.irBlock(ktElement: KtElement? = null, operator: IrOperator? = null, resultType: KotlinType? = null, +inline fun GeneratorWithScope.irBlock(ktElement: KtElement? = null, origin: IrStatementOrigin? = null, resultType: KotlinType? = null, body: IrBlockBuilder.() -> Unit ): IrExpression = IrBlockBuilder(context, scope, ktElement?.startOffset ?: UNDEFINED_OFFSET, ktElement?.endOffset ?: UNDEFINED_OFFSET, - operator, resultType + origin, resultType ).block(body) inline fun GeneratorWithScope.irBlockBody(ktElement: KtElement? = null, body: IrBlockBodyBuilder.() -> Unit) : IrBlockBody = diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/AssignmentGenerator.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/AssignmentGenerator.kt index 49e6663888f..4169fe23df2 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/AssignmentGenerator.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/AssignmentGenerator.kt @@ -20,7 +20,7 @@ import org.jetbrains.kotlin.descriptors.* import org.jetbrains.kotlin.descriptors.impl.LocalVariableDescriptor import org.jetbrains.kotlin.descriptors.impl.SyntheticFieldDescriptor import org.jetbrains.kotlin.ir.expressions.IrExpression -import org.jetbrains.kotlin.ir.expressions.IrOperator +import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin import org.jetbrains.kotlin.ir.expressions.impl.IrThisReferenceImpl import org.jetbrains.kotlin.psi.* import org.jetbrains.kotlin.psi.psiUtil.endOffset @@ -38,22 +38,22 @@ class AssignmentGenerator(statementGenerator: StatementGenerator) : StatementGen fun generateAssignment(expression: KtBinaryExpression): IrExpression { val ktLeft = expression.left!! val irRhs = statementGenerator.generateExpression(expression.right!!) - val irAssignmentReceiver = generateAssignmentReceiver(ktLeft, IrOperator.EQ) + val irAssignmentReceiver = generateAssignmentReceiver(ktLeft, IrStatementOrigin.EQ) return irAssignmentReceiver.assign(irRhs) } - fun generateAugmentedAssignment(expression: KtBinaryExpression, irOperator: IrOperator): IrExpression { + fun generateAugmentedAssignment(expression: KtBinaryExpression, origin: IrStatementOrigin): IrExpression { val opResolvedCall = getResolvedCall(expression)!! val isSimpleAssignment = get(BindingContext.VARIABLE_REASSIGNMENT, expression) ?: false val ktLeft = expression.left!! val ktRight = expression.right!! - val irAssignmentReceiver = generateAssignmentReceiver(ktLeft, irOperator) + val irAssignmentReceiver = generateAssignmentReceiver(ktLeft, origin) return irAssignmentReceiver.assign { irLValue -> val opCall = statementGenerator.pregenerateCall(opResolvedCall) opCall.setExplicitReceiverValue(irLValue) opCall.irValueArgumentsByIndex[0] = statementGenerator.generateExpression(ktRight) - val irOpCall = CallGenerator(statementGenerator).generateCall(expression, opCall, irOperator) + val irOpCall = CallGenerator(statementGenerator).generateCall(expression, opCall, origin) if (isSimpleAssignment) { // Set( Op( Get(), RHS ) ) @@ -66,16 +66,16 @@ class AssignmentGenerator(statementGenerator: StatementGenerator) : StatementGen } } - fun generatePrefixIncrementDecrement(expression: KtPrefixExpression, irOperator: IrOperator): IrExpression { + fun generatePrefixIncrementDecrement(expression: KtPrefixExpression, origin: IrStatementOrigin): IrExpression { val opResolvedCall = getResolvedCall(expression)!! val ktBaseExpression = expression.baseExpression!! - val irAssignmentReceiver = generateAssignmentReceiver(ktBaseExpression, irOperator) + val irAssignmentReceiver = generateAssignmentReceiver(ktBaseExpression, origin) return irAssignmentReceiver.assign { irLValue -> - irBlock(expression, irOperator, irLValue.type) { + irBlock(expression, origin, irLValue.type) { val opCall = statementGenerator.pregenerateCall(opResolvedCall) opCall.setExplicitReceiverValue(irLValue) - val irOpCall = CallGenerator(statementGenerator).generateCall(expression, opCall, irOperator) + val irOpCall = CallGenerator(statementGenerator).generateCall(expression, opCall, origin) val temporary = defineTemporary(irOpCall) +irLValue.store(irGet(temporary)) +irGet(temporary) @@ -83,26 +83,26 @@ class AssignmentGenerator(statementGenerator: StatementGenerator) : StatementGen } } - fun generatePostfixIncrementDecrement(expression: KtPostfixExpression, irOperator: IrOperator): IrExpression { + fun generatePostfixIncrementDecrement(expression: KtPostfixExpression, origin: IrStatementOrigin): IrExpression { val opResolvedCall = getResolvedCall(expression)!! val ktBaseExpression = expression.baseExpression!! - val irAssignmentReceiver = generateAssignmentReceiver(ktBaseExpression, irOperator) + val irAssignmentReceiver = generateAssignmentReceiver(ktBaseExpression, origin) return irAssignmentReceiver.assign { irLValue -> - irBlock(expression, irOperator, irLValue.type) { + irBlock(expression, origin, irLValue.type) { val temporary = defineTemporary(irLValue.load()) val opCall = statementGenerator.pregenerateCall(opResolvedCall) opCall.setExplicitReceiverValue(VariableLValue(startOffset, endOffset, temporary)) - val irOpCall = CallGenerator(statementGenerator).generateCall(expression, opCall, irOperator) + val irOpCall = CallGenerator(statementGenerator).generateCall(expression, opCall, origin) +irLValue.store(irOpCall) +irGet(temporary) } } } - fun generateAssignmentReceiver(ktLeft: KtExpression, operator: IrOperator): AssignmentReceiver { + fun generateAssignmentReceiver(ktLeft: KtExpression, origin: IrStatementOrigin): AssignmentReceiver { if (ktLeft is KtArrayAccessExpression) { - return generateArrayAccessAssignmentReceiver(ktLeft, operator) + return generateArrayAccessAssignmentReceiver(ktLeft, origin) } val resolvedCall = getResolvedCall(ktLeft) ?: TODO("no resolved call for LHS") @@ -114,18 +114,18 @@ class AssignmentGenerator(statementGenerator: StatementGenerator) : StatementGen statementGenerator.generateReceiver(ktLeft, it) } BackingFieldLValue(ktLeft.startOffset, ktLeft.endOffset, descriptor.propertyDescriptor, - receiverValue, operator) + receiverValue, origin) } is LocalVariableDescriptor -> if (descriptor.isDelegated) - DelegatedLocalPropertyLValue(ktLeft.startOffset, ktLeft.endOffset, descriptor, operator) + DelegatedLocalPropertyLValue(ktLeft.startOffset, ktLeft.endOffset, descriptor, origin) else - VariableLValue(ktLeft.startOffset, ktLeft.endOffset, descriptor, operator) + VariableLValue(ktLeft.startOffset, ktLeft.endOffset, descriptor, origin) is PropertyDescriptor -> - generateAssignmentReceiverForProperty(descriptor, operator, ktLeft, resolvedCall) + generateAssignmentReceiverForProperty(descriptor, origin, ktLeft, resolvedCall) is VariableDescriptor -> - VariableLValue(ktLeft.startOffset, ktLeft.endOffset, descriptor, operator) + VariableLValue(ktLeft.startOffset, ktLeft.endOffset, descriptor, origin) else -> OnceExpressionValue(statementGenerator.generateExpression(ktLeft)) } @@ -133,7 +133,7 @@ class AssignmentGenerator(statementGenerator: StatementGenerator) : StatementGen private fun generateAssignmentReceiverForProperty( descriptor: PropertyDescriptor, - irOperator: IrOperator, + origin: IrStatementOrigin, ktLeft: KtExpression, resolvedCall: ResolvedCall<*> ): AssignmentReceiver { @@ -149,7 +149,7 @@ class AssignmentGenerator(statementGenerator: StatementGenerator) : StatementGen val superQualifier = getSuperQualifier(resolvedCall) - return SimplePropertyLValue(context, scope, ktLeft.startOffset, ktLeft.endOffset, irOperator, descriptor, + return SimplePropertyLValue(context, scope, ktLeft.startOffset, ktLeft.endOffset, origin, descriptor, propertyReceiver, superQualifier) } @@ -167,7 +167,7 @@ class AssignmentGenerator(statementGenerator: StatementGenerator) : StatementGen } } - private fun generateArrayAccessAssignmentReceiver(ktLeft: KtArrayAccessExpression, irOperator: IrOperator): ArrayAccessAssignmentReceiver { + private fun generateArrayAccessAssignmentReceiver(ktLeft: KtArrayAccessExpression, origin: IrStatementOrigin): ArrayAccessAssignmentReceiver { val irArray = statementGenerator.generateExpression(ktLeft.arrayExpression!!) val irIndexExpressions = ktLeft.indexExpressions.map { statementGenerator.generateExpression(it) } @@ -179,7 +179,7 @@ class AssignmentGenerator(statementGenerator: StatementGenerator) : StatementGen return ArrayAccessAssignmentReceiver(irArray, irIndexExpressions, indexedGetCall, indexedSetCall, CallGenerator(statementGenerator), - ktLeft.startOffset, ktLeft.endOffset, irOperator) + ktLeft.startOffset, ktLeft.endOffset, origin) } } diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/BranchingExpressionGenerator.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/BranchingExpressionGenerator.kt index 1b8b4dddfb0..0ba9b03b193 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/BranchingExpressionGenerator.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/BranchingExpressionGenerator.kt @@ -55,10 +55,10 @@ class BranchingExpressionGenerator(statementGenerator: StatementGenerator) : Sta return if (irBranches.size == 1) { val (irCondition, irThenBranch) = irBranches[0] IrIfThenElseImpl(expression.startOffset, expression.endOffset, resultType, - irCondition, irThenBranch, irElseBranch, IrOperator.IF) + irCondition, irThenBranch, irElseBranch, IrStatementOrigin.IF) } else { - val irWhen = IrWhenImpl(expression.startOffset, expression.endOffset, resultType, IrOperator.WHEN) + val irWhen = IrWhenImpl(expression.startOffset, expression.endOffset, resultType, IrStatementOrigin.WHEN) for ((irCondition, irThenBranch) in irBranches) { irWhen.addBranch(irCondition, irThenBranch) } @@ -74,7 +74,7 @@ class BranchingExpressionGenerator(statementGenerator: StatementGenerator) : Sta val resultType = getInferredTypeWithImplicitCastsOrFail(expression) - val irWhen = IrWhenImpl(expression.startOffset, expression.endOffset, resultType, IrOperator.WHEN) + val irWhen = IrWhenImpl(expression.startOffset, expression.endOffset, resultType, IrStatementOrigin.WHEN) for (ktEntry in expression.entries) { if (ktEntry.isElse) { @@ -103,18 +103,18 @@ class BranchingExpressionGenerator(statementGenerator: StatementGenerator) : Sta private fun generateWhenBody(expression: KtWhenExpression, irSubject: IrVariable?, irWhen: IrWhen): IrExpression { if (irSubject == null) { if (irWhen.branchesCount == 0 && irWhen.elseBranch == null) - return IrBlockImpl(expression.startOffset, expression.endOffset, context.builtIns.unitType, IrOperator.WHEN) + return IrBlockImpl(expression.startOffset, expression.endOffset, context.builtIns.unitType, IrStatementOrigin.WHEN) else return irWhen } else { if (irWhen.branchesCount == 0) { - val irBlock = IrBlockImpl(expression.startOffset, expression.endOffset, context.builtIns.unitType, IrOperator.WHEN) + val irBlock = IrBlockImpl(expression.startOffset, expression.endOffset, context.builtIns.unitType, IrStatementOrigin.WHEN) irBlock.addStatement(irSubject) return irBlock } else { - val irBlock = IrBlockImpl(expression.startOffset, expression.endOffset, irWhen.type, IrOperator.WHEN) + val irBlock = IrBlockImpl(expression.startOffset, expression.endOffset, irWhen.type, IrStatementOrigin.WHEN) irBlock.addStatement(irSubject) irBlock.addStatement(irWhen) return irBlock @@ -152,9 +152,9 @@ class BranchingExpressionGenerator(statementGenerator: StatementGenerator) : Sta val inOperator = getInfixOperator(ktCondition.operationReference.getReferencedNameElementType()) val irInCall = CallGenerator(statementGenerator).generateCall(ktCondition, inCall, inOperator) return when (inOperator) { - IrOperator.IN -> irInCall - IrOperator.NOT_IN -> - IrUnaryPrimitiveImpl(ktCondition.startOffset, ktCondition.endOffset, IrOperator.EXCL, context.irBuiltIns.booleanNot, irInCall) + IrStatementOrigin.IN -> irInCall + IrStatementOrigin.NOT_IN -> + IrUnaryPrimitiveImpl(ktCondition.startOffset, ktCondition.endOffset, IrStatementOrigin.EXCL, context.irBuiltIns.booleanNot, irInCall) else -> throw AssertionError("Expected 'in' or '!in', got $inOperator") } } @@ -162,7 +162,7 @@ class BranchingExpressionGenerator(statementGenerator: StatementGenerator) : Sta private fun generateEqualsCondition(irSubject: IrVariable, ktCondition: KtWhenConditionWithExpression): IrBinaryPrimitiveImpl = IrBinaryPrimitiveImpl( ktCondition.startOffset, ktCondition.endOffset, - IrOperator.EQEQ, context.irBuiltIns.eqeq, + IrStatementOrigin.EQEQ, context.irBuiltIns.eqeq, irSubject.defaultLoad(), statementGenerator.generateExpression(ktCondition.expression!!) ) } \ No newline at end of file diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/CallGenerator.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/CallGenerator.kt index 1b01f014099..b9c939a8029 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/CallGenerator.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/CallGenerator.kt @@ -29,7 +29,7 @@ import org.jetbrains.kotlin.types.KotlinType import java.util.* class CallGenerator(statementGenerator: StatementGenerator): StatementGeneratorExtension(statementGenerator) { - fun generateCall(startOffset: Int, endOffset: Int, call: CallBuilder, operator: IrOperator? = null): IrExpression { + fun generateCall(startOffset: Int, endOffset: Int, call: CallBuilder, origin: IrStatementOrigin? = null): IrExpression { val descriptor = call.descriptor return when (descriptor) { @@ -37,20 +37,20 @@ class CallGenerator(statementGenerator: StatementGenerator): StatementGeneratorE generatePropertyGetterCall(descriptor, startOffset, endOffset, call) is VariableDescriptor -> call.callReceiver.call { dispatchReceiverValue, extensionReceiverValue -> - generateGetVariable(startOffset, endOffset, descriptor, operator) + generateGetVariable(startOffset, endOffset, descriptor, origin) } is FunctionDescriptor -> - generateFunctionCall(descriptor, startOffset, endOffset, operator, call) + generateFunctionCall(descriptor, startOffset, endOffset, origin, call) else -> TODO("Unexpected callable descriptor: $descriptor ${descriptor.javaClass.simpleName}") } } - fun generateGetVariable(startOffset: Int, endOffset: Int, descriptor: VariableDescriptor, operator: IrOperator? = null) = + fun generateGetVariable(startOffset: Int, endOffset: Int, descriptor: VariableDescriptor, origin: IrStatementOrigin? = null) = if (descriptor is LocalVariableDescriptor && descriptor.isDelegated) - IrCallImpl(startOffset, endOffset, descriptor.type, descriptor.getter!!, operator ?: IrOperator.GET_LOCAL_PROPERTY) + IrCallImpl(startOffset, endOffset, descriptor.type, descriptor.getter!!, origin ?: IrStatementOrigin.GET_LOCAL_PROPERTY) else - IrGetVariableImpl(startOffset, endOffset, descriptor, operator) + IrGetVariableImpl(startOffset, endOffset, descriptor, origin) fun generateDelegatingConstructorCall(startOffset: Int, endOffset: Int, call: CallBuilder) : IrExpression { val descriptor = call.descriptor @@ -90,11 +90,11 @@ class CallGenerator(statementGenerator: StatementGenerator): StatementGeneratorE IrGetterCallImpl(startOffset, endOffset, getter, dispatchReceiverValue?.load(), extensionReceiverValue?.load(), - IrOperator.GET_PROPERTY, + IrStatementOrigin.GET_PROPERTY, call.superQualifier) } ?: IrGetFieldImpl(startOffset, endOffset, descriptor, dispatchReceiverValue?.load(), - IrOperator.GET_PROPERTY, call.superQualifier) + IrStatementOrigin.GET_PROPERTY, call.superQualifier) } } @@ -102,13 +102,13 @@ class CallGenerator(statementGenerator: StatementGenerator): StatementGeneratorE descriptor: FunctionDescriptor, startOffset: Int, endOffset: Int, - operator: IrOperator?, + origin: IrStatementOrigin?, call: CallBuilder ): IrExpression { val returnType = descriptor.returnType!! return call.callReceiver.call { dispatchReceiverValue, extensionReceiverValue -> - val irCall = IrCallImpl(startOffset, endOffset, returnType, descriptor, operator, call.superQualifier) + val irCall = IrCallImpl(startOffset, endOffset, returnType, descriptor, origin, call.superQualifier) irCall.dispatchReceiver = dispatchReceiverValue?.load() irCall.extensionReceiver = extensionReceiverValue?.load() @@ -140,7 +140,7 @@ class CallGenerator(statementGenerator: StatementGenerator): StatementGeneratorE val valueArgumentsInEvaluationOrder = resolvedCall.valueArguments.values val valueParameters = resolvedCall.resultingDescriptor.valueParameters - val irBlock = IrBlockImpl(startOffset, endOffset, resultType, IrOperator.ARGUMENTS_REORDERING_FOR_CALL) + val irBlock = IrBlockImpl(startOffset, endOffset, resultType, IrStatementOrigin.ARGUMENTS_REORDERING_FOR_CALL) val valueArgumentsToValueParameters = HashMap() for ((index, valueArgument) in resolvedCall.valueArgumentsByIndex!!.withIndex()) { @@ -168,8 +168,8 @@ class CallGenerator(statementGenerator: StatementGenerator): StatementGeneratorE } } -fun CallGenerator.generateCall(ktElement: KtElement, call: CallBuilder, operator: IrOperator? = null) = - generateCall(ktElement.startOffset, ktElement.endOffset, call, operator) +fun CallGenerator.generateCall(ktElement: KtElement, call: CallBuilder, origin: IrStatementOrigin? = null) = + generateCall(ktElement.startOffset, ktElement.endOffset, call, origin) -fun CallGenerator.generateCall(irExpression: IrExpression, call: CallBuilder, operator: IrOperator? = null) = - generateCall(irExpression.startOffset, irExpression.endOffset, call, operator) +fun CallGenerator.generateCall(irExpression: IrExpression, call: CallBuilder, origin: IrStatementOrigin? = null) = + generateCall(irExpression.startOffset, irExpression.endOffset, call, origin) diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/ClassGenerator.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/ClassGenerator.kt index 8fe3052d301..13213bd5871 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/ClassGenerator.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/ClassGenerator.kt @@ -197,7 +197,7 @@ class ClassGenerator(val declarationGenerator: DeclarationGenerator) : Generator val primaryConstructorDescriptor = classDescriptor.unsubstitutedPrimaryConstructor ?: return val irPrimaryConstructor = IrConstructorImpl(ktClassOrObject.startOffset, ktClassOrObject.endOffset, IrDeclarationOrigin.DEFINED, - primaryConstructorDescriptor) + primaryConstructorDescriptor) val bodyGenerator = BodyGenerator(primaryConstructorDescriptor, context) ktClassOrObject.getPrimaryConstructor()?.valueParameterList?.let { ktValueParameterList -> diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/DeclarationGenerator.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/DeclarationGenerator.kt index 31b65148428..ece5732786c 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/DeclarationGenerator.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/DeclarationGenerator.kt @@ -66,11 +66,11 @@ class DeclarationGenerator(override val context: GeneratorContext) : Generator { fun generateTypeAliasDeclaration(ktDeclaration: KtTypeAlias): IrDeclaration = IrTypeAliasImpl(ktDeclaration.startOffset, ktDeclaration.endOffset, IrDeclarationOrigin.DEFINED, - getOrFail(BindingContext.TYPE_ALIAS, ktDeclaration)) + getOrFail(BindingContext.TYPE_ALIAS, ktDeclaration)) fun generateAnonymousInitializerDeclaration(ktAnonymousInitializer: KtAnonymousInitializer, classDescriptor: ClassDescriptor): IrDeclaration { val irAnonymousInitializer = IrAnonymousInitializerImpl(ktAnonymousInitializer.startOffset, ktAnonymousInitializer.endOffset, - IrDeclarationOrigin.DEFINED, classDescriptor) + IrDeclarationOrigin.DEFINED, classDescriptor) irAnonymousInitializer.body = BodyGenerator(classDescriptor, context).generateAnonymousInitializerBody(ktAnonymousInitializer) return irAnonymousInitializer } diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/DelegatedPropertyGenerator.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/DelegatedPropertyGenerator.kt index bc62c1b95cb..edf781bf1b9 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/DelegatedPropertyGenerator.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/DelegatedPropertyGenerator.kt @@ -89,7 +89,7 @@ class DelegatedPropertyGenerator(override val context: GeneratorContext) : Gener private fun createCallableReference(ktElement: KtElement, type: KotlinType, referencedDescriptor: CallableDescriptor): IrCallableReference = IrCallableReferenceImpl(ktElement.startOffset, ktElement.endOffset, type, - referencedDescriptor, IrOperator.PROPERTY_REFERENCE_FOR_DELEGATE) + referencedDescriptor, IrStatementOrigin.PROPERTY_REFERENCE_FOR_DELEGATE) fun generateLocalDelegatedProperty( ktProperty: KtProperty, diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/LocalClassGenerator.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/LocalClassGenerator.kt index 4b77c63b6f8..3b7dbd23b2a 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/LocalClassGenerator.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/LocalClassGenerator.kt @@ -19,7 +19,7 @@ package org.jetbrains.kotlin.psi2ir.generators import org.jetbrains.kotlin.ir.IrStatement import org.jetbrains.kotlin.ir.expressions.impl.IrBlockImpl import org.jetbrains.kotlin.ir.expressions.impl.IrCallImpl -import org.jetbrains.kotlin.ir.expressions.IrOperator +import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin import org.jetbrains.kotlin.psi.KtClassOrObject import org.jetbrains.kotlin.psi.KtObjectLiteralExpression import org.jetbrains.kotlin.psi.psiUtil.endOffset @@ -28,7 +28,7 @@ import org.jetbrains.kotlin.psi.psiUtil.startOffset class LocalClassGenerator(statementGenerator: StatementGenerator): StatementGeneratorExtension(statementGenerator) { fun generateObjectLiteral(ktObjectLiteral: KtObjectLiteralExpression): IrStatement { val objectLiteralType = getInferredTypeWithImplicitCastsOrFail(ktObjectLiteral) - val irBlock = IrBlockImpl(ktObjectLiteral.startOffset, ktObjectLiteral.endOffset, objectLiteralType, IrOperator.OBJECT_LITERAL) + val irBlock = IrBlockImpl(ktObjectLiteral.startOffset, ktObjectLiteral.endOffset, objectLiteralType, IrStatementOrigin.OBJECT_LITERAL) val irClass = DeclarationGenerator(statementGenerator.context).generateClassOrObjectDeclaration(ktObjectLiteral.objectDeclaration) irBlock.addStatement(irClass) @@ -46,7 +46,7 @@ class LocalClassGenerator(statementGenerator: StatementGenerator): StatementGene } irBlock.addStatement(IrCallImpl(ktObjectLiteral.startOffset, ktObjectLiteral.endOffset, objectLiteralType, - objectConstructor, IrOperator.OBJECT_LITERAL)) + objectConstructor, IrStatementOrigin.OBJECT_LITERAL)) return irBlock } diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/LocalFunctionGenerator.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/LocalFunctionGenerator.kt index 28b49ba1bf3..56d04d2a3ff 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/LocalFunctionGenerator.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/LocalFunctionGenerator.kt @@ -22,7 +22,7 @@ import org.jetbrains.kotlin.ir.declarations.IrFunction import org.jetbrains.kotlin.ir.declarations.impl.IrFunctionImpl import org.jetbrains.kotlin.ir.expressions.impl.IrBlockImpl import org.jetbrains.kotlin.ir.expressions.impl.IrCallableReferenceImpl -import org.jetbrains.kotlin.ir.expressions.IrOperator +import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin import org.jetbrains.kotlin.psi.KtLambdaExpression import org.jetbrains.kotlin.psi.KtNamedFunction import org.jetbrains.kotlin.psi.psiUtil.endOffset @@ -34,14 +34,14 @@ class LocalFunctionGenerator(statementGenerator: StatementGenerator) : Statement val ktFun = ktLambda.functionLiteral val lambdaExpressionType = getInferredTypeWithImplicitCastsOrFail(ktLambda) val lambdaDescriptor = getOrFail(BindingContext.FUNCTION, ktFun) - val irBlock = IrBlockImpl(ktLambda.startOffset, ktLambda.endOffset, lambdaExpressionType, IrOperator.LAMBDA) + val irBlock = IrBlockImpl(ktLambda.startOffset, ktLambda.endOffset, lambdaExpressionType, IrStatementOrigin.LAMBDA) val irFun = IrFunctionImpl(ktFun.startOffset, ktFun.endOffset, IrDeclarationOrigin.LOCAL_FUNCTION_FOR_LAMBDA, lambdaDescriptor) irFun.body = BodyGenerator(lambdaDescriptor, statementGenerator.context).generateLambdaBody(ktFun) irBlock.addStatement(irFun) irBlock.addStatement(IrCallableReferenceImpl(ktLambda.startOffset, ktLambda.endOffset, lambdaExpressionType, - lambdaDescriptor, IrOperator.LAMBDA)) + lambdaDescriptor, IrStatementOrigin.LAMBDA)) return irBlock } @@ -53,13 +53,13 @@ class LocalFunctionGenerator(statementGenerator: StatementGenerator) : Statement else { // anonymous function expression val funExpressionType = getInferredTypeWithImplicitCastsOrFail(ktFun) - val irBlock = IrBlockImpl(ktFun.startOffset, ktFun.endOffset, funExpressionType, IrOperator.ANONYMOUS_FUNCTION) + val irBlock = IrBlockImpl(ktFun.startOffset, ktFun.endOffset, funExpressionType, IrStatementOrigin.ANONYMOUS_FUNCTION) val irFun = generateFunctionDeclaration(ktFun) irBlock.addStatement(irFun) irBlock.addStatement(IrCallableReferenceImpl(ktFun.startOffset, ktFun.endOffset, funExpressionType, - irFun.descriptor, IrOperator.ANONYMOUS_FUNCTION)) + irFun.descriptor, IrStatementOrigin.ANONYMOUS_FUNCTION)) irBlock } diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/LoopExpressionGenerator.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/LoopExpressionGenerator.kt index 59f2e04b5f7..9c280bd33bf 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/LoopExpressionGenerator.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/LoopExpressionGenerator.kt @@ -32,12 +32,12 @@ class LoopExpressionGenerator(statementGenerator: StatementGenerator) : Statemen fun generateWhileLoop(ktWhile: KtWhileExpression): IrExpression = generateConditionalLoop(ktWhile, IrWhileLoopImpl(ktWhile.startOffset, ktWhile.endOffset, - context.builtIns.unitType, IrOperator.WHILE_LOOP)) + context.builtIns.unitType, IrStatementOrigin.WHILE_LOOP)) fun generateDoWhileLoop(ktDoWhile: KtDoWhileExpression): IrExpression = generateConditionalLoop(ktDoWhile, IrDoWhileLoopImpl(ktDoWhile.startOffset, ktDoWhile.endOffset, - context.builtIns.unitType, IrOperator.DO_WHILE_LOOP)) + context.builtIns.unitType, IrStatementOrigin.DO_WHILE_LOOP)) private fun generateConditionalLoop(ktLoop: KtWhileExpressionBase, irLoop: IrLoopBase): IrLoop { irLoop.condition = statementGenerator.generateExpression(ktLoop.condition!!) @@ -113,34 +113,34 @@ class LoopExpressionGenerator(statementGenerator: StatementGenerator) : Statemen val callGenerator = CallGenerator(statementGenerator) - val irForBlock = IrBlockImpl(ktFor.startOffset, ktFor.endOffset, context.builtIns.unitType, IrOperator.FOR_LOOP) + val irForBlock = IrBlockImpl(ktFor.startOffset, ktFor.endOffset, context.builtIns.unitType, IrStatementOrigin.FOR_LOOP) val iteratorCall = statementGenerator.pregenerateCall(iteratorResolvedCall) - val irIteratorCall = callGenerator.generateCall(ktLoopRange, iteratorCall, IrOperator.FOR_LOOP_ITERATOR) + val irIteratorCall = callGenerator.generateCall(ktLoopRange, iteratorCall, IrStatementOrigin.FOR_LOOP_ITERATOR) val irIterator = scope.createTemporaryVariable(irIteratorCall, "iterator") val iteratorValue = VariableLValue(irIterator) irForBlock.addStatement(irIterator) - val irInnerWhile = IrWhileLoopImpl(ktFor.startOffset, ktFor.endOffset, context.builtIns.unitType, IrOperator.FOR_LOOP_INNER_WHILE) + val irInnerWhile = IrWhileLoopImpl(ktFor.startOffset, ktFor.endOffset, context.builtIns.unitType, IrStatementOrigin.FOR_LOOP_INNER_WHILE) irInnerWhile.label = getLoopLabel(ktFor) statementGenerator.bodyGenerator.putLoop(ktFor, irInnerWhile) irForBlock.addStatement(irInnerWhile) val hasNextCall = statementGenerator.pregenerateCall(hasNextResolvedCall) hasNextCall.setExplicitReceiverValue(iteratorValue) - val irHasNextCall = callGenerator.generateCall(ktLoopRange, hasNextCall, IrOperator.FOR_LOOP_HAS_NEXT) + val irHasNextCall = callGenerator.generateCall(ktLoopRange, hasNextCall, IrStatementOrigin.FOR_LOOP_HAS_NEXT) irInnerWhile.condition = irHasNextCall - val irInnerBody = IrBlockImpl(ktFor.startOffset, ktFor.endOffset, context.builtIns.unitType, IrOperator.FOR_LOOP_INNER_WHILE) + val irInnerBody = IrBlockImpl(ktFor.startOffset, ktFor.endOffset, context.builtIns.unitType, IrStatementOrigin.FOR_LOOP_INNER_WHILE) irInnerWhile.body = irInnerBody val nextCall = statementGenerator.pregenerateCall(nextResolvedCall) nextCall.setExplicitReceiverValue(iteratorValue) - val irNextCall = callGenerator.generateCall(ktLoopRange, nextCall, IrOperator.FOR_LOOP_NEXT) + val irNextCall = callGenerator.generateCall(ktLoopRange, nextCall, IrStatementOrigin.FOR_LOOP_NEXT) val irLoopParameter = if (ktLoopParameter != null) { val loopParameterDescriptor = getOrFail(BindingContext.VALUE_PARAMETER, ktLoopParameter) IrVariableImpl(ktLoopParameter.startOffset, ktLoopParameter.endOffset, IrDeclarationOrigin.DEFINED, - loopParameterDescriptor, irNextCall) + loopParameterDescriptor, irNextCall) } else { scope.createTemporaryVariable(irNextCall, "loop_parameter") diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/OperatorConventions.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/OperatorConventions.kt index 13366e979d4..7566b5b7910 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/OperatorConventions.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/OperatorConventions.kt @@ -17,56 +17,56 @@ package org.jetbrains.kotlin.psi2ir.generators import com.intellij.psi.tree.IElementType -import org.jetbrains.kotlin.ir.expressions.IrOperator +import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin import org.jetbrains.kotlin.ir.expressions.IrTypeOperator import org.jetbrains.kotlin.lexer.KtTokens -fun getInfixOperator(ktOperator: IElementType): IrOperator? = +fun getInfixOperator(ktOperator: IElementType): IrStatementOrigin? = when (ktOperator) { - KtTokens.EQ -> IrOperator.EQ - KtTokens.PLUSEQ -> IrOperator.PLUSEQ - KtTokens.MINUSEQ -> IrOperator.MINUSEQ - KtTokens.MULTEQ -> IrOperator.MULTEQ - KtTokens.DIVEQ -> IrOperator.DIVEQ - KtTokens.PERCEQ -> IrOperator.PERCEQ - KtTokens.PLUS -> IrOperator.PLUS - KtTokens.MINUS -> IrOperator.MINUS - KtTokens.MUL -> IrOperator.MUL - KtTokens.DIV -> IrOperator.DIV - KtTokens.PERC -> IrOperator.PERC - KtTokens.RANGE -> IrOperator.RANGE - KtTokens.LT -> IrOperator.LT - KtTokens.LTEQ -> IrOperator.LTEQ - KtTokens.GT -> IrOperator.GT - KtTokens.GTEQ -> IrOperator.GTEQ - KtTokens.EQEQ -> IrOperator.EQEQ - KtTokens.EXCLEQ -> IrOperator.EXCLEQ - KtTokens.EQEQEQ -> IrOperator.EQEQEQ - KtTokens.EXCLEQEQEQ -> IrOperator.EXCLEQEQ - KtTokens.IN_KEYWORD -> IrOperator.IN - KtTokens.NOT_IN -> IrOperator.NOT_IN - KtTokens.ANDAND -> IrOperator.ANDAND - KtTokens.OROR -> IrOperator.OROR - KtTokens.ELVIS -> IrOperator.ELVIS + KtTokens.EQ -> IrStatementOrigin.EQ + KtTokens.PLUSEQ -> IrStatementOrigin.PLUSEQ + KtTokens.MINUSEQ -> IrStatementOrigin.MINUSEQ + KtTokens.MULTEQ -> IrStatementOrigin.MULTEQ + KtTokens.DIVEQ -> IrStatementOrigin.DIVEQ + KtTokens.PERCEQ -> IrStatementOrigin.PERCEQ + KtTokens.PLUS -> IrStatementOrigin.PLUS + KtTokens.MINUS -> IrStatementOrigin.MINUS + KtTokens.MUL -> IrStatementOrigin.MUL + KtTokens.DIV -> IrStatementOrigin.DIV + KtTokens.PERC -> IrStatementOrigin.PERC + KtTokens.RANGE -> IrStatementOrigin.RANGE + KtTokens.LT -> IrStatementOrigin.LT + KtTokens.LTEQ -> IrStatementOrigin.LTEQ + KtTokens.GT -> IrStatementOrigin.GT + KtTokens.GTEQ -> IrStatementOrigin.GTEQ + KtTokens.EQEQ -> IrStatementOrigin.EQEQ + KtTokens.EXCLEQ -> IrStatementOrigin.EXCLEQ + KtTokens.EQEQEQ -> IrStatementOrigin.EQEQEQ + KtTokens.EXCLEQEQEQ -> IrStatementOrigin.EXCLEQEQ + KtTokens.IN_KEYWORD -> IrStatementOrigin.IN + KtTokens.NOT_IN -> IrStatementOrigin.NOT_IN + KtTokens.ANDAND -> IrStatementOrigin.ANDAND + KtTokens.OROR -> IrStatementOrigin.OROR + KtTokens.ELVIS -> IrStatementOrigin.ELVIS else -> null } -fun getPrefixOperator(ktOperator: IElementType): IrOperator? = +fun getPrefixOperator(ktOperator: IElementType): IrStatementOrigin? = when (ktOperator) { - KtTokens.PLUSPLUS -> IrOperator.PREFIX_INCR - KtTokens.MINUSMINUS -> IrOperator.PREFIX_DECR - KtTokens.EXCL -> IrOperator.EXCL - KtTokens.MINUS -> IrOperator.UMINUS - KtTokens.PLUS -> IrOperator.UPLUS + KtTokens.PLUSPLUS -> IrStatementOrigin.PREFIX_INCR + KtTokens.MINUSMINUS -> IrStatementOrigin.PREFIX_DECR + KtTokens.EXCL -> IrStatementOrigin.EXCL + KtTokens.MINUS -> IrStatementOrigin.UMINUS + KtTokens.PLUS -> IrStatementOrigin.UPLUS else -> null } -fun getPostfixOperator(ktOperator: IElementType): IrOperator? = +fun getPostfixOperator(ktOperator: IElementType): IrStatementOrigin? = when (ktOperator) { - KtTokens.PLUSPLUS -> IrOperator.POSTFIX_INCR - KtTokens.MINUSMINUS -> IrOperator.POSTFIX_DECR - KtTokens.EXCLEXCL -> IrOperator.EXCLEXCL + KtTokens.PLUSPLUS -> IrStatementOrigin.POSTFIX_INCR + KtTokens.MINUSMINUS -> IrStatementOrigin.POSTFIX_DECR + KtTokens.EXCLEXCL -> IrStatementOrigin.EXCLEXCL else -> null } @@ -80,29 +80,29 @@ fun getIrTypeOperator(ktOperator: IElementType): IrTypeOperator? = } val AUGMENTED_ASSIGNMENTS = - setOf(IrOperator.PLUSEQ, IrOperator.MINUSEQ, IrOperator.MULTEQ, IrOperator.DIVEQ, IrOperator.PERCEQ) + setOf(IrStatementOrigin.PLUSEQ, IrStatementOrigin.MINUSEQ, IrStatementOrigin.MULTEQ, IrStatementOrigin.DIVEQ, IrStatementOrigin.PERCEQ) val OPERATORS_DESUGARED_TO_CALLS = - setOf(IrOperator.PLUS, IrOperator.MINUS, IrOperator.MUL, IrOperator.DIV, IrOperator.PERC, IrOperator.RANGE, - IrOperator.EXCL, IrOperator.UMINUS, IrOperator.UPLUS) + setOf(IrStatementOrigin.PLUS, IrStatementOrigin.MINUS, IrStatementOrigin.MUL, IrStatementOrigin.DIV, IrStatementOrigin.PERC, IrStatementOrigin.RANGE, + IrStatementOrigin.EXCL, IrStatementOrigin.UMINUS, IrStatementOrigin.UPLUS) val COMPARISON_OPERATORS = - setOf(IrOperator.LT, IrOperator.LTEQ, IrOperator.GT, IrOperator.GTEQ) + setOf(IrStatementOrigin.LT, IrStatementOrigin.LTEQ, IrStatementOrigin.GT, IrStatementOrigin.GTEQ) val EQUALITY_OPERATORS = - setOf(IrOperator.EQEQ, IrOperator.EXCLEQ) + setOf(IrStatementOrigin.EQEQ, IrStatementOrigin.EXCLEQ) val IDENTITY_OPERATORS = - setOf(IrOperator.EQEQEQ, IrOperator.EXCLEQEQ) + setOf(IrStatementOrigin.EQEQEQ, IrStatementOrigin.EXCLEQEQ) val IN_OPERATORS = - setOf(IrOperator.IN, IrOperator.NOT_IN) + setOf(IrStatementOrigin.IN, IrStatementOrigin.NOT_IN) val BINARY_BOOLEAN_OPERATORS = - setOf(IrOperator.ANDAND, IrOperator.OROR) + setOf(IrStatementOrigin.ANDAND, IrStatementOrigin.OROR) val INCREMENT_DECREMENT_OPERATORS = - setOf(IrOperator.PREFIX_INCR, IrOperator.PREFIX_DECR, IrOperator.POSTFIX_INCR, IrOperator.POSTFIX_DECR) + setOf(IrStatementOrigin.PREFIX_INCR, IrStatementOrigin.PREFIX_DECR, IrStatementOrigin.POSTFIX_INCR, IrStatementOrigin.POSTFIX_DECR) val POSTFIX_INCREMENT_DECREMENT_OPERATORS = - setOf(IrOperator.POSTFIX_INCR, IrOperator.POSTFIX_DECR) \ No newline at end of file + setOf(IrStatementOrigin.POSTFIX_INCR, IrStatementOrigin.POSTFIX_DECR) \ No newline at end of file diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/OperatorExpressionGenerator.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/OperatorExpressionGenerator.kt index 8f997ca3567..3d1835e10fd 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/OperatorExpressionGenerator.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/OperatorExpressionGenerator.kt @@ -55,7 +55,7 @@ class OperatorExpressionGenerator(statementGenerator: StatementGenerator) : Stat return when (irOperator) { null -> throw AssertionError("Unexpected postfix operator: $ktOperator") in INCREMENT_DECREMENT_OPERATORS -> AssignmentGenerator(statementGenerator).generatePostfixIncrementDecrement(expression, irOperator) - IrOperator.EXCLEXCL -> generateExclExclOperator(expression, irOperator) + IrStatementOrigin.EXCLEXCL -> generateExclExclOperator(expression, irOperator) else -> createDummyExpression(expression, ktOperator.toString()) } } @@ -97,9 +97,9 @@ class OperatorExpressionGenerator(statementGenerator: StatementGenerator) : Stat return when (irOperator) { null -> throw AssertionError("Unexpected infix operator: $ktOperator") - IrOperator.EQ -> AssignmentGenerator(statementGenerator).generateAssignment(expression) + IrStatementOrigin.EQ -> AssignmentGenerator(statementGenerator).generateAssignment(expression) in AUGMENTED_ASSIGNMENTS -> AssignmentGenerator(statementGenerator).generateAugmentedAssignment(expression, irOperator) - IrOperator.ELVIS -> generateElvis(expression) + IrStatementOrigin.ELVIS -> generateElvis(expression) in OPERATORS_DESUGARED_TO_CALLS -> generateBinaryOperatorAsCall(expression, irOperator) in COMPARISON_OPERATORS -> generateComparisonOperator(expression, irOperator) in EQUALITY_OPERATORS -> generateEqualityOperator(expression, irOperator) @@ -116,35 +116,35 @@ class OperatorExpressionGenerator(statementGenerator: StatementGenerator) : Stat val irArgument0 = statementGenerator.generateExpression(expression.left!!) val irArgument1 = statementGenerator.generateExpression(expression.right!!) - return irBlock(expression, IrOperator.ELVIS, resultType) { + return irBlock(expression, IrStatementOrigin.ELVIS, resultType) { val temporary = defineTemporary(irArgument0, "elvis_lhs") +irIfNull(resultType, irGet(temporary), irArgument1, irGet(temporary)) } } - private fun generateBinaryBooleanOperator(expression: KtBinaryExpression, irOperator: IrOperator): IrExpression { + private fun generateBinaryBooleanOperator(expression: KtBinaryExpression, irOperator: IrStatementOrigin): IrExpression { val irArgument0 = statementGenerator.generateExpression(expression.left!!) val irArgument1 = statementGenerator.generateExpression(expression.right!!) return when (irOperator) { - IrOperator.OROR -> + IrStatementOrigin.OROR -> context.oror(expression.startOffset, expression.endOffset, irArgument0, irArgument1) - IrOperator.ANDAND -> + IrStatementOrigin.ANDAND -> context.andand(expression.startOffset, expression.endOffset, irArgument0, irArgument1) else -> throw AssertionError("Unexpected binary boolean operator $irOperator") } } - private fun generateInOperator(expression: KtBinaryExpression, irOperator: IrOperator): IrExpression { + private fun generateInOperator(expression: KtBinaryExpression, irOperator: IrStatementOrigin): IrExpression { val containsCall = getResolvedCall(expression)!! val irContainsCall = CallGenerator(statementGenerator).generateCall(expression, statementGenerator.pregenerateCall(containsCall), irOperator) return when (irOperator) { - IrOperator.IN -> + IrStatementOrigin.IN -> irContainsCall - IrOperator.NOT_IN -> - IrUnaryPrimitiveImpl(expression.startOffset, expression.endOffset, IrOperator.NOT_IN, context.irBuiltIns.booleanNot, + IrStatementOrigin.NOT_IN -> + IrUnaryPrimitiveImpl(expression.startOffset, expression.endOffset, IrStatementOrigin.NOT_IN, context.irBuiltIns.booleanNot, irContainsCall) else -> throw AssertionError("Unexpected in-operator $irOperator") @@ -152,7 +152,7 @@ class OperatorExpressionGenerator(statementGenerator: StatementGenerator) : Stat } - private fun generateIdentityOperator(expression: KtBinaryExpression, irOperator: IrOperator): IrExpression { + private fun generateIdentityOperator(expression: KtBinaryExpression, irOperator: IrStatementOrigin): IrExpression { val irArgument0 = statementGenerator.generateExpression(expression.left!!) val irArgument1 = statementGenerator.generateExpression(expression.right!!) @@ -161,10 +161,10 @@ class OperatorExpressionGenerator(statementGenerator: StatementGenerator) : Stat irArgument0, irArgument1) return when (irOperator) { - IrOperator.EQEQEQ -> + IrStatementOrigin.EQEQEQ -> irIdentityEquals - IrOperator.EXCLEQEQ -> - IrUnaryPrimitiveImpl(expression.startOffset, expression.endOffset, IrOperator.EXCLEQEQ, context.irBuiltIns.booleanNot, + IrStatementOrigin.EXCLEQEQ -> + IrUnaryPrimitiveImpl(expression.startOffset, expression.endOffset, IrStatementOrigin.EXCLEQEQ, context.irBuiltIns.booleanNot, irIdentityEquals) else -> throw AssertionError("Unexpected identity operator $irOperator") @@ -172,7 +172,7 @@ class OperatorExpressionGenerator(statementGenerator: StatementGenerator) : Stat } - private fun generateEqualityOperator(expression: KtBinaryExpression, irOperator: IrOperator): IrExpression { + private fun generateEqualityOperator(expression: KtBinaryExpression, irOperator: IrStatementOrigin): IrExpression { val irArgument0 = statementGenerator.generateExpression(expression.left!!) val irArgument1 = statementGenerator.generateExpression(expression.right!!) @@ -180,10 +180,10 @@ class OperatorExpressionGenerator(statementGenerator: StatementGenerator) : Stat irOperator, context.irBuiltIns.eqeq, irArgument0, irArgument1) return when (irOperator) { - IrOperator.EQEQ -> + IrStatementOrigin.EQEQ -> irEquals - IrOperator.EXCLEQ -> - IrUnaryPrimitiveImpl(expression.startOffset, expression.endOffset, IrOperator.EXCLEQ, + IrStatementOrigin.EXCLEQ -> + IrUnaryPrimitiveImpl(expression.startOffset, expression.endOffset, IrStatementOrigin.EXCLEQ, context.irBuiltIns.booleanNot, irEquals) else -> throw AssertionError("Unexpected equality operator $irOperator") @@ -191,41 +191,41 @@ class OperatorExpressionGenerator(statementGenerator: StatementGenerator) : Stat } - private fun generateComparisonOperator(expression: KtBinaryExpression, irOperator: IrOperator): IrExpression { + private fun generateComparisonOperator(expression: KtBinaryExpression, origin: IrStatementOrigin): IrExpression { val compareToCall = getResolvedCall(expression)!! - val irCompareToCall = CallGenerator(statementGenerator).generateCall(expression, statementGenerator.pregenerateCall(compareToCall), irOperator) + val irCompareToCall = CallGenerator(statementGenerator).generateCall(expression, statementGenerator.pregenerateCall(compareToCall), origin) - val compareToZeroDescriptor = when (irOperator) { - IrOperator.LT -> context.irBuiltIns.lt0 - IrOperator.LTEQ -> context.irBuiltIns.lteq0 - IrOperator.GT -> context.irBuiltIns.gt0 - IrOperator.GTEQ -> context.irBuiltIns.gteq0 - else -> throw AssertionError("Unexpected comparison operator: $irOperator") + val compareToZeroDescriptor = when (origin) { + IrStatementOrigin.LT -> context.irBuiltIns.lt0 + IrStatementOrigin.LTEQ -> context.irBuiltIns.lteq0 + IrStatementOrigin.GT -> context.irBuiltIns.gt0 + IrStatementOrigin.GTEQ -> context.irBuiltIns.gteq0 + else -> throw AssertionError("Unexpected comparison operator: $origin") } - return IrUnaryPrimitiveImpl(expression.startOffset, expression.endOffset, irOperator, compareToZeroDescriptor, irCompareToCall) + return IrUnaryPrimitiveImpl(expression.startOffset, expression.endOffset, origin, compareToZeroDescriptor, irCompareToCall) } - private fun generateExclExclOperator(expression: KtPostfixExpression, irOperator: IrOperator): IrExpression { + private fun generateExclExclOperator(expression: KtPostfixExpression, origin: IrStatementOrigin): IrExpression { val ktArgument = expression.baseExpression!! val irArgument = statementGenerator.generateExpression(ktArgument) val ktOperator = expression.operationReference val resultType = irArgument.type.makeNotNullable() - return irBlock(ktOperator, irOperator, resultType) { + return irBlock(ktOperator, origin, resultType) { val temporary = defineTemporary(irArgument, "notnull") - +irIfNull(resultType, irGet(temporary), irThrowNpe(irOperator), irGet(temporary)) + +irIfNull(resultType, irGet(temporary), irThrowNpe(origin), irGet(temporary)) } } - private fun generateBinaryOperatorAsCall(expression: KtBinaryExpression, irOperator: IrOperator?): IrExpression { + private fun generateBinaryOperatorAsCall(expression: KtBinaryExpression, origin: IrStatementOrigin?): IrExpression { val operatorCall = getResolvedCall(expression)!! - return CallGenerator(statementGenerator).generateCall(expression, statementGenerator.pregenerateCall(operatorCall), irOperator) + return CallGenerator(statementGenerator).generateCall(expression, statementGenerator.pregenerateCall(operatorCall), origin) } - private fun generatePrefixOperatorAsCall(expression: KtPrefixExpression, irOperator: IrOperator): IrExpression { + private fun generatePrefixOperatorAsCall(expression: KtPrefixExpression, origin: IrStatementOrigin): IrExpression { val resolvedCall = getResolvedCall(expression)!! if (expression.baseExpression is KtConstantExpression) { @@ -237,6 +237,6 @@ class OperatorExpressionGenerator(statementGenerator: StatementGenerator) : Stat } } - return CallGenerator(statementGenerator).generateCall(expression, statementGenerator.pregenerateCall(resolvedCall), irOperator) + return CallGenerator(statementGenerator).generateCall(expression, statementGenerator.pregenerateCall(resolvedCall), origin) } } diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/Primitives.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/Primitives.kt index 0bbeaa6eb10..fdbefdc077f 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/Primitives.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/Primitives.kt @@ -21,44 +21,44 @@ import org.jetbrains.kotlin.ir.descriptors.IrBuiltIns import org.jetbrains.kotlin.ir.expressions.* import org.jetbrains.kotlin.ir.expressions.impl.* -fun primitiveOp1(startOffset: Int, endOffset: Int, primitiveOpDescriptor: CallableDescriptor, irOperator: IrOperator, +fun primitiveOp1(startOffset: Int, endOffset: Int, primitiveOpDescriptor: CallableDescriptor, origin: IrStatementOrigin, argument: IrExpression): IrExpression = - IrUnaryPrimitiveImpl(startOffset, endOffset, irOperator, primitiveOpDescriptor, argument) + IrUnaryPrimitiveImpl(startOffset, endOffset, origin, primitiveOpDescriptor, argument) -fun primitiveOp2(startOffset: Int, endOffset: Int, primitiveOpDescriptor: CallableDescriptor, irOperator: IrOperator, +fun primitiveOp2(startOffset: Int, endOffset: Int, primitiveOpDescriptor: CallableDescriptor, origin: IrStatementOrigin, argument1: IrExpression, argument2: IrExpression): IrExpression = - IrBinaryPrimitiveImpl(startOffset, endOffset, irOperator, primitiveOpDescriptor, argument1, argument2) + IrBinaryPrimitiveImpl(startOffset, endOffset, origin, primitiveOpDescriptor, argument1, argument2) fun GeneratorContext.constNull(startOffset: Int, endOffset: Int): IrExpression = IrConstImpl.constNull(startOffset, endOffset, builtIns.nullableNothingType) fun GeneratorContext.equalsNull(startOffset: Int, endOffset: Int, argument: IrExpression): IrExpression = - primitiveOp2(startOffset, endOffset, irBuiltIns.eqeq, IrOperator.EQEQ, + primitiveOp2(startOffset, endOffset, irBuiltIns.eqeq, IrStatementOrigin.EQEQ, argument, constNull(startOffset, endOffset)) fun GeneratorContext.eqeqeq(startOffset: Int, endOffset: Int, argument1: IrExpression, argument2: IrExpression): IrExpression = - primitiveOp2(startOffset, endOffset, irBuiltIns.eqeqeq, IrOperator.EQEQEQ, argument1, argument2) + primitiveOp2(startOffset, endOffset, irBuiltIns.eqeqeq, IrStatementOrigin.EQEQEQ, argument1, argument2) -fun GeneratorContext.throwNpe(startOffset: Int, endOffset: Int, operator: IrOperator): IrExpression = - IrNullaryPrimitiveImpl(startOffset, endOffset, operator, irBuiltIns.throwNpe) +fun GeneratorContext.throwNpe(startOffset: Int, endOffset: Int, origin: IrStatementOrigin): IrExpression = + IrNullaryPrimitiveImpl(startOffset, endOffset, origin, irBuiltIns.throwNpe) // a || b == if (a) true else b -fun GeneratorContext.oror(startOffset: Int, endOffset: Int, a: IrExpression, b: IrExpression, operator: IrOperator = IrOperator.OROR): IrWhen = +fun GeneratorContext.oror(startOffset: Int, endOffset: Int, a: IrExpression, b: IrExpression, origin: IrStatementOrigin = IrStatementOrigin.OROR): IrWhen = IrIfThenElseImpl(startOffset, endOffset, builtIns.booleanType, - a, IrConstImpl.constTrue(b.startOffset, b.endOffset, b.type), b, - operator) + a, IrConstImpl.constTrue(b.startOffset, b.endOffset, b.type), b, + origin) -fun GeneratorContext.oror(a: IrExpression, b: IrExpression, operator: IrOperator = IrOperator.OROR): IrWhen = - oror(b.startOffset, b.endOffset, a, b, operator) +fun GeneratorContext.oror(a: IrExpression, b: IrExpression, origin: IrStatementOrigin = IrStatementOrigin.OROR): IrWhen = + oror(b.startOffset, b.endOffset, a, b, origin) fun GeneratorContext.whenComma(a: IrExpression, b: IrExpression): IrWhen = - oror(a, b, IrOperator.WHEN_COMMA) + oror(a, b, IrStatementOrigin.WHEN_COMMA) // a && b == if (a) b else false -fun GeneratorContext.andand(startOffset: Int, endOffset: Int, a: IrExpression, b: IrExpression, operator: IrOperator = IrOperator.ANDAND): IrWhen = +fun GeneratorContext.andand(startOffset: Int, endOffset: Int, a: IrExpression, b: IrExpression, origin: IrStatementOrigin = IrStatementOrigin.ANDAND): IrWhen = IrIfThenElseImpl(startOffset, endOffset, builtIns.booleanType, - a, b, IrConstImpl.constFalse(b.startOffset, b.endOffset, b.type), - operator) + a, b, IrConstImpl.constFalse(b.startOffset, b.endOffset, b.type), + origin) -fun GeneratorContext.andand(a: IrExpression, b: IrExpression, operator: IrOperator = IrOperator.ANDAND): IrWhen = - andand(b.startOffset, b.endOffset, a, b, operator) \ No newline at end of file +fun GeneratorContext.andand(a: IrExpression, b: IrExpression, origin: IrStatementOrigin = IrStatementOrigin.ANDAND): IrWhen = + andand(b.startOffset, b.endOffset, a, b, origin) \ No newline at end of file diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/PropertyGenerator.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/PropertyGenerator.kt index c4da3ed2736..5b00c82e3ac 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/PropertyGenerator.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/PropertyGenerator.kt @@ -28,7 +28,7 @@ import org.jetbrains.kotlin.ir.declarations.impl.IrFieldImpl import org.jetbrains.kotlin.ir.declarations.impl.IrFunctionImpl import org.jetbrains.kotlin.ir.declarations.impl.IrPropertyImpl import org.jetbrains.kotlin.ir.expressions.IrBlockBody -import org.jetbrains.kotlin.ir.expressions.IrOperator +import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin import org.jetbrains.kotlin.ir.expressions.impl.* import org.jetbrains.kotlin.psi.KtElement import org.jetbrains.kotlin.psi.KtParameter @@ -59,7 +59,7 @@ class PropertyGenerator(val declarationGenerator: DeclarationGenerator) : Genera val irField = IrFieldImpl(ktParameter.startOffset, ktParameter.endOffset, IrDeclarationOrigin.PROPERTY_BACKING_FIELD, propertyDescriptor) val irGetParameter = IrGetVariableImpl(ktParameter.startOffset, ktParameter.endOffset, - valueParameterDescriptor, IrOperator.INITIALIZE_PROPERTY_FROM_PARAMETER) + valueParameterDescriptor, IrStatementOrigin.INITIALIZE_PROPERTY_FROM_PARAMETER) irField.initializer = IrExpressionBodyImpl(ktParameter.startOffset, ktParameter.endOffset, irGetParameter) irProperty.backingField = irField diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/StatementGenerator.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/StatementGenerator.kt index 78536ba6971..4df1f35afda 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/StatementGenerator.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/StatementGenerator.kt @@ -94,7 +94,7 @@ class StatementGenerator( override fun visitDestructuringDeclaration(multiDeclaration: KtDestructuringDeclaration, data: Nothing?): IrStatement { val irBlock = IrCompositeImpl(multiDeclaration.startOffset, multiDeclaration.endOffset, - context.builtIns.unitType, IrOperator.DESTRUCTURING_DECLARATION) + context.builtIns.unitType, IrStatementOrigin.DESTRUCTURING_DECLARATION) val ktInitializer = multiDeclaration.initializer!! val containerValue = scope.createTemporaryVariableInBlock(ktInitializer.genExpr(), irBlock, "container") @@ -113,9 +113,9 @@ class StatementGenerator( val componentVariable = getOrFail(BindingContext.VARIABLE, ktEntry) val irComponentCall = callGenerator.generateCall(ktEntry.startOffset, ktEntry.endOffset, componentSubstitutedCall, - IrOperator.COMPONENT_N.withIndex(index + 1)) + IrStatementOrigin.COMPONENT_N.withIndex(index + 1)) val irComponentVar = IrVariableImpl(ktEntry.startOffset, ktEntry.endOffset, IrDeclarationOrigin.DEFINED, - componentVariable, irComponentCall) + componentVariable, irComponentCall) irBlock.addStatement(irComponentVar) } } @@ -232,7 +232,7 @@ class StatementGenerator( if (resolvedCall != null) { if (resolvedCall is VariableAsFunctionResolvedCall) { val variableCall = pregenerateCall(resolvedCall.variableCall) - return CallGenerator(this).generateCall(expression, variableCall, IrOperator.VARIABLE_AS_FUNCTION) + return CallGenerator(this).generateCall(expression, variableCall, IrStatementOrigin.VARIABLE_AS_FUNCTION) } val descriptor = resolvedCall.resultingDescriptor @@ -289,7 +289,7 @@ class StatementGenerator( if (resolvedCall is VariableAsFunctionResolvedCall) { val functionCall = pregenerateCall(resolvedCall.functionCall) - return CallGenerator(this).generateCall(expression, functionCall, IrOperator.INVOKE) + return CallGenerator(this).generateCall(expression, functionCall, IrStatementOrigin.INVOKE) } return CallGenerator(this).generateCall(expression.startOffset, expression.endOffset, pregenerateCall(resolvedCall)) @@ -299,7 +299,7 @@ class StatementGenerator( val indexedGetCall = getOrFail(BindingContext.INDEXED_LVALUE_GET, expression) return CallGenerator(this).generateCall(expression.startOffset, expression.endOffset, - pregenerateCall(indexedGetCall), IrOperator.GET_ARRAY_ELEMENT) + pregenerateCall(indexedGetCall), IrStatementOrigin.GET_ARRAY_ELEMENT) } override fun visitDotQualifiedExpression(expression: KtDotQualifiedExpression, data: Nothing?): IrStatement = @@ -379,7 +379,7 @@ class StatementGenerator( override fun visitTypeAlias(typeAlias: KtTypeAlias, data: Nothing?): IrStatement = IrTypeAliasImpl(typeAlias.startOffset, typeAlias.endOffset, IrDeclarationOrigin.DEFINED, - getOrFail(BindingContext.TYPE_ALIAS, typeAlias)) + getOrFail(BindingContext.TYPE_ALIAS, typeAlias)) override fun visitClassLiteralExpression(expression: KtClassLiteralExpression, data: Nothing?): IrStatement = ReflectionReferencesGenerator(this).generateClassLiteral(expression) diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/ArrayAccessAssignmentReceiver.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/ArrayAccessAssignmentReceiver.kt index 9a0309c32d1..8e625c66979 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/ArrayAccessAssignmentReceiver.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/ArrayAccessAssignmentReceiver.kt @@ -31,16 +31,16 @@ class ArrayAccessAssignmentReceiver( val callGenerator: CallGenerator, val startOffset: Int, val endOffset: Int, - val operator: IrOperator + val origin: IrStatementOrigin ) : AssignmentReceiver { private val type: KotlinType = indexedGetCall?.let { it.descriptor.returnType!! } ?: indexedSetCall?.let { it.descriptor.valueParameters.last().type } ?: throw AssertionError("Array access should have either indexed-get call or indexed-set call") override fun assign(withLValue: (LValue) -> IrExpression): IrExpression { - val hasResult = operator.isAssignmentOperatorWithResult() + val hasResult = origin.isAssignmentOperatorWithResult() val resultType = if (hasResult) type else callGenerator.context.builtIns.unitType - val irBlock = IrBlockImpl(startOffset, endOffset, resultType, operator) + val irBlock = IrBlockImpl(startOffset, endOffset, resultType, origin) val irArrayValue = callGenerator.scope.createTemporaryVariableInBlock(irArray, irBlock, "array") @@ -50,7 +50,7 @@ class ArrayAccessAssignmentReceiver( indexedGetCall?.fillArrayAndIndexArguments(irArrayValue, irIndexValues) indexedSetCall?.fillArrayAndIndexArguments(irArrayValue, irIndexValues) - val irLValue = LValueWithGetterAndSetterCalls(callGenerator, indexedGetCall, indexedSetCall, type, startOffset, endOffset, operator) + val irLValue = LValueWithGetterAndSetterCalls(callGenerator, indexedGetCall, indexedSetCall, type, startOffset, endOffset, origin) irBlock.inlineStatement(withLValue(irLValue)) return irBlock @@ -63,7 +63,7 @@ class ArrayAccessAssignmentReceiver( indexedSetCall.irValueArgumentsByIndex[i] = irIndex } indexedSetCall.lastArgument = value - return callGenerator.generateCall(startOffset, endOffset, indexedSetCall, IrOperator.EQ) + return callGenerator.generateCall(startOffset, endOffset, indexedSetCall, IrStatementOrigin.EQ) } private fun CallBuilder.fillArrayAndIndexArguments(arrayValue: IntermediateValue, indexValues: List) { diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/BackingFieldLValue.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/BackingFieldLValue.kt index 5ca7977f22a..888d79b1c77 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/BackingFieldLValue.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/BackingFieldLValue.kt @@ -27,15 +27,15 @@ class BackingFieldLValue( val endOffset: Int, val descriptor: PropertyDescriptor, val receiver: IntermediateValue?, - val operator: IrOperator? + val origin: IrStatementOrigin? ) : LValue, AssignmentReceiver { override val type: KotlinType get() = descriptor.type override fun store(irExpression: IrExpression): IrExpression = - IrSetFieldImpl(startOffset, endOffset, descriptor, receiver?.load(), irExpression, operator) + IrSetFieldImpl(startOffset, endOffset, descriptor, receiver?.load(), irExpression, origin) override fun load(): IrExpression = - IrGetFieldImpl(startOffset, endOffset, descriptor, receiver?.load(), operator) + IrGetFieldImpl(startOffset, endOffset, descriptor, receiver?.load(), origin) override fun assign(withLValue: (LValue) -> IrExpression): IrExpression = withLValue(this) diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/DelegatedLocalPropertyLValue.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/DelegatedLocalPropertyLValue.kt index 362fd437b62..8da2d31460e 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/DelegatedLocalPropertyLValue.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/DelegatedLocalPropertyLValue.kt @@ -19,22 +19,22 @@ package org.jetbrains.kotlin.psi2ir.intermediate import org.jetbrains.kotlin.descriptors.VariableDescriptorWithAccessors import org.jetbrains.kotlin.ir.expressions.impl.IrCallImpl import org.jetbrains.kotlin.ir.expressions.IrExpression -import org.jetbrains.kotlin.ir.expressions.IrOperator +import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin import org.jetbrains.kotlin.types.KotlinType class DelegatedLocalPropertyLValue( val startOffset: Int, val endOffset: Int, val descriptor: VariableDescriptorWithAccessors, - val irOperator: IrOperator? = null + val origin: IrStatementOrigin? = null ) : LValue, AssignmentReceiver { override val type: KotlinType get() = descriptor.type override fun load(): IrExpression = - IrCallImpl(startOffset, endOffset, descriptor.type, descriptor.getter!!, irOperator) + IrCallImpl(startOffset, endOffset, descriptor.type, descriptor.getter!!, origin) override fun store(irExpression: IrExpression): IrExpression = - IrCallImpl(startOffset, endOffset, descriptor.type, descriptor.setter!!, irOperator).apply { + IrCallImpl(startOffset, endOffset, descriptor.type, descriptor.setter!!, origin).apply { putArgument(0, irExpression) } diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/LValueWithGetterAndSetterCalls.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/LValueWithGetterAndSetterCalls.kt index 86d8a1a28cc..020a6bf6fd3 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/LValueWithGetterAndSetterCalls.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/LValueWithGetterAndSetterCalls.kt @@ -18,7 +18,7 @@ package org.jetbrains.kotlin.psi2ir.intermediate import org.jetbrains.kotlin.descriptors.CallableDescriptor import org.jetbrains.kotlin.ir.expressions.IrExpression -import org.jetbrains.kotlin.ir.expressions.IrOperator +import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin import org.jetbrains.kotlin.psi2ir.generators.CallGenerator import org.jetbrains.kotlin.psi2ir.intermediate.CallBuilder import org.jetbrains.kotlin.psi2ir.intermediate.argumentsCount @@ -31,7 +31,7 @@ class LValueWithGetterAndSetterCalls( override val type: KotlinType, val startOffset: Int, val endOffset: Int, - val operator: IrOperator? = null + val origin: IrStatementOrigin? = null ) : LValue { private val descriptor: CallableDescriptor = getterCall?.descriptor ?: setterCall?.descriptor ?: @@ -44,7 +44,7 @@ class LValueWithGetterAndSetterCalls( if (getterCall == null) throw AssertionError("No getter call for $descriptor") if (getterInstantiated) throw AssertionError("Getter for $descriptor has already been instantiated") getterInstantiated = true - return callGenerator.generateCall(startOffset, endOffset, getterCall, operator) + return callGenerator.generateCall(startOffset, endOffset, getterCall, origin) } override fun store(irExpression: IrExpression): IrExpression { @@ -52,7 +52,7 @@ class LValueWithGetterAndSetterCalls( if (setterInstantiated) throw AssertionError("Setter for $descriptor has already been instantiated") setterInstantiated = true setterCall.irValueArgumentsByIndex[setterCall.argumentsCount - 1] = irExpression - return callGenerator.generateCall(startOffset, endOffset, setterCall, operator) + return callGenerator.generateCall(startOffset, endOffset, setterCall, origin) } } diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/OnceCallValue.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/OnceCallValue.kt index 5884c928c71..bf2d2f1bf7d 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/OnceCallValue.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/OnceCallValue.kt @@ -17,7 +17,7 @@ package org.jetbrains.kotlin.psi2ir.intermediate import org.jetbrains.kotlin.ir.expressions.IrExpression -import org.jetbrains.kotlin.ir.expressions.IrOperator +import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin import org.jetbrains.kotlin.psi2ir.generators.CallGenerator import org.jetbrains.kotlin.psi2ir.generators.StatementGenerator import org.jetbrains.kotlin.psi2ir.intermediate.CallBuilder @@ -28,14 +28,14 @@ class OnceCallValue( val endOffset: Int, val statementGenerator: StatementGenerator, val call: CallBuilder, - val operator: IrOperator? = null + val origin: IrStatementOrigin? = null ): IntermediateValue { private var instantiated = false override fun load(): IrExpression { if (instantiated) throw AssertionError("Value for call ${call.descriptor} has already been instantiated") instantiated = true - return CallGenerator(statementGenerator).generateCall(startOffset, endOffset, call, operator) + return CallGenerator(statementGenerator).generateCall(startOffset, endOffset, call, origin) } override val type: KotlinType get() = call.descriptor.returnType!! diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/SafeCallReceiver.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/SafeCallReceiver.kt index cf28db0d974..8a9ea436a05 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/SafeCallReceiver.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/SafeCallReceiver.kt @@ -19,7 +19,7 @@ package org.jetbrains.kotlin.psi2ir.intermediate import org.jetbrains.kotlin.ir.expressions.impl.IrBlockImpl import org.jetbrains.kotlin.ir.expressions.IrExpression import org.jetbrains.kotlin.ir.expressions.impl.IrIfThenElseImpl -import org.jetbrains.kotlin.ir.expressions.IrOperator +import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin import org.jetbrains.kotlin.psi2ir.generators.GeneratorWithScope import org.jetbrains.kotlin.psi2ir.generators.constNull import org.jetbrains.kotlin.psi2ir.generators.equalsNull @@ -51,15 +51,15 @@ class SafeCallReceiver( val irResult = withDispatchAndExtensionReceivers(dispatchReceiverValue, extensionReceiverValue) val resultType = irResult.type.makeNullable() - val irBlock = IrBlockImpl(startOffset, endOffset, resultType, IrOperator.SAFE_CALL) + val irBlock = IrBlockImpl(startOffset, endOffset, resultType, IrStatementOrigin.SAFE_CALL) irBlock.addStatement(irTmp) val irIfThenElse = IrIfThenElseImpl(startOffset, endOffset, resultType, - generator.context.equalsNull(startOffset, endOffset, safeReceiverValue.load()), - generator.context.constNull(startOffset, endOffset), - irResult, - IrOperator.SAFE_CALL) + generator.context.equalsNull(startOffset, endOffset, safeReceiverValue.load()), + generator.context.constNull(startOffset, endOffset), + irResult, + IrStatementOrigin.SAFE_CALL) irBlock.addStatement(irIfThenElse) return irBlock diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/SimplePropertyLValue.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/SimplePropertyLValue.kt index 0aa40615eb1..b8abdacd62a 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/SimplePropertyLValue.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/SimplePropertyLValue.kt @@ -29,7 +29,7 @@ class SimplePropertyLValue( val scope: Scope, val startOffset: Int, val endOffset: Int, - val irOperator: IrOperator?, + val origin: IrStatementOrigin?, val descriptor: PropertyDescriptor, val callReceiver: CallReceiver, val superQualifier: ClassDescriptor? @@ -42,10 +42,10 @@ class SimplePropertyLValue( IrGetterCallImpl(startOffset, endOffset, getter, dispatchReceiverValue?.load(), extensionReceiverValue?.load(), - irOperator, + origin, superQualifier) } ?: IrGetFieldImpl(startOffset, endOffset, descriptor, - dispatchReceiverValue?.load(), irOperator, superQualifier) + dispatchReceiverValue?.load(), origin, superQualifier) } override fun store(irExpression: IrExpression) = @@ -55,10 +55,10 @@ class SimplePropertyLValue( dispatchReceiverValue?.load(), extensionReceiverValue?.load(), irExpression, - irOperator, + origin, superQualifier) } ?: IrSetFieldImpl(startOffset, endOffset, descriptor, - dispatchReceiverValue?.load(), irExpression, irOperator, superQualifier) + dispatchReceiverValue?.load(), irExpression, origin, superQualifier) } override fun assign(withLValue: (LValue) -> IrExpression) = @@ -74,12 +74,12 @@ class SimplePropertyLValue( val extensionReceiverValue2 = extensionReceiverTmp?.let { VariableLValue(it) } val irResultExpression = withLValue( - SimplePropertyLValue(context, scope, startOffset, endOffset, irOperator, descriptor, + SimplePropertyLValue(context, scope, startOffset, endOffset, origin, descriptor, SimpleCallReceiver(dispatchReceiverValue2, extensionReceiverValue2), superQualifier) ) - val irBlock = IrBlockImpl(startOffset, endOffset, irResultExpression.type, irOperator) + val irBlock = IrBlockImpl(startOffset, endOffset, irResultExpression.type, origin) irBlock.addIfNotNull(dispatchReceiverTmp) irBlock.addIfNotNull(extensionReceiverTmp) irBlock.addStatement(irResultExpression) diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/VariableLValue.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/VariableLValue.kt index 0492f416f86..45b4b429db3 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/VariableLValue.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/VariableLValue.kt @@ -19,28 +19,27 @@ package org.jetbrains.kotlin.psi2ir.intermediate import org.jetbrains.kotlin.descriptors.VariableDescriptor import org.jetbrains.kotlin.ir.declarations.IrVariable import org.jetbrains.kotlin.ir.expressions.IrExpression +import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin import org.jetbrains.kotlin.ir.expressions.impl.IrGetVariableImpl -import org.jetbrains.kotlin.ir.expressions.IrOperator import org.jetbrains.kotlin.ir.expressions.impl.IrSetVariableImpl import org.jetbrains.kotlin.types.KotlinType -import org.jetbrains.kotlin.types.typeUtil.builtIns class VariableLValue( val startOffset: Int, val endOffset: Int, val descriptor: VariableDescriptor, - val irOperator: IrOperator? = null + val origin: IrStatementOrigin? = null ) : LValue, AssignmentReceiver { - constructor(irVariable: IrVariable, irOperator: IrOperator? = null) : this( - irVariable.startOffset, irVariable.endOffset, irVariable.descriptor, irOperator) + constructor(irVariable: IrVariable, origin: IrStatementOrigin? = null) : this( + irVariable.startOffset, irVariable.endOffset, irVariable.descriptor, origin) override val type: KotlinType get() = descriptor.type override fun load(): IrExpression = - IrGetVariableImpl(startOffset, endOffset, descriptor, irOperator) + IrGetVariableImpl(startOffset, endOffset, descriptor, origin) override fun store(irExpression: IrExpression): IrExpression = - IrSetVariableImpl(startOffset, endOffset, descriptor, irExpression, irOperator) + IrSetVariableImpl(startOffset, endOffset, descriptor, irExpression, origin) override fun assign(withLValue: (LValue) -> IrExpression): IrExpression = withLValue(this) diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/transformations/InlineDesugaredBlocks.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/transformations/InlineDesugaredBlocks.kt index 256b3b6774a..1ebb5618ef5 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/transformations/InlineDesugaredBlocks.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/transformations/InlineDesugaredBlocks.kt @@ -36,10 +36,10 @@ class InlineDesugaredBlocks : IrElementVisitorVoid { } override fun visitBlock(expression: IrBlock) { - val transformedBlock = IrBlockImpl(expression.startOffset, expression.endOffset, expression.type, expression.operator) + val transformedBlock = IrBlockImpl(expression.startOffset, expression.endOffset, expression.type, expression.origin) for (statement in expression.statements) { statement.acceptVoid(this) - if (statement is IrBlock && statement.operator != null) { + if (statement is IrBlock && statement.origin != null) { statement.statements.forEach { transformedBlock.addStatement(it.detach()) } diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrDeclaration.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrDeclaration.kt index ca6777a2100..a899558464b 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrDeclaration.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrDeclaration.kt @@ -43,17 +43,3 @@ enum class IrDeclarationKind { DUMMY; } -enum class IrDeclarationOrigin { - DEFINED, - PROPERTY_BACKING_FIELD, - DEFAULT_PROPERTY_ACCESSOR, - DELEGATE, - DELEGATED_PROPERTY_ACCESSOR, - DELEGATED_MEMBER, - CLASS_FOR_ENUM_ENTRY, - ENUM_CLASS_SPECIAL_MEMBER, - GENERATED_DATA_CLASS_MEMBER, - LOCAL_FUNCTION_FOR_LAMBDA, - IR_TEMPORARY_VARIABLE, -} - diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrDeclarationOrigin.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrDeclarationOrigin.kt new file mode 100644 index 00000000000..0ccfa9ed778 --- /dev/null +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrDeclarationOrigin.kt @@ -0,0 +1,35 @@ +/* + * Copyright 2010-2016 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.kotlin.ir.declarations + +interface IrDeclarationOrigin { + object DEFINED : IrDeclarationOriginImpl("DEFINED") + object PROPERTY_BACKING_FIELD : IrDeclarationOriginImpl("PROPERTY_BACKING_FIELD") + object DEFAULT_PROPERTY_ACCESSOR : IrDeclarationOriginImpl("DEFAULT_PROPERTY_ACCESSOR") + object DELEGATE : IrDeclarationOriginImpl("DELEGATE") + object DELEGATED_PROPERTY_ACCESSOR : IrDeclarationOriginImpl("DELEGATED_PROPERTY_ACCESSOR") + object DELEGATED_MEMBER : IrDeclarationOriginImpl("DELEGATED_MEMBER") + object CLASS_FOR_ENUM_ENTRY : IrDeclarationOriginImpl("CLASS_FOR_ENUM_ENTRY") + object ENUM_CLASS_SPECIAL_MEMBER : IrDeclarationOriginImpl("ENUM_CLASS_SPECIAL_MEMBER") + object GENERATED_DATA_CLASS_MEMBER : IrDeclarationOriginImpl("GENERATED_DATA_CLASS_MEMBER") + object LOCAL_FUNCTION_FOR_LAMBDA : IrDeclarationOriginImpl("LOCAL_FUNCTION_FOR_LAMBDA") + object IR_TEMPORARY_VARIABLE : IrDeclarationOriginImpl("IR_TEMPORARY_VARIABLE") +} + +abstract class IrDeclarationOriginImpl(val name: String): IrDeclarationOrigin { + override fun toString(): String = name +} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrBlock.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrBlock.kt index 132044d9417..7c2d4595b3d 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrBlock.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrBlock.kt @@ -17,7 +17,7 @@ package org.jetbrains.kotlin.ir.expressions interface IrContainerExpression : IrExpression, IrStatementContainer { - val operator: IrOperator? + val origin: IrStatementOrigin? val isTransparentScope: Boolean } diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrFieldAccessExpression.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrFieldAccessExpression.kt index 08ab0619ad6..faa54667a3e 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrFieldAccessExpression.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrFieldAccessExpression.kt @@ -23,7 +23,7 @@ interface IrFieldAccessExpression : IrDeclarationReference { override val descriptor: PropertyDescriptor val superQualifier: ClassDescriptor? var receiver: IrExpression? - val operator: IrOperator? + val origin: IrStatementOrigin? } interface IrGetField : IrFieldAccessExpression diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrGeneralCall.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrGeneralCall.kt index 9a262d935da..371c0feb6a9 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrGeneralCall.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrGeneralCall.kt @@ -20,7 +20,7 @@ import org.jetbrains.kotlin.descriptors.CallableDescriptor import org.jetbrains.kotlin.descriptors.ValueParameterDescriptor interface IrGeneralCall : IrMemberAccessExpression { - val operator: IrOperator? + val origin: IrStatementOrigin? override val descriptor: CallableDescriptor fun getArgument(index: Int): IrExpression? diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrLoop.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrLoop.kt index 9a3c8acb97b..32448ba8437 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrLoop.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrLoop.kt @@ -17,7 +17,7 @@ package org.jetbrains.kotlin.ir.expressions interface IrLoop : IrExpression { - val operator: IrOperator? + val origin: IrStatementOrigin? var body: IrExpression? var condition: IrExpression val label: String? diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrOperator.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrOperator.kt deleted file mode 100644 index 4dbae585eae..00000000000 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrOperator.kt +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright 2010-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.kotlin.ir.expressions - -interface IrOperator { - abstract class IrOperatorImpl(val debugName: String): IrOperator { - override fun toString(): String = debugName - } - - object SAFE_CALL : IrOperatorImpl("SAFE_CALL") - - object UMINUS : IrOperatorImpl("UMINUS") - object UPLUS : IrOperatorImpl("UPLUS") - object EXCL : IrOperatorImpl("EXCL") - object EXCLEXCL : IrOperatorImpl("EXCLEXCL") - - object ELVIS : IrOperatorImpl("ELVIS") - - object LT : IrOperatorImpl("LT") - object GT : IrOperatorImpl("GT") - object LTEQ : IrOperatorImpl("LTEQ") - object GTEQ : IrOperatorImpl("GTEQ") - - object EQEQ : IrOperatorImpl("EQEQ") - object EQEQEQ : IrOperatorImpl("EQEQEQ") - object EXCLEQ : IrOperatorImpl("EXCLEQ") - object EXCLEQEQ : IrOperatorImpl("EXCLEQEQ") - - object IN : IrOperatorImpl("IN") - object NOT_IN : IrOperatorImpl("NOT_IN") - object ANDAND : IrOperatorImpl("ANDAND") - object OROR : IrOperatorImpl("OROR") - - object PLUS : IrOperatorImpl("PLUS") - object MINUS : IrOperatorImpl("MINUS") - object MUL : IrOperatorImpl("MUL") - object DIV : IrOperatorImpl("DIV") - object PERC : IrOperatorImpl("PERC") - object RANGE : IrOperatorImpl("RANGE") - - object INVOKE : IrOperatorImpl("INVOKE") - object VARIABLE_AS_FUNCTION : IrOperatorImpl("VARIABLE_AS_FUNCTION") - object GET_ARRAY_ELEMENT : IrOperatorImpl("GET_ARRAY_ELEMENT") - - object PREFIX_INCR : IrOperatorImpl("PREFIX_INCR") - object PREFIX_DECR : IrOperatorImpl("PREFIX_DECR") - object POSTFIX_INCR : IrOperatorImpl("POSTFIX_INCR") - object POSTFIX_DECR : IrOperatorImpl("POSTFIX_DECR") - - object EQ : IrOperatorImpl("EQ") - object PLUSEQ : IrOperatorImpl("PLUSEQ") - object MINUSEQ : IrOperatorImpl("MINUSEQ") - object MULTEQ : IrOperatorImpl("MULTEQ") - object DIVEQ : IrOperatorImpl("DIVEQ") - object PERCEQ : IrOperatorImpl("PERCEQ") - - object ARGUMENTS_REORDERING_FOR_CALL : IrOperatorImpl("ARGUMENTS_REORDERING_FOR_CALL") - object DESTRUCTURING_DECLARATION : IrOperatorImpl("DESTRUCTURING_DECLARATION") - - object GET_PROPERTY : IrOperatorImpl("GET_PROPERTY") - object GET_LOCAL_PROPERTY : IrOperatorImpl("GET_LOCAL_PROPERTY") - - object IF : IrOperatorImpl("IF") - object WHEN : IrOperatorImpl("WHEN") - object WHEN_COMMA : IrOperatorImpl("WHEN_COMMA") - object WHILE_LOOP : IrOperatorImpl("WHILE_LOOP") - object DO_WHILE_LOOP : IrOperatorImpl("DO_WHILE_LOOP") - object FOR_LOOP : IrOperatorImpl("FOR_LOOP") - object FOR_LOOP_ITERATOR : IrOperatorImpl("FOR_LOOP_ITERATOR") - object FOR_LOOP_INNER_WHILE : IrOperatorImpl("FOR_LOOP_INNER_WHILE") - object FOR_LOOP_HAS_NEXT : IrOperatorImpl("FOR_LOOP_HAS_NEXT") - object FOR_LOOP_NEXT : IrOperatorImpl("FOR_LOOP_NEXT") - - object LAMBDA : IrOperatorImpl("LAMBDA") - object ANONYMOUS_FUNCTION : IrOperatorImpl("ANONYMOUS_FUNCTION") - object OBJECT_LITERAL : IrOperatorImpl("OBJECT_LITERAL") - - object INITIALIZE_PROPERTY_FROM_PARAMETER : IrOperatorImpl("INITIALIZE_PROPERTY_FROM_PARAMETER") - - object PROPERTY_REFERENCE_FOR_DELEGATE : IrOperatorImpl("PROPERTY_REFERENCE_FOR_DELEGATE") - - data class COMPONENT_N private constructor(val index: Int) : IrOperatorImpl("COMPONENT_$index") { - companion object { - private val precreatedComponents = Array(32) { i -> COMPONENT_N(i + 1) } - - fun withIndex(index: Int) = - if (index < precreatedComponents.size) - precreatedComponents[index - 1] - else - COMPONENT_N(index) - } - } - -} - -fun IrOperator.isAssignmentOperatorWithResult() = - when (this) { - IrOperator.PREFIX_INCR, IrOperator.PREFIX_DECR, - IrOperator.POSTFIX_INCR, IrOperator.POSTFIX_DECR -> - true - else -> - false - } diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrStatementOrigin.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrStatementOrigin.kt new file mode 100644 index 00000000000..1f72e5db190 --- /dev/null +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrStatementOrigin.kt @@ -0,0 +1,117 @@ +/* + * Copyright 2010-2016 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.kotlin.ir.expressions + +interface IrStatementOrigin { + abstract class IrStatementOriginImpl(val debugName: String): IrStatementOrigin { + override fun toString(): String = debugName + } + + object SAFE_CALL : IrStatementOriginImpl("SAFE_CALL") + + object UMINUS : IrStatementOriginImpl("UMINUS") + object UPLUS : IrStatementOriginImpl("UPLUS") + object EXCL : IrStatementOriginImpl("EXCL") + object EXCLEXCL : IrStatementOriginImpl("EXCLEXCL") + + object ELVIS : IrStatementOriginImpl("ELVIS") + + object LT : IrStatementOriginImpl("LT") + object GT : IrStatementOriginImpl("GT") + object LTEQ : IrStatementOriginImpl("LTEQ") + object GTEQ : IrStatementOriginImpl("GTEQ") + + object EQEQ : IrStatementOriginImpl("EQEQ") + object EQEQEQ : IrStatementOriginImpl("EQEQEQ") + object EXCLEQ : IrStatementOriginImpl("EXCLEQ") + object EXCLEQEQ : IrStatementOriginImpl("EXCLEQEQ") + + object IN : IrStatementOriginImpl("IN") + object NOT_IN : IrStatementOriginImpl("NOT_IN") + object ANDAND : IrStatementOriginImpl("ANDAND") + object OROR : IrStatementOriginImpl("OROR") + + object PLUS : IrStatementOriginImpl("PLUS") + object MINUS : IrStatementOriginImpl("MINUS") + object MUL : IrStatementOriginImpl("MUL") + object DIV : IrStatementOriginImpl("DIV") + object PERC : IrStatementOriginImpl("PERC") + object RANGE : IrStatementOriginImpl("RANGE") + + object INVOKE : IrStatementOriginImpl("INVOKE") + object VARIABLE_AS_FUNCTION : IrStatementOriginImpl("VARIABLE_AS_FUNCTION") + object GET_ARRAY_ELEMENT : IrStatementOriginImpl("GET_ARRAY_ELEMENT") + + object PREFIX_INCR : IrStatementOriginImpl("PREFIX_INCR") + object PREFIX_DECR : IrStatementOriginImpl("PREFIX_DECR") + object POSTFIX_INCR : IrStatementOriginImpl("POSTFIX_INCR") + object POSTFIX_DECR : IrStatementOriginImpl("POSTFIX_DECR") + + object EQ : IrStatementOriginImpl("EQ") + object PLUSEQ : IrStatementOriginImpl("PLUSEQ") + object MINUSEQ : IrStatementOriginImpl("MINUSEQ") + object MULTEQ : IrStatementOriginImpl("MULTEQ") + object DIVEQ : IrStatementOriginImpl("DIVEQ") + object PERCEQ : IrStatementOriginImpl("PERCEQ") + + object ARGUMENTS_REORDERING_FOR_CALL : IrStatementOriginImpl("ARGUMENTS_REORDERING_FOR_CALL") + object DESTRUCTURING_DECLARATION : IrStatementOriginImpl("DESTRUCTURING_DECLARATION") + + object GET_PROPERTY : IrStatementOriginImpl("GET_PROPERTY") + object GET_LOCAL_PROPERTY : IrStatementOriginImpl("GET_LOCAL_PROPERTY") + + object IF : IrStatementOriginImpl("IF") + object WHEN : IrStatementOriginImpl("WHEN") + object WHEN_COMMA : IrStatementOriginImpl("WHEN_COMMA") + object WHILE_LOOP : IrStatementOriginImpl("WHILE_LOOP") + object DO_WHILE_LOOP : IrStatementOriginImpl("DO_WHILE_LOOP") + object FOR_LOOP : IrStatementOriginImpl("FOR_LOOP") + object FOR_LOOP_ITERATOR : IrStatementOriginImpl("FOR_LOOP_ITERATOR") + object FOR_LOOP_INNER_WHILE : IrStatementOriginImpl("FOR_LOOP_INNER_WHILE") + object FOR_LOOP_HAS_NEXT : IrStatementOriginImpl("FOR_LOOP_HAS_NEXT") + object FOR_LOOP_NEXT : IrStatementOriginImpl("FOR_LOOP_NEXT") + + object LAMBDA : IrStatementOriginImpl("LAMBDA") + object ANONYMOUS_FUNCTION : IrStatementOriginImpl("ANONYMOUS_FUNCTION") + object OBJECT_LITERAL : IrStatementOriginImpl("OBJECT_LITERAL") + + object INITIALIZE_PROPERTY_FROM_PARAMETER : IrStatementOriginImpl("INITIALIZE_PROPERTY_FROM_PARAMETER") + + object PROPERTY_REFERENCE_FOR_DELEGATE : IrStatementOriginImpl("PROPERTY_REFERENCE_FOR_DELEGATE") + + data class COMPONENT_N private constructor(val index: Int) : IrStatementOriginImpl("COMPONENT_$index") { + companion object { + private val precreatedComponents = Array(32) { i -> COMPONENT_N(i + 1) } + + fun withIndex(index: Int) = + if (index < precreatedComponents.size) + precreatedComponents[index - 1] + else + COMPONENT_N(index) + } + } + +} + +fun IrStatementOrigin.isAssignmentOperatorWithResult() = + when (this) { + IrStatementOrigin.PREFIX_INCR, IrStatementOrigin.PREFIX_DECR, + IrStatementOrigin.POSTFIX_INCR, IrStatementOrigin.POSTFIX_DECR -> + true + else -> + false + } diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrVariableAccessExpression.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrVariableAccessExpression.kt index 3a2dae6487c..692899003c9 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrVariableAccessExpression.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrVariableAccessExpression.kt @@ -20,7 +20,7 @@ import org.jetbrains.kotlin.descriptors.VariableDescriptor interface IrVariableAccessExpression : IrDeclarationReference { override val descriptor: VariableDescriptor - val operator: IrOperator? + val origin: IrStatementOrigin? } interface IrGetVariable : IrVariableAccessExpression, IrExpressionWithCopy { diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrWhen.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrWhen.kt index 3471268d1a8..bbc5ff4bc85 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrWhen.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrWhen.kt @@ -17,7 +17,7 @@ package org.jetbrains.kotlin.ir.expressions interface IrWhen : IrExpression { - val operator: IrOperator? + val origin: IrStatementOrigin? val branchesCount: Int fun getNthCondition(n: Int): IrExpression? fun getNthResult(n: Int): IrExpression? diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrBlockImpl.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrBlockImpl.kt index d2411a51a91..3d49f33c76d 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrBlockImpl.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrBlockImpl.kt @@ -19,14 +19,14 @@ package org.jetbrains.kotlin.ir.expressions.impl import org.jetbrains.kotlin.ir.IrStatement import org.jetbrains.kotlin.ir.detach import org.jetbrains.kotlin.ir.expressions.IrBlock -import org.jetbrains.kotlin.ir.expressions.IrOperator +import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin import org.jetbrains.kotlin.ir.visitors.IrElementVisitor import org.jetbrains.kotlin.types.KotlinType -class IrBlockImpl(startOffset: Int, endOffset: Int, type: KotlinType, operator: IrOperator? = null): - IrContainerExpressionBase(startOffset, endOffset, type, operator), IrBlock { - constructor(startOffset: Int, endOffset: Int, type: KotlinType, operator: IrOperator?, statements: List) : - this(startOffset, endOffset, type, operator) { +class IrBlockImpl(startOffset: Int, endOffset: Int, type: KotlinType, origin: IrStatementOrigin? = null): + IrContainerExpressionBase(startOffset, endOffset, type, origin), IrBlock { + constructor(startOffset: Int, endOffset: Int, type: KotlinType, origin: IrStatementOrigin?, statements: List) : + this(startOffset, endOffset, type, origin) { addAll(statements) } diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrCallImpl.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrCallImpl.kt index 61dd8d3c08f..6988fd4aa93 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrCallImpl.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrCallImpl.kt @@ -19,7 +19,7 @@ package org.jetbrains.kotlin.ir.expressions.impl import org.jetbrains.kotlin.descriptors.CallableDescriptor import org.jetbrains.kotlin.descriptors.ClassDescriptor import org.jetbrains.kotlin.ir.expressions.IrCall -import org.jetbrains.kotlin.ir.expressions.IrOperator +import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin import org.jetbrains.kotlin.ir.visitors.IrElementVisitor import org.jetbrains.kotlin.types.KotlinType @@ -28,7 +28,7 @@ class IrCallImpl( endOffset: Int, type: KotlinType, override val descriptor: CallableDescriptor, - override val operator: IrOperator? = null, + override val origin: IrStatementOrigin? = null, override val superQualifier: ClassDescriptor? = null ) : IrGeneralCallBase(startOffset, endOffset, type, descriptor.valueParameters.size), IrCall { override fun accept(visitor: IrElementVisitor, data: D): R = diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrCallableReferenceImpl.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrCallableReferenceImpl.kt index 19827dea983..fb27bf0f014 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrCallableReferenceImpl.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrCallableReferenceImpl.kt @@ -18,7 +18,7 @@ package org.jetbrains.kotlin.ir.expressions.impl import org.jetbrains.kotlin.descriptors.CallableDescriptor import org.jetbrains.kotlin.ir.expressions.IrCallableReference -import org.jetbrains.kotlin.ir.expressions.IrOperator +import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin import org.jetbrains.kotlin.ir.visitors.IrElementVisitor import org.jetbrains.kotlin.types.KotlinType @@ -27,8 +27,8 @@ class IrCallableReferenceImpl( endOffset: Int, type: KotlinType, override val descriptor: CallableDescriptor, - override val operator: IrOperator? = null -) : IrGeneralCallBase(startOffset, endOffset, type, descriptor.valueParameters.size, operator), IrCallableReference { + override val origin: IrStatementOrigin? = null +) : IrGeneralCallBase(startOffset, endOffset, type, descriptor.valueParameters.size, origin), IrCallableReference { override fun accept(visitor: IrElementVisitor, data: D): R { return visitor.visitCallableReference(this, data) } diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrCompositeImpl.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrCompositeImpl.kt index 08ef7a49419..5f8ebd57275 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrCompositeImpl.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrCompositeImpl.kt @@ -18,15 +18,15 @@ package org.jetbrains.kotlin.ir.expressions.impl import org.jetbrains.kotlin.ir.IrStatement import org.jetbrains.kotlin.ir.expressions.IrComposite -import org.jetbrains.kotlin.ir.expressions.IrOperator +import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin import org.jetbrains.kotlin.ir.visitors.IrElementVisitor import org.jetbrains.kotlin.types.KotlinType -class IrCompositeImpl(startOffset: Int, endOffset: Int, type: KotlinType, operator: IrOperator? = null) : - IrContainerExpressionBase(startOffset, endOffset, type, operator), IrComposite { - constructor(startOffset: Int, endOffset: Int, type: KotlinType, operator: IrOperator?, statements: List) : - this(startOffset, endOffset, type, operator) { +class IrCompositeImpl(startOffset: Int, endOffset: Int, type: KotlinType, origin: IrStatementOrigin? = null) : + IrContainerExpressionBase(startOffset, endOffset, type, origin), IrComposite { + constructor(startOffset: Int, endOffset: Int, type: KotlinType, origin: IrStatementOrigin?, statements: List) : + this(startOffset, endOffset, type, origin) { addAll(statements) } diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrContainerExpressionBase.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrContainerExpressionBase.kt index b7721b242e5..c7ac137f461 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrContainerExpressionBase.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrContainerExpressionBase.kt @@ -17,12 +17,12 @@ package org.jetbrains.kotlin.ir.expressions.impl import org.jetbrains.kotlin.ir.* -import org.jetbrains.kotlin.ir.expressions.IrOperator +import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin import org.jetbrains.kotlin.ir.expressions.IrContainerExpression import org.jetbrains.kotlin.types.KotlinType import java.util.* -abstract class IrContainerExpressionBase(startOffset: Int, endOffset: Int, type: KotlinType, override val operator: IrOperator? = null): +abstract class IrContainerExpressionBase(startOffset: Int, endOffset: Int, type: KotlinType, override val origin: IrStatementOrigin? = null): IrExpressionBase(startOffset, endOffset, type), IrContainerExpression { override val statements: MutableList = ArrayList(2) diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrDoWhileLoopImpl.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrDoWhileLoopImpl.kt index 7be88fe672a..3e202927c21 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrDoWhileLoopImpl.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrDoWhileLoopImpl.kt @@ -19,24 +19,16 @@ package org.jetbrains.kotlin.ir.expressions.impl import org.jetbrains.kotlin.ir.expressions.IrDoWhileLoop import org.jetbrains.kotlin.ir.expressions.IrExpression import org.jetbrains.kotlin.ir.expressions.impl.IrLoopBase -import org.jetbrains.kotlin.ir.expressions.IrOperator +import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin import org.jetbrains.kotlin.ir.visitors.IrElementVisitor import org.jetbrains.kotlin.types.KotlinType -class IrDoWhileLoopImpl( - startOffset: Int, - endOffset: Int, - type : KotlinType, - operator: IrOperator? -) : IrLoopBase(startOffset, endOffset, type, operator), IrDoWhileLoop { +class IrDoWhileLoopImpl(startOffset: Int, endOffset: Int, type : KotlinType, origin: IrStatementOrigin?) : + IrLoopBase(startOffset, endOffset, type, origin), IrDoWhileLoop { constructor( - startOffset: Int, - endOffset: Int, - type: KotlinType, - operator: IrOperator?, - body: IrExpression, - condition: IrExpression - ) : this(startOffset, endOffset, type, operator) { + startOffset: Int, endOffset: Int, type: KotlinType, origin: IrStatementOrigin?, + body: IrExpression, condition: IrExpression + ) : this(startOffset, endOffset, type, origin) { this.condition = condition this.body = body } diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrEmptyBlockImpl.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrEmptyBlockImpl.kt index 2cfb2a958c9..284620d75ec 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrEmptyBlockImpl.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrEmptyBlockImpl.kt @@ -19,12 +19,12 @@ package org.jetbrains.kotlin.ir.expressions.impl import org.jetbrains.kotlin.ir.IrElement import org.jetbrains.kotlin.ir.IrStatement import org.jetbrains.kotlin.ir.expressions.IrBlock -import org.jetbrains.kotlin.ir.expressions.IrOperator +import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin import org.jetbrains.kotlin.ir.throwNoSuchSlot import org.jetbrains.kotlin.ir.visitors.IrElementVisitor import org.jetbrains.kotlin.types.KotlinType -class IrEmptyBlockImpl(startOffset: Int, endOffset: Int, type: KotlinType, override val operator: IrOperator? = null) : +class IrEmptyBlockImpl(startOffset: Int, endOffset: Int, type: KotlinType, override val origin: IrStatementOrigin? = null) : IrExpressionBase(startOffset, endOffset, type), IrBlock { override val statements: List get() = emptyList() diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrFieldExpressionBase.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrFieldExpressionBase.kt index 5822ec6eca9..cf15b62177c 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrFieldExpressionBase.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrFieldExpressionBase.kt @@ -21,15 +21,12 @@ import org.jetbrains.kotlin.descriptors.PropertyDescriptor import org.jetbrains.kotlin.ir.* import org.jetbrains.kotlin.ir.expressions.IrFieldAccessExpression import org.jetbrains.kotlin.ir.expressions.IrExpression -import org.jetbrains.kotlin.ir.expressions.IrOperator +import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin import org.jetbrains.kotlin.types.KotlinType abstract class IrFieldExpressionBase( - startOffset: Int, - endOffset: Int, - descriptor: PropertyDescriptor, - type: KotlinType, - override val operator: IrOperator? = null, + startOffset: Int, endOffset: Int, descriptor: PropertyDescriptor, type: KotlinType, + override val origin: IrStatementOrigin? = null, override val superQualifier: ClassDescriptor? = null ) : IrDeclarationReferenceBase(startOffset, endOffset, type, descriptor), IrFieldAccessExpression { override final var receiver: IrExpression? = null diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrGeneralCallBase.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrGeneralCallBase.kt index 55a8afcb44e..caf1436230b 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrGeneralCallBase.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrGeneralCallBase.kt @@ -22,16 +22,14 @@ import org.jetbrains.kotlin.ir.detach import org.jetbrains.kotlin.ir.expressions.IrExpression import org.jetbrains.kotlin.ir.expressions.IrGeneralCall import org.jetbrains.kotlin.ir.expressions.impl.IrMemberAccessExpressionBase -import org.jetbrains.kotlin.ir.expressions.IrOperator +import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin import org.jetbrains.kotlin.ir.visitors.IrElementVisitor import org.jetbrains.kotlin.types.KotlinType abstract class IrGeneralCallBase( - startOffset: Int, - endOffset: Int, - type: KotlinType, + startOffset: Int, endOffset: Int, type: KotlinType, numArguments: Int, - override val operator: IrOperator? = null + override val origin: IrStatementOrigin? = null ) : IrMemberAccessExpressionBase(startOffset, endOffset, type), IrGeneralCall { protected val argumentsByParameterIndex = arrayOfNulls(numArguments) diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrGetFieldImpl.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrGetFieldImpl.kt index 149d231959a..7b121997a26 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrGetFieldImpl.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrGetFieldImpl.kt @@ -21,24 +21,19 @@ import org.jetbrains.kotlin.descriptors.PropertyDescriptor import org.jetbrains.kotlin.ir.IrElement import org.jetbrains.kotlin.ir.expressions.IrExpression import org.jetbrains.kotlin.ir.expressions.IrGetField -import org.jetbrains.kotlin.ir.expressions.IrOperator +import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin import org.jetbrains.kotlin.ir.visitors.IrElementVisitor class IrGetFieldImpl( - startOffset: Int, - endOffset: Int, - descriptor: PropertyDescriptor, - operator: IrOperator? = null, + startOffset: Int, endOffset: Int, descriptor: PropertyDescriptor, + origin: IrStatementOrigin? = null, superQualifier: ClassDescriptor? = null -) : IrFieldExpressionBase(startOffset, endOffset, descriptor, descriptor.type, operator, superQualifier), IrGetField { +) : IrFieldExpressionBase(startOffset, endOffset, descriptor, descriptor.type, origin, superQualifier), IrGetField { constructor( - startOffset: Int, - endOffset: Int, - descriptor: PropertyDescriptor, - receiver: IrExpression?, - operator: IrOperator? = null, + startOffset: Int, endOffset: Int, descriptor: PropertyDescriptor, receiver: IrExpression?, + origin: IrStatementOrigin? = null, superQualifier: ClassDescriptor? = null - ) : this(startOffset, endOffset, descriptor, operator, superQualifier) { + ) : this(startOffset, endOffset, descriptor, origin, superQualifier) { this.receiver = receiver } diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrGetVariableImpl.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrGetVariableImpl.kt index beadf19f8fc..ead91e86965 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrGetVariableImpl.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrGetVariableImpl.kt @@ -18,19 +18,17 @@ package org.jetbrains.kotlin.ir.expressions.impl import org.jetbrains.kotlin.descriptors.VariableDescriptor import org.jetbrains.kotlin.ir.expressions.IrGetVariable -import org.jetbrains.kotlin.ir.expressions.IrOperator +import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin import org.jetbrains.kotlin.ir.expressions.impl.IrTerminalDeclarationReferenceBase import org.jetbrains.kotlin.ir.visitors.IrElementVisitor class IrGetVariableImpl( - startOffset: Int, - endOffset: Int, - descriptor: VariableDescriptor, - override val operator: IrOperator? = null + startOffset: Int, endOffset: Int, descriptor: VariableDescriptor, + override val origin: IrStatementOrigin? = null ) : IrTerminalDeclarationReferenceBase(startOffset, endOffset, descriptor.type, descriptor), IrGetVariable { override fun accept(visitor: IrElementVisitor, data: D): R = visitor.visitGetVariable(this, data) override fun copy(): IrGetVariable = - IrGetVariableImpl(startOffset, endOffset, descriptor, operator) + IrGetVariableImpl(startOffset, endOffset, descriptor, origin) } \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrIfThenElseImpl.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrIfThenElseImpl.kt index c694655d621..105e74cea48 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrIfThenElseImpl.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrIfThenElseImpl.kt @@ -18,26 +18,22 @@ package org.jetbrains.kotlin.ir.expressions.impl import org.jetbrains.kotlin.ir.* import org.jetbrains.kotlin.ir.expressions.IrExpression -import org.jetbrains.kotlin.ir.expressions.IrOperator +import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin import org.jetbrains.kotlin.ir.expressions.IrWhen import org.jetbrains.kotlin.ir.visitors.IrElementVisitor import org.jetbrains.kotlin.types.KotlinType class IrIfThenElseImpl( - startOffset: Int, - endOffset: Int, - type: KotlinType, - override val operator: IrOperator? = null + startOffset: Int, endOffset: Int, type: KotlinType, + override val origin: IrStatementOrigin? = null ) : IrExpressionBase(startOffset, endOffset, type), IrWhen { constructor( - startOffset: Int, - endOffset: Int, - type: KotlinType, + startOffset: Int, endOffset: Int, type: KotlinType, condition: IrExpression, thenBranch: IrExpression, elseBranch: IrExpression? = null, - operator: IrOperator? = null - ) : this(startOffset, endOffset, type, operator) { + origin: IrStatementOrigin? = null + ) : this(startOffset, endOffset, type, origin) { this.condition = condition this.thenBranch = thenBranch this.elseBranch = elseBranch diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrLoopBase.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrLoopBase.kt index 5b74747952f..b8f9243c3ff 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrLoopBase.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrLoopBase.kt @@ -19,7 +19,7 @@ package org.jetbrains.kotlin.ir.expressions.impl import org.jetbrains.kotlin.ir.* import org.jetbrains.kotlin.ir.expressions.IrExpression import org.jetbrains.kotlin.ir.expressions.IrLoop -import org.jetbrains.kotlin.ir.expressions.IrOperator +import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin import org.jetbrains.kotlin.ir.expressions.impl.IrExpressionBase import org.jetbrains.kotlin.types.KotlinType @@ -27,7 +27,7 @@ abstract class IrLoopBase( startOffset: Int, endOffset: Int, type: KotlinType, - override val operator: IrOperator? + override val origin: IrStatementOrigin? ) : IrExpressionBase(startOffset, endOffset, type), IrLoop { override var label: String? = null diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrPrimitiveCall.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrPrimitiveCall.kt index 154f3443f1e..5394670ccd5 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrPrimitiveCall.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrPrimitiveCall.kt @@ -21,7 +21,7 @@ import org.jetbrains.kotlin.descriptors.ClassDescriptor import org.jetbrains.kotlin.ir.* import org.jetbrains.kotlin.ir.expressions.IrCall import org.jetbrains.kotlin.ir.expressions.IrExpression -import org.jetbrains.kotlin.ir.expressions.IrOperator +import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin import org.jetbrains.kotlin.ir.visitors.IrElementVisitor import java.lang.AssertionError import java.lang.UnsupportedOperationException @@ -29,7 +29,7 @@ import java.lang.UnsupportedOperationException abstract class IrPrimitiveCallBase( startOffset: Int, endOffset: Int, - override val operator: IrOperator, + override val origin: IrStatementOrigin, override val descriptor: CallableDescriptor ) : IrExpressionBase(startOffset, endOffset, descriptor.returnType!!), IrCall { override val superQualifier: ClassDescriptor? get() = null @@ -56,12 +56,8 @@ abstract class IrPrimitiveCallBase( } } -class IrNullaryPrimitiveImpl constructor( - startOffset: Int, - endOffset: Int, - operator: IrOperator, - descriptor: CallableDescriptor -) : IrPrimitiveCallBase(startOffset, endOffset, operator, descriptor) { +class IrNullaryPrimitiveImpl constructor(startOffset: Int, endOffset: Int, origin: IrStatementOrigin, descriptor: CallableDescriptor) : + IrPrimitiveCallBase(startOffset, endOffset, origin, descriptor) { override fun getChild(slot: Int): IrElement? = null override fun replaceChild(slot: Int, newChild: IrElement) { @@ -73,19 +69,11 @@ class IrNullaryPrimitiveImpl constructor( } } -class IrUnaryPrimitiveImpl private constructor( - startOffset: Int, - endOffset: Int, - operator: IrOperator, - descriptor: CallableDescriptor -) : IrPrimitiveCallBase(startOffset, endOffset, operator, descriptor) { - constructor( - startOffset: Int, - endOffset: Int, - operator: IrOperator, - descriptor: CallableDescriptor, - argument: IrExpression - ) : this(startOffset, endOffset, operator, descriptor) { +class IrUnaryPrimitiveImpl private constructor(startOffset: Int, endOffset: Int, origin: IrStatementOrigin, descriptor: CallableDescriptor) : + IrPrimitiveCallBase(startOffset, endOffset, origin, descriptor) { + constructor(startOffset: Int, endOffset: Int, origin: IrStatementOrigin, descriptor: CallableDescriptor, + argument: IrExpression + ) : this(startOffset, endOffset, origin, descriptor) { this.argument = argument } @@ -116,20 +104,12 @@ class IrUnaryPrimitiveImpl private constructor( } } -class IrBinaryPrimitiveImpl( - startOffset: Int, - endOffset: Int, - operator: IrOperator, - descriptor: CallableDescriptor -) : IrPrimitiveCallBase(startOffset, endOffset, operator, descriptor) { +class IrBinaryPrimitiveImpl(startOffset: Int, endOffset: Int, origin: IrStatementOrigin, descriptor: CallableDescriptor) : + IrPrimitiveCallBase(startOffset, endOffset, origin, descriptor) { constructor( - startOffset: Int, - endOffset: Int, - operator: IrOperator, - descriptor: CallableDescriptor, - argument0: IrExpression, - argument1: IrExpression - ) : this(startOffset, endOffset, operator, descriptor) { + startOffset: Int, endOffset: Int, origin: IrStatementOrigin, descriptor: CallableDescriptor, + argument0: IrExpression, argument1: IrExpression + ) : this(startOffset, endOffset, origin, descriptor) { this.argument0 = argument0 this.argument1 = argument1 } diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrPropertyAccessorCall.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrPropertyAccessorCall.kt index 76e2af4631c..3a721f964f3 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrPropertyAccessorCall.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrPropertyAccessorCall.kt @@ -21,15 +21,14 @@ import org.jetbrains.kotlin.descriptors.ClassDescriptor import org.jetbrains.kotlin.ir.* import org.jetbrains.kotlin.ir.expressions.IrCall import org.jetbrains.kotlin.ir.expressions.IrExpression -import org.jetbrains.kotlin.ir.expressions.IrOperator +import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin import org.jetbrains.kotlin.ir.expressions.impl.IrMemberAccessExpressionBase import org.jetbrains.kotlin.ir.visitors.IrElementVisitor abstract class IrPropertyAccessorCallBase( - startOffset: Int, - endOffset: Int, + startOffset: Int, endOffset: Int, override val descriptor: CallableDescriptor, - override val operator: IrOperator? = null, + override val origin: IrStatementOrigin? = null, override val superQualifier: ClassDescriptor? = null ) : IrMemberAccessExpressionBase(startOffset, endOffset, descriptor.returnType!!), IrCall { override fun accept(visitor: IrElementVisitor, data: D): R { @@ -37,22 +36,16 @@ abstract class IrPropertyAccessorCallBase( } } -class IrGetterCallImpl( - startOffset: Int, - endOffset: Int, - descriptor: CallableDescriptor, - operator: IrOperator? = null, - superQualifier: ClassDescriptor? = null -) : IrPropertyAccessorCallBase(startOffset, endOffset, descriptor, operator, superQualifier), IrCall { - constructor( - startOffset: Int, - endOffset: Int, - descriptor: CallableDescriptor, - dispatchReceiver: IrExpression?, - extensionReceiver: IrExpression?, - operator: IrOperator? = null, - superQualifier: ClassDescriptor? = null - ) : this(startOffset, endOffset, descriptor, operator, superQualifier) { +class IrGetterCallImpl(startOffset: Int, endOffset: Int, descriptor: CallableDescriptor, + origin: IrStatementOrigin? = null, + superQualifier: ClassDescriptor? = null +) : IrPropertyAccessorCallBase(startOffset, endOffset, descriptor, origin, superQualifier), IrCall { + constructor(startOffset: Int, endOffset: Int, descriptor: CallableDescriptor, + dispatchReceiver: IrExpression?, + extensionReceiver: IrExpression?, + origin: IrStatementOrigin? = null, + superQualifier: ClassDescriptor? = null + ) : this(startOffset, endOffset, descriptor, origin, superQualifier) { this.dispatchReceiver = dispatchReceiver this.extensionReceiver = extensionReceiver } @@ -68,23 +61,17 @@ class IrGetterCallImpl( } } -class IrSetterCallImpl( - startOffset: Int, - endOffset: Int, - descriptor: CallableDescriptor, - operator: IrOperator? = null, - superQualifier: ClassDescriptor? = null -) : IrPropertyAccessorCallBase(startOffset, endOffset, descriptor, operator, superQualifier), IrCall { - constructor( - startOffset: Int, - endOffset: Int, - descriptor: CallableDescriptor, - dispatchReceiver: IrExpression?, - extensionReceiver: IrExpression?, - argument: IrExpression, - operator: IrOperator? = null, - superQualifier: ClassDescriptor? = null - ) : this(startOffset, endOffset, descriptor, operator, superQualifier) { +class IrSetterCallImpl(startOffset: Int, endOffset: Int, descriptor: CallableDescriptor, + origin: IrStatementOrigin? = null, + superQualifier: ClassDescriptor? = null +) : IrPropertyAccessorCallBase(startOffset, endOffset, descriptor, origin, superQualifier), IrCall { + constructor(startOffset: Int, endOffset: Int, descriptor: CallableDescriptor, + dispatchReceiver: IrExpression?, + extensionReceiver: IrExpression?, + argument: IrExpression, + origin: IrStatementOrigin? = null, + superQualifier: ClassDescriptor? = null + ) : this(startOffset, endOffset, descriptor, origin, superQualifier) { this.dispatchReceiver = dispatchReceiver this.extensionReceiver = extensionReceiver putArgument(SETTER_ARGUMENT_INDEX, argument) diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrSetFieldImpl.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrSetFieldImpl.kt index c8189bb484e..dadab958c3e 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrSetFieldImpl.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrSetFieldImpl.kt @@ -20,28 +20,25 @@ import org.jetbrains.kotlin.descriptors.ClassDescriptor import org.jetbrains.kotlin.descriptors.PropertyDescriptor import org.jetbrains.kotlin.ir.* import org.jetbrains.kotlin.ir.expressions.IrExpression -import org.jetbrains.kotlin.ir.expressions.IrOperator +import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin import org.jetbrains.kotlin.ir.expressions.IrSetField import org.jetbrains.kotlin.ir.expressions.impl.IrFieldExpressionBase import org.jetbrains.kotlin.ir.visitors.IrElementVisitor import org.jetbrains.kotlin.types.typeUtil.builtIns class IrSetFieldImpl( - startOffset: Int, - endOffset: Int, + startOffset: Int, endOffset: Int, descriptor: PropertyDescriptor, - operator: IrOperator? = null, + origin: IrStatementOrigin? = null, superQualifier: ClassDescriptor? = null -) : IrFieldExpressionBase(startOffset, endOffset, descriptor, descriptor.type.builtIns.unitType, operator, superQualifier), IrSetField { +) : IrFieldExpressionBase(startOffset, endOffset, descriptor, descriptor.type.builtIns.unitType, origin, superQualifier), IrSetField { constructor( - startOffset: Int, - endOffset: Int, - descriptor: PropertyDescriptor, + startOffset: Int, endOffset: Int, descriptor: PropertyDescriptor, receiver: IrExpression?, value: IrExpression, - operator: IrOperator? = null, + origin: IrStatementOrigin? = null, superQualifier: ClassDescriptor? = null - ) : this(startOffset, endOffset, descriptor, operator, superQualifier) { + ) : this(startOffset, endOffset, descriptor, origin, superQualifier) { this.receiver = receiver this.value = value } diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrSetVariableImpl.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrSetVariableImpl.kt index 2fa20a8528a..9377e75c7d4 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrSetVariableImpl.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrSetVariableImpl.kt @@ -19,25 +19,22 @@ package org.jetbrains.kotlin.ir.expressions.impl import org.jetbrains.kotlin.descriptors.VariableDescriptor import org.jetbrains.kotlin.ir.* import org.jetbrains.kotlin.ir.expressions.IrExpression -import org.jetbrains.kotlin.ir.expressions.IrOperator +import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin import org.jetbrains.kotlin.ir.expressions.IrSetVariable import org.jetbrains.kotlin.ir.expressions.impl.IrExpressionBase import org.jetbrains.kotlin.ir.visitors.IrElementVisitor import org.jetbrains.kotlin.resolve.descriptorUtil.builtIns class IrSetVariableImpl( - startOffset: Int, - endOffset: Int, + startOffset: Int, endOffset: Int, override val descriptor: VariableDescriptor, - override val operator: IrOperator? + override val origin: IrStatementOrigin? ) : IrExpressionBase(startOffset, endOffset, descriptor.builtIns.unitType), IrSetVariable { constructor( - startOffset: Int, - endOffset: Int, - descriptor: VariableDescriptor, + startOffset: Int, endOffset: Int, descriptor: VariableDescriptor, value: IrExpression, - operator: IrOperator? - ) : this(startOffset, endOffset, descriptor, operator) { + origin: IrStatementOrigin? + ) : this(startOffset, endOffset, descriptor, origin) { this.value = value } diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrWhenImpl.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrWhenImpl.kt index dae9070178f..8e9369691fe 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrWhenImpl.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrWhenImpl.kt @@ -18,7 +18,7 @@ package org.jetbrains.kotlin.ir.expressions.impl import org.jetbrains.kotlin.ir.* import org.jetbrains.kotlin.ir.expressions.IrExpression -import org.jetbrains.kotlin.ir.expressions.IrOperator +import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin import org.jetbrains.kotlin.ir.expressions.IrWhen import org.jetbrains.kotlin.ir.expressions.impl.IrExpressionBase import org.jetbrains.kotlin.ir.visitors.IrElementVisitor @@ -29,7 +29,7 @@ class IrWhenImpl( startOffset: Int, endOffset: Int, type: KotlinType, - override val operator: IrOperator? = null + override val origin: IrStatementOrigin? = null ) : IrExpressionBase(startOffset, endOffset, type), IrWhen { private val branchParts = ArrayList() diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrWhileLoopImpl.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrWhileLoopImpl.kt index 5f31a5db86e..d825c58c849 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrWhileLoopImpl.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrWhileLoopImpl.kt @@ -16,31 +16,13 @@ package org.jetbrains.kotlin.ir.expressions.impl -import org.jetbrains.kotlin.ir.expressions.IrExpression -import org.jetbrains.kotlin.ir.expressions.IrOperator +import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin import org.jetbrains.kotlin.ir.expressions.IrWhileLoop -import org.jetbrains.kotlin.ir.expressions.impl.IrLoopBase import org.jetbrains.kotlin.ir.visitors.IrElementVisitor import org.jetbrains.kotlin.types.KotlinType -class IrWhileLoopImpl( - startOffset: Int, - endOffset: Int, - type: KotlinType, - operator: IrOperator? -) : IrLoopBase(startOffset, endOffset, type, operator), IrWhileLoop { - constructor( - startOffset: Int, - endOffset: Int, - type: KotlinType, - operator: IrOperator?, - condition: IrExpression, - body: IrExpression - ) : this(startOffset, endOffset, type, operator) { - this.condition = condition - this.body = body - } - +class IrWhileLoopImpl(startOffset: Int, endOffset: Int, type: KotlinType, origin: IrStatementOrigin?) : + IrLoopBase(startOffset, endOffset, type, origin), IrWhileLoop { override fun accept(visitor: IrElementVisitor, data: D): R { return visitor.visitWhileLoop(this, data) } diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/RenderIrElement.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/RenderIrElement.kt index 7105e100f88..eb2d56d9eea 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/RenderIrElement.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/RenderIrElement.kt @@ -94,10 +94,10 @@ class RenderIrElementVisitor : IrElementVisitor { "SPREAD_ELEMENT" override fun visitBlock(expression: IrBlock, data: Nothing?): String = - "BLOCK type=${expression.type.render()} operator=${expression.operator}" + "BLOCK type=${expression.type.render()} origin=${expression.origin}" override fun visitComposite(expression: IrComposite, data: Nothing?): String = - "COMPOSITE type=${expression.type.render()} operator=${expression.operator}" + "COMPOSITE type=${expression.type.render()} origin=${expression.origin}" override fun visitReturn(expression: IrReturn, data: Nothing?): String = "RETURN type=${expression.type.render()} from='${expression.returnTarget.ref()}'" @@ -110,7 +110,7 @@ class RenderIrElementVisitor : IrElementVisitor { override fun visitCall(expression: IrCall, data: Nothing?): String = "CALL '${expression.descriptor.ref()}' ${expression.renderSuperQualifier()}" + - "type=${expression.type.render()} operator=${expression.operator}" + "type=${expression.type.render()} origin=${expression.origin}" private fun IrCall.renderSuperQualifier(): String = superQualifier?.let { "superQualifier=${it.name} " } ?: "" @@ -129,16 +129,16 @@ class RenderIrElementVisitor : IrElementVisitor { "INSTANCE_INITIALIZER_CALL classDescriptor='${expression.classDescriptor.ref()}'" override fun visitGetVariable(expression: IrGetVariable, data: Nothing?): String = - "GET_VAR '${expression.descriptor.ref()}' type=${expression.type.render()} operator=${expression.operator}" + "GET_VAR '${expression.descriptor.ref()}' type=${expression.type.render()} origin=${expression.origin}" override fun visitSetVariable(expression: IrSetVariable, data: Nothing?): String = - "SET_VAR '${expression.descriptor.ref()}' type=${expression.type.render()} operator=${expression.operator}" + "SET_VAR '${expression.descriptor.ref()}' type=${expression.type.render()} origin=${expression.origin}" override fun visitGetField(expression: IrGetField, data: Nothing?): String = - "GET_BACKING_FIELD '${expression.descriptor.ref()}' type=${expression.type.render()} operator=${expression.operator}" + "GET_BACKING_FIELD '${expression.descriptor.ref()}' type=${expression.type.render()} origin=${expression.origin}" override fun visitSetField(expression: IrSetField, data: Nothing?): String = - "SET_BACKING_FIELD '${expression.descriptor.ref()}' type=${expression.type.render()} operator=${expression.operator}" + "SET_BACKING_FIELD '${expression.descriptor.ref()}' type=${expression.type.render()} origin=${expression.origin}" override fun visitGetObjectValue(expression: IrGetObjectValue, data: Nothing?): String = "GET_OBJECT '${expression.descriptor.ref()}' type=${expression.type.render()}" @@ -150,16 +150,16 @@ class RenderIrElementVisitor : IrElementVisitor { "STRING_CONCATENATION type=${expression.type.render()}" override fun visitTypeOperator(expression: IrTypeOperatorCall, data: Nothing?): String = - "TYPE_OP operator=${expression.operator} typeOperand=${expression.typeOperand.render()}" + "TYPE_OP origin=${expression.operator} typeOperand=${expression.typeOperand.render()}" override fun visitWhen(expression: IrWhen, data: Nothing?): String = - "WHEN type=${expression.type.render()} operator=${expression.operator}" + "WHEN type=${expression.type.render()} origin=${expression.origin}" override fun visitWhileLoop(loop: IrWhileLoop, data: Nothing?): String = - "WHILE label=${loop.label} operator=${loop.operator}" + "WHILE label=${loop.label} origin=${loop.origin}" override fun visitDoWhileLoop(loop: IrDoWhileLoop, data: Nothing?): String = - "DO_WHILE label=${loop.label} operator=${loop.operator}" + "DO_WHILE label=${loop.label} origin=${loop.origin}" override fun visitBreak(jump: IrBreak, data: Nothing?): String = "BREAK label=${jump.label} loop.label=${jump.loop.label} depth=${jump.getDepth()}" @@ -171,7 +171,7 @@ class RenderIrElementVisitor : IrElementVisitor { "THROW type=${expression.type.render()}" override fun visitCallableReference(expression: IrCallableReference, data: Nothing?): String = - "CALLABLE_REFERENCE '${expression.descriptor.ref()}' type=${expression.type.render()} operator=${expression.operator}" + "CALLABLE_REFERENCE '${expression.descriptor.ref()}' type=${expression.type.render()} origin=${expression.origin}" override fun visitClassReference(expression: IrClassReference, data: Nothing?): String = "CLASS_REFERENCE '${expression.descriptor.ref()}' type=${expression.type.render()}" diff --git a/compiler/testData/ir/irText/classes/argumentReorderingInDelegatingConstructorCall.txt b/compiler/testData/ir/irText/classes/argumentReorderingInDelegatingConstructorCall.txt index 02400790379..25428af7933 100644 --- a/compiler/testData/ir/irText/classes/argumentReorderingInDelegatingConstructorCall.txt +++ b/compiler/testData/ir/irText/classes/argumentReorderingInDelegatingConstructorCall.txt @@ -7,52 +7,52 @@ FILE /argumentReorderingInDelegatingConstructorCall.kt PROPERTY public final val x: kotlin.Int FIELD PROPERTY_BACKING_FIELD public final val x: kotlin.Int EXPRESSION_BODY - GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER + GET_VAR 'value-parameter x: Int' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'x: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'x: Int' type=kotlin.Int origin=null receiver: THIS of 'Base' type=Base PROPERTY public final val y: kotlin.Int FIELD PROPERTY_BACKING_FIELD public final val y: kotlin.Int EXPRESSION_BODY - GET_VAR 'value-parameter y: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER + GET_VAR 'value-parameter y: Int' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'y: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'y: Int' type=kotlin.Int origin=null receiver: THIS of 'Base' type=Base CLASS CLASS Test1 CONSTRUCTOR public constructor Test1(xx: kotlin.Int, yy: kotlin.Int) BLOCK_BODY - BLOCK type=Base operator=ARGUMENTS_REORDERING_FOR_CALL + BLOCK type=Base origin=ARGUMENTS_REORDERING_FOR_CALL VAR IR_TEMPORARY_VARIABLE val tmp0_y: kotlin.Int - GET_VAR 'value-parameter yy: Int' type=kotlin.Int operator=null + GET_VAR 'value-parameter yy: Int' type=kotlin.Int origin=null VAR IR_TEMPORARY_VARIABLE val tmp1_x: kotlin.Int - GET_VAR 'value-parameter xx: Int' type=kotlin.Int operator=null + GET_VAR 'value-parameter xx: Int' type=kotlin.Int origin=null DELEGATING_CONSTRUCTOR_CALL 'constructor Base(Int, Int)' - x: GET_VAR 'tmp1_x: Int' type=kotlin.Int operator=null - y: GET_VAR 'tmp0_y: Int' type=kotlin.Int operator=null + x: GET_VAR 'tmp1_x: Int' type=kotlin.Int origin=null + y: GET_VAR 'tmp0_y: Int' type=kotlin.Int origin=null INSTANCE_INITIALIZER_CALL classDescriptor='Test1' CLASS CLASS Test2 CONSTRUCTOR public constructor Test2(xx: kotlin.Int, yy: kotlin.Int) BLOCK_BODY - BLOCK type=Base operator=ARGUMENTS_REORDERING_FOR_CALL + BLOCK type=Base origin=ARGUMENTS_REORDERING_FOR_CALL VAR IR_TEMPORARY_VARIABLE val tmp0_y: kotlin.Int - GET_VAR 'value-parameter yy: Int' type=kotlin.Int operator=null + GET_VAR 'value-parameter yy: Int' type=kotlin.Int origin=null VAR IR_TEMPORARY_VARIABLE val tmp1_x: kotlin.Int - GET_VAR 'value-parameter xx: Int' type=kotlin.Int operator=null + GET_VAR 'value-parameter xx: Int' type=kotlin.Int origin=null DELEGATING_CONSTRUCTOR_CALL 'constructor Base(Int, Int)' - x: GET_VAR 'tmp1_x: Int' type=kotlin.Int operator=null - y: GET_VAR 'tmp0_y: Int' type=kotlin.Int operator=null + x: GET_VAR 'tmp1_x: Int' type=kotlin.Int origin=null + y: GET_VAR 'tmp0_y: Int' type=kotlin.Int origin=null INSTANCE_INITIALIZER_CALL classDescriptor='Test2' CONSTRUCTOR public constructor Test2(xxx: kotlin.Int, yyy: kotlin.Int, a: kotlin.Any) BLOCK_BODY - BLOCK type=Test2 operator=ARGUMENTS_REORDERING_FOR_CALL + BLOCK type=Test2 origin=ARGUMENTS_REORDERING_FOR_CALL VAR IR_TEMPORARY_VARIABLE val tmp0_yy: kotlin.Int - GET_VAR 'value-parameter yyy: Int' type=kotlin.Int operator=null + GET_VAR 'value-parameter yyy: Int' type=kotlin.Int origin=null VAR IR_TEMPORARY_VARIABLE val tmp1_xx: kotlin.Int - GET_VAR 'value-parameter xxx: Int' type=kotlin.Int operator=null + GET_VAR 'value-parameter xxx: Int' type=kotlin.Int origin=null DELEGATING_CONSTRUCTOR_CALL 'constructor Test2(Int, Int)' - xx: GET_VAR 'tmp1_xx: Int' type=kotlin.Int operator=null - yy: GET_VAR 'tmp0_yy: Int' type=kotlin.Int operator=null + xx: GET_VAR 'tmp1_xx: Int' type=kotlin.Int origin=null + yy: GET_VAR 'tmp0_yy: Int' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/classes/classMembers.txt b/compiler/testData/ir/irText/classes/classMembers.txt index 0cf8481a1da..fc95a9e62e3 100644 --- a/compiler/testData/ir/irText/classes/classMembers.txt +++ b/compiler/testData/ir/irText/classes/classMembers.txt @@ -9,26 +9,26 @@ FILE /classMembers.kt PROPERTY public final val y: kotlin.Int FIELD PROPERTY_BACKING_FIELD public final val y: kotlin.Int EXPRESSION_BODY - GET_VAR 'value-parameter y: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER + GET_VAR 'value-parameter y: Int' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'y: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'y: Int' type=kotlin.Int origin=null receiver: THIS of 'C' type=C PROPERTY public final var z: kotlin.Int FIELD PROPERTY_BACKING_FIELD public final var z: kotlin.Int EXPRESSION_BODY - GET_VAR 'value-parameter z: Int = ...' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER + GET_VAR 'value-parameter z: Int = ...' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'z: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'z: Int' type=kotlin.Int origin=null receiver: THIS of 'C' type=C FUN DEFAULT_PROPERTY_ACCESSOR public final fun (: kotlin.Int): kotlin.Unit BLOCK_BODY - SET_BACKING_FIELD 'z: Int' type=kotlin.Unit operator=null + SET_BACKING_FIELD 'z: Int' type=kotlin.Unit origin=null receiver: THIS of 'C' type=C - value: GET_VAR 'value-parameter : Int' type=kotlin.Int operator=null + value: GET_VAR 'value-parameter : Int' type=kotlin.Int origin=null CONSTRUCTOR public constructor C() BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'constructor C(Int, Int, Int = ...)' @@ -42,7 +42,7 @@ FILE /classMembers.kt FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'property: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'property: Int' type=kotlin.Int origin=null receiver: THIS of 'C' type=C PROPERTY public final val propertyWithGet: kotlin.Int FUN public final fun (): kotlin.Int @@ -53,20 +53,20 @@ FILE /classMembers.kt FUN public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - CALL '(): Int' type=kotlin.Int operator=GET_PROPERTY + CALL '(): Int' type=kotlin.Int origin=GET_PROPERTY $this: THIS of 'C' type=C FUN public final fun (value: kotlin.Int): kotlin.Unit BLOCK_BODY - CALL '(Int): Unit' type=kotlin.Unit operator=EQ + CALL '(Int): Unit' type=kotlin.Unit origin=EQ $this: THIS of 'C' type=C - : GET_VAR 'value-parameter value: Int' type=kotlin.Int operator=null + : GET_VAR 'value-parameter value: Int' type=kotlin.Int origin=null FUN public final fun function(): kotlin.Unit BLOCK_BODY - CALL 'println(Any?): Unit' type=kotlin.Unit operator=null + CALL 'println(Any?): Unit' type=kotlin.Unit origin=null message: CONST String type=kotlin.String value='1' FUN public final fun kotlin.Int.memberExtensionFunction(): kotlin.Unit BLOCK_BODY - CALL 'println(Any?): Unit' type=kotlin.Unit operator=null + CALL 'println(Any?): Unit' type=kotlin.Unit origin=null message: CONST String type=kotlin.String value='2' CLASS CLASS NestedClass CONSTRUCTOR public constructor NestedClass() @@ -75,18 +75,18 @@ FILE /classMembers.kt INSTANCE_INITIALIZER_CALL classDescriptor='NestedClass' FUN public final fun function(): kotlin.Unit BLOCK_BODY - CALL 'println(Any?): Unit' type=kotlin.Unit operator=null + CALL 'println(Any?): Unit' type=kotlin.Unit origin=null message: CONST String type=kotlin.String value='3' FUN public final fun kotlin.Int.memberExtensionFunction(): kotlin.Unit BLOCK_BODY - CALL 'println(Any?): Unit' type=kotlin.Unit operator=null + CALL 'println(Any?): Unit' type=kotlin.Unit origin=null message: CONST String type=kotlin.String value='4' CLASS INTERFACE NestedInterface FUN public abstract fun foo(): kotlin.Unit FUN public open fun bar(): kotlin.Unit BLOCK_BODY RETURN type=kotlin.Nothing from='bar(): Unit' - CALL 'foo(): Unit' type=kotlin.Unit operator=null + CALL 'foo(): Unit' type=kotlin.Unit origin=null $this: THIS of 'NestedInterface' type=C.NestedInterface CLASS OBJECT companion object of C CONSTRUCTOR private constructor Companion() diff --git a/compiler/testData/ir/irText/classes/dataClasses.txt b/compiler/testData/ir/irText/classes/dataClasses.txt index 34ef703dcf1..e1ec1dc0ed7 100644 --- a/compiler/testData/ir/irText/classes/dataClasses.txt +++ b/compiler/testData/ir/irText/classes/dataClasses.txt @@ -7,136 +7,136 @@ FILE /dataClasses.kt PROPERTY public final val x: kotlin.Int FIELD PROPERTY_BACKING_FIELD public final val x: kotlin.Int EXPRESSION_BODY - GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER + GET_VAR 'value-parameter x: Int' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'x: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'x: Int' type=kotlin.Int origin=null receiver: THIS of 'Test1' type=Test1 PROPERTY public final val y: kotlin.String FIELD PROPERTY_BACKING_FIELD public final val y: kotlin.String EXPRESSION_BODY - GET_VAR 'value-parameter y: String' type=kotlin.String operator=INITIALIZE_PROPERTY_FROM_PARAMETER + GET_VAR 'value-parameter y: String' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='(): String' - GET_BACKING_FIELD 'y: String' type=kotlin.String operator=null + GET_BACKING_FIELD 'y: String' type=kotlin.String origin=null receiver: THIS of 'Test1' type=Test1 PROPERTY public final val z: kotlin.Any FIELD PROPERTY_BACKING_FIELD public final val z: kotlin.Any EXPRESSION_BODY - GET_VAR 'value-parameter z: Any' type=kotlin.Any operator=INITIALIZE_PROPERTY_FROM_PARAMETER + GET_VAR 'value-parameter z: Any' type=kotlin.Any origin=INITIALIZE_PROPERTY_FROM_PARAMETER FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Any BLOCK_BODY RETURN type=kotlin.Nothing from='(): Any' - GET_BACKING_FIELD 'z: Any' type=kotlin.Any operator=null + GET_BACKING_FIELD 'z: Any' type=kotlin.Any origin=null receiver: THIS of 'Test1' type=Test1 FUN GENERATED_DATA_CLASS_MEMBER public final operator fun component1(): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='component1(): Int' - CALL '(): Int' type=kotlin.Int operator=GET_PROPERTY + CALL '(): Int' type=kotlin.Int origin=GET_PROPERTY $this: THIS of 'Test1' type=Test1 FUN GENERATED_DATA_CLASS_MEMBER public final operator fun component2(): kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='component2(): String' - CALL '(): String' type=kotlin.String operator=GET_PROPERTY + CALL '(): String' type=kotlin.String origin=GET_PROPERTY $this: THIS of 'Test1' type=Test1 FUN GENERATED_DATA_CLASS_MEMBER public final operator fun component3(): kotlin.Any BLOCK_BODY RETURN type=kotlin.Nothing from='component3(): Any' - CALL '(): Any' type=kotlin.Any operator=GET_PROPERTY + CALL '(): Any' type=kotlin.Any origin=GET_PROPERTY $this: THIS of 'Test1' type=Test1 FUN GENERATED_DATA_CLASS_MEMBER public final fun copy(x: kotlin.Int = ..., y: kotlin.String = ..., z: kotlin.Any = ...): Test1 BLOCK_BODY RETURN type=kotlin.Nothing from='copy(Int = ..., String = ..., Any = ...): Test1' - CALL 'constructor Test1(Int, String, Any)' type=Test1 operator=null - x: GET_VAR 'value-parameter x: Int = ...' type=kotlin.Int operator=null - y: GET_VAR 'value-parameter y: String = ...' type=kotlin.String operator=null - z: GET_VAR 'value-parameter z: Any = ...' type=kotlin.Any operator=null + CALL 'constructor Test1(Int, String, Any)' type=Test1 origin=null + x: GET_VAR 'value-parameter x: Int = ...' type=kotlin.Int origin=null + y: GET_VAR 'value-parameter y: String = ...' type=kotlin.String origin=null + z: GET_VAR 'value-parameter z: Any = ...' type=kotlin.Any origin=null FUN GENERATED_DATA_CLASS_MEMBER public open override fun toString(): kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='toString(): String' STRING_CONCATENATION type=kotlin.String CONST String type=kotlin.String value='Test1(' CONST String type=kotlin.String value='x=' - CALL '(): Int' type=kotlin.Int operator=GET_PROPERTY + CALL '(): Int' type=kotlin.Int origin=GET_PROPERTY $this: THIS of 'Test1' type=Test1 CONST String type=kotlin.String value=', ' CONST String type=kotlin.String value='y=' - CALL '(): String' type=kotlin.String operator=GET_PROPERTY + CALL '(): String' type=kotlin.String origin=GET_PROPERTY $this: THIS of 'Test1' type=Test1 CONST String type=kotlin.String value=', ' CONST String type=kotlin.String value='z=' - CALL '(): Any' type=kotlin.Any operator=GET_PROPERTY + CALL '(): Any' type=kotlin.Any origin=GET_PROPERTY $this: THIS of 'Test1' type=Test1 CONST String type=kotlin.String value=')' FUN GENERATED_DATA_CLASS_MEMBER public open override fun hashCode(): kotlin.Int BLOCK_BODY VAR IR_TEMPORARY_VARIABLE val tmp0_result: kotlin.Int CONST Int type=kotlin.Int value='0' - SET_VAR 'tmp0_result: Int' type=kotlin.Unit operator=EQ - CALL 'hashCode(): Int' type=kotlin.Int operator=null - $this: CALL '(): Int' type=kotlin.Int operator=GET_PROPERTY + SET_VAR 'tmp0_result: Int' type=kotlin.Unit origin=EQ + CALL 'hashCode(): Int' type=kotlin.Int origin=null + $this: CALL '(): Int' type=kotlin.Int origin=GET_PROPERTY $this: THIS of 'Test1' type=Test1 - SET_VAR 'tmp0_result: Int' type=kotlin.Unit operator=EQ - CALL 'plus(Int): Int' type=kotlin.Int operator=null - $this: CALL 'times(Int): Int' type=kotlin.Int operator=null - $this: GET_VAR 'tmp0_result: Int' type=kotlin.Int operator=null + SET_VAR 'tmp0_result: Int' type=kotlin.Unit origin=EQ + CALL 'plus(Int): Int' type=kotlin.Int origin=null + $this: CALL 'times(Int): Int' type=kotlin.Int origin=null + $this: GET_VAR 'tmp0_result: Int' type=kotlin.Int origin=null other: CONST Int type=kotlin.Int value='31' - other: CALL 'hashCode(): Int' type=kotlin.Int operator=null - $this: CALL '(): String' type=kotlin.String operator=GET_PROPERTY + other: CALL 'hashCode(): Int' type=kotlin.Int origin=null + $this: CALL '(): String' type=kotlin.String origin=GET_PROPERTY $this: THIS of 'Test1' type=Test1 - SET_VAR 'tmp0_result: Int' type=kotlin.Unit operator=EQ - CALL 'plus(Int): Int' type=kotlin.Int operator=null - $this: CALL 'times(Int): Int' type=kotlin.Int operator=null - $this: GET_VAR 'tmp0_result: Int' type=kotlin.Int operator=null + SET_VAR 'tmp0_result: Int' type=kotlin.Unit origin=EQ + CALL 'plus(Int): Int' type=kotlin.Int origin=null + $this: CALL 'times(Int): Int' type=kotlin.Int origin=null + $this: GET_VAR 'tmp0_result: Int' type=kotlin.Int origin=null other: CONST Int type=kotlin.Int value='31' - other: CALL 'hashCode(): Int' type=kotlin.Int operator=null - $this: CALL '(): Any' type=kotlin.Any operator=GET_PROPERTY + other: CALL 'hashCode(): Int' type=kotlin.Int origin=null + $this: CALL '(): Any' type=kotlin.Any origin=GET_PROPERTY $this: THIS of 'Test1' type=Test1 RETURN type=kotlin.Nothing from='hashCode(): Int' - GET_VAR 'tmp0_result: Int' type=kotlin.Int operator=null + GET_VAR 'tmp0_result: Int' type=kotlin.Int origin=null FUN GENERATED_DATA_CLASS_MEMBER public open override fun equals(other: kotlin.Any?): kotlin.Boolean BLOCK_BODY - WHEN type=kotlin.Unit operator=null - if: CALL 'EQEQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQEQ + WHEN type=kotlin.Unit origin=null + if: CALL 'EQEQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQEQ arg0: THIS of 'Test1' type=Test1 - arg1: GET_VAR 'value-parameter other: Any?' type=kotlin.Any? operator=null + arg1: GET_VAR 'value-parameter other: Any?' type=kotlin.Any? origin=null then: RETURN type=kotlin.Nothing from='equals(Any?): Boolean' CONST Boolean type=kotlin.Boolean value='true' - WHEN type=kotlin.Unit operator=null - if: TYPE_OP operator=NOT_INSTANCEOF typeOperand=Test1 - GET_VAR 'value-parameter other: Any?' type=kotlin.Any? operator=null + WHEN type=kotlin.Unit origin=null + if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=Test1 + GET_VAR 'value-parameter other: Any?' type=kotlin.Any? origin=null then: RETURN type=kotlin.Nothing from='equals(Any?): Boolean' CONST Boolean type=kotlin.Boolean value='false' VAR IR_TEMPORARY_VARIABLE val tmp0_other_with_cast: Test1 - TYPE_OP operator=CAST typeOperand=Test1 - GET_VAR 'value-parameter other: Any?' type=kotlin.Any? operator=null - WHEN type=kotlin.Unit operator=null - if: CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean operator=EXCLEQ - arg0: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EXCLEQ - arg0: CALL '(): Int' type=kotlin.Int operator=GET_PROPERTY + TYPE_OP origin=CAST typeOperand=Test1 + GET_VAR 'value-parameter other: Any?' type=kotlin.Any? origin=null + WHEN type=kotlin.Unit origin=null + if: CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL '(): Int' type=kotlin.Int origin=GET_PROPERTY $this: THIS of 'Test1' type=Test1 - arg1: CALL '(): Int' type=kotlin.Int operator=GET_PROPERTY - $this: GET_VAR 'tmp0_other_with_cast: Test1' type=Test1 operator=null + arg1: CALL '(): Int' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR 'tmp0_other_with_cast: Test1' type=Test1 origin=null then: RETURN type=kotlin.Nothing from='equals(Any?): Boolean' CONST Boolean type=kotlin.Boolean value='false' - WHEN type=kotlin.Unit operator=null - if: CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean operator=EXCLEQ - arg0: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EXCLEQ - arg0: CALL '(): String' type=kotlin.String operator=GET_PROPERTY + WHEN type=kotlin.Unit origin=null + if: CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL '(): String' type=kotlin.String origin=GET_PROPERTY $this: THIS of 'Test1' type=Test1 - arg1: CALL '(): String' type=kotlin.String operator=GET_PROPERTY - $this: GET_VAR 'tmp0_other_with_cast: Test1' type=Test1 operator=null + arg1: CALL '(): String' type=kotlin.String origin=GET_PROPERTY + $this: GET_VAR 'tmp0_other_with_cast: Test1' type=Test1 origin=null then: RETURN type=kotlin.Nothing from='equals(Any?): Boolean' CONST Boolean type=kotlin.Boolean value='false' - WHEN type=kotlin.Unit operator=null - if: CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean operator=EXCLEQ - arg0: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EXCLEQ - arg0: CALL '(): Any' type=kotlin.Any operator=GET_PROPERTY + WHEN type=kotlin.Unit origin=null + if: CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL '(): Any' type=kotlin.Any origin=GET_PROPERTY $this: THIS of 'Test1' type=Test1 - arg1: CALL '(): Any' type=kotlin.Any operator=GET_PROPERTY - $this: GET_VAR 'tmp0_other_with_cast: Test1' type=Test1 operator=null + arg1: CALL '(): Any' type=kotlin.Any origin=GET_PROPERTY + $this: GET_VAR 'tmp0_other_with_cast: Test1' type=Test1 origin=null then: RETURN type=kotlin.Nothing from='equals(Any?): Boolean' CONST Boolean type=kotlin.Boolean value='false' RETURN type=kotlin.Nothing from='equals(Any?): Boolean' diff --git a/compiler/testData/ir/irText/classes/delegatedImplementation.txt b/compiler/testData/ir/irText/classes/delegatedImplementation.txt index 674d2a2d0aa..2cb5973e27f 100644 --- a/compiler/testData/ir/irText/classes/delegatedImplementation.txt +++ b/compiler/testData/ir/irText/classes/delegatedImplementation.txt @@ -24,7 +24,7 @@ FILE /delegatedImplementation.kt FUN public fun otherImpl(x0: kotlin.String, y0: kotlin.Int): IOther BLOCK_BODY RETURN type=kotlin.Nothing from='otherImpl(String, Int): IOther' - BLOCK type=otherImpl. operator=OBJECT_LITERAL + BLOCK type=otherImpl. origin=OBJECT_LITERAL CLASS CLASS CONSTRUCTOR public constructor () BLOCK_BODY @@ -33,26 +33,26 @@ FILE /delegatedImplementation.kt PROPERTY public open override val x: kotlin.String FIELD PROPERTY_BACKING_FIELD public open override val x: kotlin.String EXPRESSION_BODY - GET_VAR 'value-parameter x0: String' type=kotlin.String operator=null + GET_VAR 'value-parameter x0: String' type=kotlin.String origin=null FUN DEFAULT_PROPERTY_ACCESSOR public open override fun (): kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='(): String' - GET_BACKING_FIELD 'x: String' type=kotlin.String operator=null + GET_BACKING_FIELD 'x: String' type=kotlin.String origin=null receiver: THIS of '' type=otherImpl. PROPERTY public open override var y: kotlin.Int FIELD PROPERTY_BACKING_FIELD public open override var y: kotlin.Int EXPRESSION_BODY - GET_VAR 'value-parameter y0: Int' type=kotlin.Int operator=null + GET_VAR 'value-parameter y0: Int' type=kotlin.Int origin=null FUN DEFAULT_PROPERTY_ACCESSOR public open override fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'y: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'y: Int' type=kotlin.Int origin=null receiver: THIS of '' type=otherImpl. FUN DEFAULT_PROPERTY_ACCESSOR public open override fun (: kotlin.Int): kotlin.Unit BLOCK_BODY - SET_BACKING_FIELD 'y: Int' type=kotlin.Unit operator=null + SET_BACKING_FIELD 'y: Int' type=kotlin.Unit origin=null receiver: THIS of '' type=otherImpl. - value: GET_VAR 'value-parameter : Int' type=kotlin.Int operator=null + value: GET_VAR 'value-parameter : Int' type=kotlin.Int origin=null PROPERTY public open override val kotlin.Byte.z1: kotlin.Int FUN public open override fun kotlin.Byte.(): kotlin.Int BLOCK_BODY @@ -65,7 +65,7 @@ FILE /delegatedImplementation.kt CONST Int type=kotlin.Int value='2' FUN public open override fun kotlin.Byte.(value: kotlin.Int): kotlin.Unit BLOCK_BODY - CALL 'constructor ()' type=otherImpl. operator=OBJECT_LITERAL + CALL 'constructor ()' type=otherImpl. origin=OBJECT_LITERAL CLASS CLASS Test1 CONSTRUCTOR public constructor Test1() BLOCK_BODY @@ -77,18 +77,18 @@ FILE /delegatedImplementation.kt FUN DELEGATED_MEMBER public open override fun bar(): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='bar(): Int' - CALL 'bar(): Int' type=kotlin.Int operator=null - $this: GET_VAR '`Test1$IBase$delegate`: BaseImpl' type=BaseImpl operator=null + CALL 'bar(): Int' type=kotlin.Int origin=null + $this: GET_VAR '`Test1$IBase$delegate`: BaseImpl' type=BaseImpl origin=null FUN DELEGATED_MEMBER public open override fun foo(x: kotlin.Int, s: kotlin.String): kotlin.Unit BLOCK_BODY - CALL 'foo(Int, String): Unit' type=kotlin.Unit operator=null - $this: GET_VAR '`Test1$IBase$delegate`: BaseImpl' type=BaseImpl operator=null - x: GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=null - s: GET_VAR 'value-parameter s: String' type=kotlin.String operator=null + CALL 'foo(Int, String): Unit' type=kotlin.Unit origin=null + $this: GET_VAR '`Test1$IBase$delegate`: BaseImpl' type=BaseImpl origin=null + x: GET_VAR 'value-parameter x: Int' type=kotlin.Int origin=null + s: GET_VAR 'value-parameter s: String' type=kotlin.String origin=null FUN DELEGATED_MEMBER public open override fun kotlin.String.qux(): kotlin.Unit BLOCK_BODY - CALL 'qux() on String: Unit' type=kotlin.Unit operator=null - $this: GET_VAR '`Test1$IBase$delegate`: BaseImpl' type=BaseImpl operator=null + CALL 'qux() on String: Unit' type=kotlin.Unit origin=null + $this: GET_VAR '`Test1$IBase$delegate`: BaseImpl' type=BaseImpl origin=null $receiver: $RECEIVER of 'qux() on String: Unit' type=kotlin.String CLASS CLASS Test2 CONSTRUCTOR public constructor Test2() @@ -101,58 +101,58 @@ FILE /delegatedImplementation.kt FUN DELEGATED_MEMBER public open override fun bar(): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='bar(): Int' - CALL 'bar(): Int' type=kotlin.Int operator=null - $this: GET_VAR '`Test2$IBase$delegate`: BaseImpl' type=BaseImpl operator=null + CALL 'bar(): Int' type=kotlin.Int origin=null + $this: GET_VAR '`Test2$IBase$delegate`: BaseImpl' type=BaseImpl origin=null FUN DELEGATED_MEMBER public open override fun foo(x: kotlin.Int, s: kotlin.String): kotlin.Unit BLOCK_BODY - CALL 'foo(Int, String): Unit' type=kotlin.Unit operator=null - $this: GET_VAR '`Test2$IBase$delegate`: BaseImpl' type=BaseImpl operator=null - x: GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=null - s: GET_VAR 'value-parameter s: String' type=kotlin.String operator=null + CALL 'foo(Int, String): Unit' type=kotlin.Unit origin=null + $this: GET_VAR '`Test2$IBase$delegate`: BaseImpl' type=BaseImpl origin=null + x: GET_VAR 'value-parameter x: Int' type=kotlin.Int origin=null + s: GET_VAR 'value-parameter s: String' type=kotlin.String origin=null FUN DELEGATED_MEMBER public open override fun kotlin.String.qux(): kotlin.Unit BLOCK_BODY - CALL 'qux() on String: Unit' type=kotlin.Unit operator=null - $this: GET_VAR '`Test2$IBase$delegate`: BaseImpl' type=BaseImpl operator=null + CALL 'qux() on String: Unit' type=kotlin.Unit origin=null + $this: GET_VAR '`Test2$IBase$delegate`: BaseImpl' type=BaseImpl origin=null $receiver: $RECEIVER of 'qux() on String: Unit' type=kotlin.String FIELD DELEGATE val `Test2$IOther$delegate`: IOther EXPRESSION_BODY - CALL 'otherImpl(String, Int): IOther' type=IOther operator=null + CALL 'otherImpl(String, Int): IOther' type=IOther origin=null x0: CONST String type=kotlin.String value='' y0: CONST Int type=kotlin.Int value='42' PROPERTY DELEGATED_MEMBER public open override val kotlin.Byte.z1: kotlin.Int FUN DELEGATED_MEMBER public open override fun kotlin.Byte.(): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='() on Byte: Int' - CALL '() on Byte: Int' type=kotlin.Int operator=null - $this: GET_VAR '`Test2$IOther$delegate`: IOther' type=IOther operator=null + CALL '() on Byte: Int' type=kotlin.Int origin=null + $this: GET_VAR '`Test2$IOther$delegate`: IOther' type=IOther origin=null $receiver: $RECEIVER of 'z1: Int on Byte' type=kotlin.Byte PROPERTY DELEGATED_MEMBER public open override val x: kotlin.String FUN DELEGATED_MEMBER public open override fun (): kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='(): String' - CALL '(): String' type=kotlin.String operator=null - $this: GET_VAR '`Test2$IOther$delegate`: IOther' type=IOther operator=null + CALL '(): String' type=kotlin.String origin=null + $this: GET_VAR '`Test2$IOther$delegate`: IOther' type=IOther origin=null PROPERTY DELEGATED_MEMBER public open override var kotlin.Byte.z2: kotlin.Int FUN DELEGATED_MEMBER public open override fun kotlin.Byte.(): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='() on Byte: Int' - CALL '() on Byte: Int' type=kotlin.Int operator=null - $this: GET_VAR '`Test2$IOther$delegate`: IOther' type=IOther operator=null + CALL '() on Byte: Int' type=kotlin.Int origin=null + $this: GET_VAR '`Test2$IOther$delegate`: IOther' type=IOther origin=null $receiver: $RECEIVER of 'z2: Int on Byte' type=kotlin.Byte FUN DELEGATED_MEMBER public open override fun kotlin.Byte.(: kotlin.Int): kotlin.Unit BLOCK_BODY - CALL '(Int) on Byte: Unit' type=kotlin.Unit operator=null - $this: GET_VAR '`Test2$IOther$delegate`: IOther' type=IOther operator=null + CALL '(Int) on Byte: Unit' type=kotlin.Unit origin=null + $this: GET_VAR '`Test2$IOther$delegate`: IOther' type=IOther origin=null $receiver: $RECEIVER of 'z2: Int on Byte' type=kotlin.Byte - : GET_VAR 'value-parameter : Int' type=kotlin.Int operator=null + : GET_VAR 'value-parameter : Int' type=kotlin.Int origin=null PROPERTY DELEGATED_MEMBER public open override var y: kotlin.Int FUN DELEGATED_MEMBER public open override fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - CALL '(): Int' type=kotlin.Int operator=null - $this: GET_VAR '`Test2$IOther$delegate`: IOther' type=IOther operator=null + CALL '(): Int' type=kotlin.Int origin=null + $this: GET_VAR '`Test2$IOther$delegate`: IOther' type=IOther origin=null FUN DELEGATED_MEMBER public open override fun (: kotlin.Int): kotlin.Unit BLOCK_BODY - CALL '(Int): Unit' type=kotlin.Unit operator=null - $this: GET_VAR '`Test2$IOther$delegate`: IOther' type=IOther operator=null - : GET_VAR 'value-parameter : Int' type=kotlin.Int operator=null + CALL '(Int): Unit' type=kotlin.Unit origin=null + $this: GET_VAR '`Test2$IOther$delegate`: IOther' type=IOther origin=null + : GET_VAR 'value-parameter : Int' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.txt b/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.txt index 8b21367890a..8800c5c171c 100644 --- a/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.txt +++ b/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.txt @@ -21,7 +21,7 @@ FILE /delegatedImplementationWithExplicitOverride.kt GET_OBJECT 'FooBarImpl' type=FooBarImpl FUN DELEGATED_MEMBER public open override fun foo(): kotlin.Unit BLOCK_BODY - CALL 'foo(): Unit' type=kotlin.Unit operator=null - $this: GET_VAR '`C$IFooBar$delegate`: FooBarImpl' type=FooBarImpl operator=null + CALL 'foo(): Unit' type=kotlin.Unit origin=null + $this: GET_VAR '`C$IFooBar$delegate`: FooBarImpl' type=FooBarImpl origin=null FUN public open override fun bar(): kotlin.Unit BLOCK_BODY diff --git a/compiler/testData/ir/irText/classes/enum.txt b/compiler/testData/ir/irText/classes/enum.txt index caa2900f23b..f1af420a54c 100644 --- a/compiler/testData/ir/irText/classes/enum.txt +++ b/compiler/testData/ir/irText/classes/enum.txt @@ -20,11 +20,11 @@ FILE /enum.kt PROPERTY public final val x: kotlin.Int FIELD PROPERTY_BACKING_FIELD public final val x: kotlin.Int EXPRESSION_BODY - GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER + GET_VAR 'value-parameter x: Int' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'x: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'x: Int' type=kotlin.Int origin=null receiver: THIS of 'TestEnum2' type=TestEnum2 ENUM_ENTRY enum entry TEST1 init: ENUM_CONSTRUCTOR_CALL 'constructor TestEnum2(Int)' TEST1 @@ -53,7 +53,7 @@ FILE /enum.kt INSTANCE_INITIALIZER_CALL classDescriptor='TEST' FUN public open override fun foo(): kotlin.Unit BLOCK_BODY - CALL 'println(Any?): Unit' type=kotlin.Unit operator=null + CALL 'println(Any?): Unit' type=kotlin.Unit origin=null message: CONST String type=kotlin.String value='Hello, world!' FUN public abstract fun foo(): kotlin.Unit FUN ENUM_CLASS_SPECIAL_MEMBER public final fun values(): kotlin.Array @@ -68,11 +68,11 @@ FILE /enum.kt PROPERTY public final val x: kotlin.Int FIELD PROPERTY_BACKING_FIELD public final val x: kotlin.Int EXPRESSION_BODY - GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER + GET_VAR 'value-parameter x: Int' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'x: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'x: Int' type=kotlin.Int origin=null receiver: THIS of 'TestEnum4' type=TestEnum4 ENUM_ENTRY enum entry TEST1 init: ENUM_CONSTRUCTOR_CALL 'constructor TEST1()' TEST1 @@ -84,7 +84,7 @@ FILE /enum.kt INSTANCE_INITIALIZER_CALL classDescriptor='TEST1' FUN public open override fun foo(): kotlin.Unit BLOCK_BODY - CALL 'println(Any?): Unit' type=kotlin.Unit operator=null + CALL 'println(Any?): Unit' type=kotlin.Unit origin=null message: GET_ENUM_VALUE 'TEST1' type=TestEnum4 ENUM_ENTRY enum entry TEST2 init: ENUM_CONSTRUCTOR_CALL 'constructor TEST2()' TEST2 @@ -99,17 +99,17 @@ FILE /enum.kt FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'z: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'z: Int' type=kotlin.Int origin=null receiver: THIS of 'TEST2' type=TestEnum4.TEST2 ANONYMOUS_INITIALIZER TEST2 BLOCK_BODY - SET_BACKING_FIELD 'z: Int' type=kotlin.Unit operator=null + SET_BACKING_FIELD 'z: Int' type=kotlin.Unit origin=null receiver: THIS of 'TEST2' type=TestEnum4.TEST2 - value: CALL '(): Int' type=kotlin.Int operator=GET_PROPERTY + value: CALL '(): Int' type=kotlin.Int origin=GET_PROPERTY $this: THIS of 'TEST2' type=TestEnum4.TEST2 FUN public open override fun foo(): kotlin.Unit BLOCK_BODY - CALL 'println(Any?): Unit' type=kotlin.Unit operator=null + CALL 'println(Any?): Unit' type=kotlin.Unit origin=null message: GET_ENUM_VALUE 'TEST2' type=TestEnum4 FUN public abstract fun foo(): kotlin.Unit FUN ENUM_CLASS_SPECIAL_MEMBER public final fun values(): kotlin.Array diff --git a/compiler/testData/ir/irText/classes/initBlock.txt b/compiler/testData/ir/irText/classes/initBlock.txt index 93852efd50d..762e6422330 100644 --- a/compiler/testData/ir/irText/classes/initBlock.txt +++ b/compiler/testData/ir/irText/classes/initBlock.txt @@ -6,7 +6,7 @@ FILE /initBlock.kt INSTANCE_INITIALIZER_CALL classDescriptor='Test1' ANONYMOUS_INITIALIZER Test1 BLOCK_BODY - CALL 'println(): Unit' type=kotlin.Unit operator=null + CALL 'println(): Unit' type=kotlin.Unit origin=null CLASS CLASS Test2 CONSTRUCTOR public constructor Test2(x: kotlin.Int) BLOCK_BODY @@ -15,19 +15,19 @@ FILE /initBlock.kt PROPERTY public final val x: kotlin.Int FIELD PROPERTY_BACKING_FIELD public final val x: kotlin.Int EXPRESSION_BODY - GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER + GET_VAR 'value-parameter x: Int' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'x: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'x: Int' type=kotlin.Int origin=null receiver: THIS of 'Test2' type=Test2 ANONYMOUS_INITIALIZER Test2 BLOCK_BODY - CALL 'println(): Unit' type=kotlin.Unit operator=null + CALL 'println(): Unit' type=kotlin.Unit origin=null CLASS CLASS Test3 ANONYMOUS_INITIALIZER Test3 BLOCK_BODY - CALL 'println(): Unit' type=kotlin.Unit operator=null + CALL 'println(): Unit' type=kotlin.Unit origin=null CONSTRUCTOR public constructor Test3() BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'constructor Any()' @@ -35,7 +35,7 @@ FILE /initBlock.kt CLASS CLASS Test4 ANONYMOUS_INITIALIZER Test4 BLOCK_BODY - CALL 'println(Any?): Unit' type=kotlin.Unit operator=null + CALL 'println(Any?): Unit' type=kotlin.Unit origin=null message: CONST String type=kotlin.String value='1' CONSTRUCTOR public constructor Test4() BLOCK_BODY @@ -43,7 +43,7 @@ FILE /initBlock.kt INSTANCE_INITIALIZER_CALL classDescriptor='Test4' ANONYMOUS_INITIALIZER Test4 BLOCK_BODY - CALL 'println(Any?): Unit' type=kotlin.Unit operator=null + CALL 'println(Any?): Unit' type=kotlin.Unit origin=null message: CONST String type=kotlin.String value='2' CLASS CLASS Test5 CONSTRUCTOR public constructor Test5() @@ -52,7 +52,7 @@ FILE /initBlock.kt INSTANCE_INITIALIZER_CALL classDescriptor='Test5' ANONYMOUS_INITIALIZER Test5 BLOCK_BODY - CALL 'println(Any?): Unit' type=kotlin.Unit operator=null + CALL 'println(Any?): Unit' type=kotlin.Unit origin=null message: CONST String type=kotlin.String value='1' CLASS CLASS TestInner CONSTRUCTOR public constructor TestInner() @@ -61,5 +61,5 @@ FILE /initBlock.kt INSTANCE_INITIALIZER_CALL classDescriptor='TestInner' ANONYMOUS_INITIALIZER TestInner BLOCK_BODY - CALL 'println(Any?): Unit' type=kotlin.Unit operator=null + CALL 'println(Any?): Unit' type=kotlin.Unit origin=null message: CONST String type=kotlin.String value='2' diff --git a/compiler/testData/ir/irText/classes/initVal.txt b/compiler/testData/ir/irText/classes/initVal.txt index 4875a48addc..896c92b087b 100644 --- a/compiler/testData/ir/irText/classes/initVal.txt +++ b/compiler/testData/ir/irText/classes/initVal.txt @@ -7,11 +7,11 @@ FILE /initVal.kt PROPERTY public final val x: kotlin.Int FIELD PROPERTY_BACKING_FIELD public final val x: kotlin.Int EXPRESSION_BODY - GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER + GET_VAR 'value-parameter x: Int' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'x: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'x: Int' type=kotlin.Int origin=null receiver: THIS of 'TestInitValFromParameter' type=TestInitValFromParameter CLASS CLASS TestInitValInClass CONSTRUCTOR public constructor TestInitValInClass() @@ -25,7 +25,7 @@ FILE /initVal.kt FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'x: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'x: Int' type=kotlin.Int origin=null receiver: THIS of 'TestInitValInClass' type=TestInitValInClass CLASS CLASS TestInitValInInitBlock CONSTRUCTOR public constructor TestInitValInInitBlock() @@ -37,10 +37,10 @@ FILE /initVal.kt FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'x: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'x: Int' type=kotlin.Int origin=null receiver: THIS of 'TestInitValInInitBlock' type=TestInitValInInitBlock ANONYMOUS_INITIALIZER TestInitValInInitBlock BLOCK_BODY - SET_BACKING_FIELD 'x: Int' type=kotlin.Unit operator=null + SET_BACKING_FIELD 'x: Int' type=kotlin.Unit origin=null receiver: THIS of 'TestInitValInInitBlock' type=TestInitValInInitBlock value: CONST Int type=kotlin.Int value='0' diff --git a/compiler/testData/ir/irText/classes/initVar.txt b/compiler/testData/ir/irText/classes/initVar.txt index edecebd0fb3..4b7b2bb442b 100644 --- a/compiler/testData/ir/irText/classes/initVar.txt +++ b/compiler/testData/ir/irText/classes/initVar.txt @@ -7,17 +7,17 @@ FILE /initVar.kt PROPERTY public final var x: kotlin.Int FIELD PROPERTY_BACKING_FIELD public final var x: kotlin.Int EXPRESSION_BODY - GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER + GET_VAR 'value-parameter x: Int' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'x: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'x: Int' type=kotlin.Int origin=null receiver: THIS of 'TestInitVarFromParameter' type=TestInitVarFromParameter FUN DEFAULT_PROPERTY_ACCESSOR public final fun (: kotlin.Int): kotlin.Unit BLOCK_BODY - SET_BACKING_FIELD 'x: Int' type=kotlin.Unit operator=null + SET_BACKING_FIELD 'x: Int' type=kotlin.Unit origin=null receiver: THIS of 'TestInitVarFromParameter' type=TestInitVarFromParameter - value: GET_VAR 'value-parameter : Int' type=kotlin.Int operator=null + value: GET_VAR 'value-parameter : Int' type=kotlin.Int origin=null CLASS CLASS TestInitVarInClass CONSTRUCTOR public constructor TestInitVarInClass() BLOCK_BODY @@ -30,13 +30,13 @@ FILE /initVar.kt FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'x: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'x: Int' type=kotlin.Int origin=null receiver: THIS of 'TestInitVarInClass' type=TestInitVarInClass FUN DEFAULT_PROPERTY_ACCESSOR public final fun (: kotlin.Int): kotlin.Unit BLOCK_BODY - SET_BACKING_FIELD 'x: Int' type=kotlin.Unit operator=null + SET_BACKING_FIELD 'x: Int' type=kotlin.Unit origin=null receiver: THIS of 'TestInitVarInClass' type=TestInitVarInClass - value: GET_VAR 'value-parameter : Int' type=kotlin.Int operator=null + value: GET_VAR 'value-parameter : Int' type=kotlin.Int origin=null CLASS CLASS TestInitVarInInitBlock CONSTRUCTOR public constructor TestInitVarInInitBlock() BLOCK_BODY @@ -47,16 +47,16 @@ FILE /initVar.kt FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'x: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'x: Int' type=kotlin.Int origin=null receiver: THIS of 'TestInitVarInInitBlock' type=TestInitVarInInitBlock FUN DEFAULT_PROPERTY_ACCESSOR public final fun (: kotlin.Int): kotlin.Unit BLOCK_BODY - SET_BACKING_FIELD 'x: Int' type=kotlin.Unit operator=null + SET_BACKING_FIELD 'x: Int' type=kotlin.Unit origin=null receiver: THIS of 'TestInitVarInInitBlock' type=TestInitVarInInitBlock - value: GET_VAR 'value-parameter : Int' type=kotlin.Int operator=null + value: GET_VAR 'value-parameter : Int' type=kotlin.Int origin=null ANONYMOUS_INITIALIZER TestInitVarInInitBlock BLOCK_BODY - CALL '(Int): Unit' type=kotlin.Unit operator=EQ + CALL '(Int): Unit' type=kotlin.Unit origin=EQ $this: THIS of 'TestInitVarInInitBlock' type=TestInitVarInInitBlock : CONST Int type=kotlin.Int value='0' CLASS CLASS TestInitVarWithCustomSetter @@ -71,27 +71,27 @@ FILE /initVar.kt FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'x: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'x: Int' type=kotlin.Int origin=null receiver: THIS of 'TestInitVarWithCustomSetter' type=TestInitVarWithCustomSetter FUN public final fun (value: kotlin.Int): kotlin.Unit BLOCK_BODY - SET_BACKING_FIELD 'x: Int' type=kotlin.Unit operator=EQ - value: GET_VAR 'value-parameter value: Int' type=kotlin.Int operator=null + SET_BACKING_FIELD 'x: Int' type=kotlin.Unit origin=EQ + value: GET_VAR 'value-parameter value: Int' type=kotlin.Int origin=null CLASS CLASS TestInitVarWithCustomSetterWithExplicitCtor PROPERTY public final var x: kotlin.Int FIELD PROPERTY_BACKING_FIELD public final var x: kotlin.Int FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'x: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'x: Int' type=kotlin.Int origin=null receiver: THIS of 'TestInitVarWithCustomSetterWithExplicitCtor' type=TestInitVarWithCustomSetterWithExplicitCtor FUN public final fun (value: kotlin.Int): kotlin.Unit BLOCK_BODY - SET_BACKING_FIELD 'x: Int' type=kotlin.Unit operator=EQ - value: GET_VAR 'value-parameter value: Int' type=kotlin.Int operator=null + SET_BACKING_FIELD 'x: Int' type=kotlin.Unit origin=EQ + value: GET_VAR 'value-parameter value: Int' type=kotlin.Int origin=null ANONYMOUS_INITIALIZER TestInitVarWithCustomSetterWithExplicitCtor BLOCK_BODY - CALL '(Int): Unit' type=kotlin.Unit operator=EQ + CALL '(Int): Unit' type=kotlin.Unit origin=EQ $this: THIS of 'TestInitVarWithCustomSetterWithExplicitCtor' type=TestInitVarWithCustomSetterWithExplicitCtor value: CONST Int type=kotlin.Int value='0' CONSTRUCTOR public constructor TestInitVarWithCustomSetterWithExplicitCtor() @@ -104,16 +104,16 @@ FILE /initVar.kt FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'x: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'x: Int' type=kotlin.Int origin=null receiver: THIS of 'TestInitVarWithCustomSetterInCtor' type=TestInitVarWithCustomSetterInCtor FUN public final fun (value: kotlin.Int): kotlin.Unit BLOCK_BODY - SET_BACKING_FIELD 'x: Int' type=kotlin.Unit operator=EQ - value: GET_VAR 'value-parameter value: Int' type=kotlin.Int operator=null + SET_BACKING_FIELD 'x: Int' type=kotlin.Unit origin=EQ + value: GET_VAR 'value-parameter value: Int' type=kotlin.Int origin=null CONSTRUCTOR public constructor TestInitVarWithCustomSetterInCtor() BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'constructor Any()' INSTANCE_INITIALIZER_CALL classDescriptor='TestInitVarWithCustomSetterInCtor' - CALL '(Int): Unit' type=kotlin.Unit operator=EQ + CALL '(Int): Unit' type=kotlin.Unit origin=EQ $this: THIS of 'TestInitVarWithCustomSetterInCtor' type=TestInitVarWithCustomSetterInCtor value: CONST Int type=kotlin.Int value='42' diff --git a/compiler/testData/ir/irText/classes/localClasses.txt b/compiler/testData/ir/irText/classes/localClasses.txt index 063292764ee..6a5215a3c03 100644 --- a/compiler/testData/ir/irText/classes/localClasses.txt +++ b/compiler/testData/ir/irText/classes/localClasses.txt @@ -8,5 +8,5 @@ FILE /localClasses.kt INSTANCE_INITIALIZER_CALL classDescriptor='LocalClass' FUN public final fun foo(): kotlin.Unit BLOCK_BODY - CALL 'foo(): Unit' type=kotlin.Unit operator=null - $this: CALL 'constructor LocalClass()' type=outer.LocalClass operator=null + CALL 'foo(): Unit' type=kotlin.Unit origin=null + $this: CALL 'constructor LocalClass()' type=outer.LocalClass origin=null diff --git a/compiler/testData/ir/irText/classes/objectLiteralExpressions.txt b/compiler/testData/ir/irText/classes/objectLiteralExpressions.txt index e7a416a5976..a9480d97d7c 100644 --- a/compiler/testData/ir/irText/classes/objectLiteralExpressions.txt +++ b/compiler/testData/ir/irText/classes/objectLiteralExpressions.txt @@ -4,21 +4,21 @@ FILE /objectLiteralExpressions.kt PROPERTY public val test1: kotlin.Any FIELD PROPERTY_BACKING_FIELD public val test1: kotlin.Any EXPRESSION_BODY - BLOCK type=test1. operator=OBJECT_LITERAL + BLOCK type=test1. origin=OBJECT_LITERAL CLASS CLASS CONSTRUCTOR public constructor () BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'constructor Any()' INSTANCE_INITIALIZER_CALL classDescriptor='' - CALL 'constructor ()' type=test1. operator=OBJECT_LITERAL + CALL 'constructor ()' type=test1. origin=OBJECT_LITERAL FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.Any BLOCK_BODY RETURN type=kotlin.Nothing from='(): Any' - GET_BACKING_FIELD 'test1: Any' type=kotlin.Any operator=null + GET_BACKING_FIELD 'test1: Any' type=kotlin.Any origin=null PROPERTY public val test2: IFoo FIELD PROPERTY_BACKING_FIELD public val test2: IFoo EXPRESSION_BODY - BLOCK type=test2. operator=OBJECT_LITERAL + BLOCK type=test2. origin=OBJECT_LITERAL CLASS CLASS CONSTRUCTOR public constructor () BLOCK_BODY @@ -26,13 +26,13 @@ FILE /objectLiteralExpressions.kt INSTANCE_INITIALIZER_CALL classDescriptor='' FUN public open override fun foo(): kotlin.Unit BLOCK_BODY - CALL 'println(Any?): Unit' type=kotlin.Unit operator=null + CALL 'println(Any?): Unit' type=kotlin.Unit origin=null message: CONST String type=kotlin.String value='foo' - CALL 'constructor ()' type=test2. operator=OBJECT_LITERAL + CALL 'constructor ()' type=test2. origin=OBJECT_LITERAL FUN DEFAULT_PROPERTY_ACCESSOR public fun (): IFoo BLOCK_BODY RETURN type=kotlin.Nothing from='(): IFoo' - GET_BACKING_FIELD 'test2: IFoo' type=IFoo operator=null + GET_BACKING_FIELD 'test2: IFoo' type=IFoo origin=null CLASS CLASS Outer CONSTRUCTOR public constructor Outer() BLOCK_BODY @@ -46,7 +46,7 @@ FILE /objectLiteralExpressions.kt FUN public final fun test3(): Outer.Inner BLOCK_BODY RETURN type=kotlin.Nothing from='test3(): Outer.Inner' - BLOCK type=Outer.test3. operator=OBJECT_LITERAL + BLOCK type=Outer.test3. origin=OBJECT_LITERAL CLASS CLASS CONSTRUCTOR public constructor () BLOCK_BODY @@ -55,13 +55,13 @@ FILE /objectLiteralExpressions.kt INSTANCE_INITIALIZER_CALL classDescriptor='' FUN public open override fun foo(): kotlin.Unit BLOCK_BODY - CALL 'println(Any?): Unit' type=kotlin.Unit operator=null + CALL 'println(Any?): Unit' type=kotlin.Unit origin=null message: CONST String type=kotlin.String value='foo' - CALL 'constructor ()' type=Outer.test3. operator=OBJECT_LITERAL + CALL 'constructor ()' type=Outer.test3. origin=OBJECT_LITERAL FUN public fun Outer.test4(): Outer.Inner BLOCK_BODY RETURN type=kotlin.Nothing from='test4() on Outer: Outer.Inner' - BLOCK type=test4. operator=OBJECT_LITERAL + BLOCK type=test4. origin=OBJECT_LITERAL CLASS CLASS CONSTRUCTOR public constructor () BLOCK_BODY @@ -70,6 +70,6 @@ FILE /objectLiteralExpressions.kt INSTANCE_INITIALIZER_CALL classDescriptor='' FUN public open override fun foo(): kotlin.Unit BLOCK_BODY - CALL 'println(Any?): Unit' type=kotlin.Unit operator=null + CALL 'println(Any?): Unit' type=kotlin.Unit origin=null message: CONST String type=kotlin.String value='foo' - CALL 'constructor ()' type=test4. operator=OBJECT_LITERAL + CALL 'constructor ()' type=test4. origin=OBJECT_LITERAL diff --git a/compiler/testData/ir/irText/classes/objectWithInitializers.txt b/compiler/testData/ir/irText/classes/objectWithInitializers.txt index cdd56089495..d3b43d1cc5c 100644 --- a/compiler/testData/ir/irText/classes/objectWithInitializers.txt +++ b/compiler/testData/ir/irText/classes/objectWithInitializers.txt @@ -16,18 +16,18 @@ FILE /objectWithInitializers.kt FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'x: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'x: Int' type=kotlin.Int origin=null receiver: THIS of 'Test' type=Test PROPERTY public final val y: kotlin.Int FIELD PROPERTY_BACKING_FIELD public final val y: kotlin.Int FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'y: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'y: Int' type=kotlin.Int origin=null receiver: THIS of 'Test' type=Test ANONYMOUS_INITIALIZER Test BLOCK_BODY - SET_BACKING_FIELD 'y: Int' type=kotlin.Unit operator=null + SET_BACKING_FIELD 'y: Int' type=kotlin.Unit origin=null receiver: THIS of 'Test' type=Test - value: CALL '(): Int' type=kotlin.Int operator=GET_PROPERTY + value: CALL '(): Int' type=kotlin.Int origin=GET_PROPERTY $this: THIS of 'Test' type=Test diff --git a/compiler/testData/ir/irText/classes/primaryConstructor.txt b/compiler/testData/ir/irText/classes/primaryConstructor.txt index 4d30ba12f22..554b51d4c64 100644 --- a/compiler/testData/ir/irText/classes/primaryConstructor.txt +++ b/compiler/testData/ir/irText/classes/primaryConstructor.txt @@ -7,20 +7,20 @@ FILE /primaryConstructor.kt PROPERTY public final val x: kotlin.Int FIELD PROPERTY_BACKING_FIELD public final val x: kotlin.Int EXPRESSION_BODY - GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER + GET_VAR 'value-parameter x: Int' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'x: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'x: Int' type=kotlin.Int origin=null receiver: THIS of 'Test1' type=Test1 PROPERTY public final val y: kotlin.Int FIELD PROPERTY_BACKING_FIELD public final val y: kotlin.Int EXPRESSION_BODY - GET_VAR 'value-parameter y: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER + GET_VAR 'value-parameter y: Int' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'y: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'y: Int' type=kotlin.Int origin=null receiver: THIS of 'Test1' type=Test1 CLASS CLASS Test2 CONSTRUCTOR public constructor Test2(x: kotlin.Int, y: kotlin.Int) @@ -30,20 +30,20 @@ FILE /primaryConstructor.kt PROPERTY public final val y: kotlin.Int FIELD PROPERTY_BACKING_FIELD public final val y: kotlin.Int EXPRESSION_BODY - GET_VAR 'value-parameter y: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER + GET_VAR 'value-parameter y: Int' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'y: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'y: Int' type=kotlin.Int origin=null receiver: THIS of 'Test2' type=Test2 PROPERTY public final val x: kotlin.Int FIELD PROPERTY_BACKING_FIELD public final val x: kotlin.Int EXPRESSION_BODY - GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=null + GET_VAR 'value-parameter x: Int' type=kotlin.Int origin=null FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'x: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'x: Int' type=kotlin.Int origin=null receiver: THIS of 'Test2' type=Test2 CLASS CLASS Test3 CONSTRUCTOR public constructor Test3(x: kotlin.Int, y: kotlin.Int) @@ -53,21 +53,21 @@ FILE /primaryConstructor.kt PROPERTY public final val y: kotlin.Int FIELD PROPERTY_BACKING_FIELD public final val y: kotlin.Int EXPRESSION_BODY - GET_VAR 'value-parameter y: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER + GET_VAR 'value-parameter y: Int' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'y: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'y: Int' type=kotlin.Int origin=null receiver: THIS of 'Test3' type=Test3 PROPERTY public final val x: kotlin.Int FIELD PROPERTY_BACKING_FIELD public final val x: kotlin.Int FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'x: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'x: Int' type=kotlin.Int origin=null receiver: THIS of 'Test3' type=Test3 ANONYMOUS_INITIALIZER Test3 BLOCK_BODY - SET_BACKING_FIELD 'x: Int' type=kotlin.Unit operator=null + SET_BACKING_FIELD 'x: Int' type=kotlin.Unit origin=null receiver: THIS of 'Test3' type=Test3 - value: GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=null + value: GET_VAR 'value-parameter x: Int' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/classes/primaryConstructorWithSuperConstructorCall.txt b/compiler/testData/ir/irText/classes/primaryConstructorWithSuperConstructorCall.txt index 7585758066e..efa4293dd06 100644 --- a/compiler/testData/ir/irText/classes/primaryConstructorWithSuperConstructorCall.txt +++ b/compiler/testData/ir/irText/classes/primaryConstructorWithSuperConstructorCall.txt @@ -22,23 +22,23 @@ FILE /primaryConstructorWithSuperConstructorCall.kt PROPERTY public final val x: kotlin.Int FIELD PROPERTY_BACKING_FIELD public final val x: kotlin.Int EXPRESSION_BODY - GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER + GET_VAR 'value-parameter x: Int' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'x: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'x: Int' type=kotlin.Int origin=null receiver: THIS of 'TestWithDelegatingConstructor' type=TestWithDelegatingConstructor PROPERTY public final val y: kotlin.Int FIELD PROPERTY_BACKING_FIELD public final val y: kotlin.Int EXPRESSION_BODY - GET_VAR 'value-parameter y: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER + GET_VAR 'value-parameter y: Int' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'y: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'y: Int' type=kotlin.Int origin=null receiver: THIS of 'TestWithDelegatingConstructor' type=TestWithDelegatingConstructor CONSTRUCTOR public constructor TestWithDelegatingConstructor(x: kotlin.Int) BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'constructor TestWithDelegatingConstructor(Int, Int)' - x: GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=null + x: GET_VAR 'value-parameter x: Int' type=kotlin.Int origin=null y: CONST Int type=kotlin.Int value='0' diff --git a/compiler/testData/ir/irText/classes/qualifiedSuperCalls.txt b/compiler/testData/ir/irText/classes/qualifiedSuperCalls.txt index 6b05d3c5cc5..7acbab334d4 100644 --- a/compiler/testData/ir/irText/classes/qualifiedSuperCalls.txt +++ b/compiler/testData/ir/irText/classes/qualifiedSuperCalls.txt @@ -22,16 +22,16 @@ FILE /qualifiedSuperCalls.kt INSTANCE_INITIALIZER_CALL classDescriptor='CBoth' FUN public open override fun foo(): kotlin.Unit BLOCK_BODY - CALL 'foo(): Unit' superQualifier=ILeft type=kotlin.Unit operator=null + CALL 'foo(): Unit' superQualifier=ILeft type=kotlin.Unit origin=null $this: THIS of 'CBoth' type=ILeft - CALL 'foo(): Unit' superQualifier=IRight type=kotlin.Unit operator=null + CALL 'foo(): Unit' superQualifier=IRight type=kotlin.Unit origin=null $this: THIS of 'CBoth' type=IRight PROPERTY public open override val bar: kotlin.Int FUN public open override fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - CALL 'plus(Int): Int' type=kotlin.Int operator=PLUS - $this: CALL '(): Int' superQualifier=ILeft type=kotlin.Int operator=GET_PROPERTY + CALL 'plus(Int): Int' type=kotlin.Int origin=PLUS + $this: CALL '(): Int' superQualifier=ILeft type=kotlin.Int origin=GET_PROPERTY $this: THIS of 'CBoth' type=ILeft - other: CALL '(): Int' superQualifier=IRight type=kotlin.Int operator=GET_PROPERTY + other: CALL '(): Int' superQualifier=IRight type=kotlin.Int origin=GET_PROPERTY $this: THIS of 'CBoth' type=IRight diff --git a/compiler/testData/ir/irText/classes/sealedClasses.txt b/compiler/testData/ir/irText/classes/sealedClasses.txt index 8e9b90752a9..1302b0da9b5 100644 --- a/compiler/testData/ir/irText/classes/sealedClasses.txt +++ b/compiler/testData/ir/irText/classes/sealedClasses.txt @@ -12,11 +12,11 @@ FILE /sealedClasses.kt PROPERTY public final val number: kotlin.Double FIELD PROPERTY_BACKING_FIELD public final val number: kotlin.Double EXPRESSION_BODY - GET_VAR 'value-parameter number: Double' type=kotlin.Double operator=INITIALIZE_PROPERTY_FROM_PARAMETER + GET_VAR 'value-parameter number: Double' type=kotlin.Double origin=INITIALIZE_PROPERTY_FROM_PARAMETER FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Double BLOCK_BODY RETURN type=kotlin.Nothing from='(): Double' - GET_BACKING_FIELD 'number: Double' type=kotlin.Double operator=null + GET_BACKING_FIELD 'number: Double' type=kotlin.Double origin=null receiver: THIS of 'Const' type=Expr.Const CLASS CLASS Sum CONSTRUCTOR public constructor Sum(e1: Expr, e2: Expr) @@ -26,20 +26,20 @@ FILE /sealedClasses.kt PROPERTY public final val e1: Expr FIELD PROPERTY_BACKING_FIELD public final val e1: Expr EXPRESSION_BODY - GET_VAR 'value-parameter e1: Expr' type=Expr operator=INITIALIZE_PROPERTY_FROM_PARAMETER + GET_VAR 'value-parameter e1: Expr' type=Expr origin=INITIALIZE_PROPERTY_FROM_PARAMETER FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): Expr BLOCK_BODY RETURN type=kotlin.Nothing from='(): Expr' - GET_BACKING_FIELD 'e1: Expr' type=Expr operator=null + GET_BACKING_FIELD 'e1: Expr' type=Expr origin=null receiver: THIS of 'Sum' type=Expr.Sum PROPERTY public final val e2: Expr FIELD PROPERTY_BACKING_FIELD public final val e2: Expr EXPRESSION_BODY - GET_VAR 'value-parameter e2: Expr' type=Expr operator=INITIALIZE_PROPERTY_FROM_PARAMETER + GET_VAR 'value-parameter e2: Expr' type=Expr origin=INITIALIZE_PROPERTY_FROM_PARAMETER FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): Expr BLOCK_BODY RETURN type=kotlin.Nothing from='(): Expr' - GET_BACKING_FIELD 'e2: Expr' type=Expr operator=null + GET_BACKING_FIELD 'e2: Expr' type=Expr origin=null receiver: THIS of 'Sum' type=Expr.Sum CLASS OBJECT NotANumber CONSTRUCTOR private constructor NotANumber() diff --git a/compiler/testData/ir/irText/classes/secondaryConstructorWithInitializersFromClassBody.txt b/compiler/testData/ir/irText/classes/secondaryConstructorWithInitializersFromClassBody.txt index 1e8bb5a762b..c40e77bf82a 100644 --- a/compiler/testData/ir/irText/classes/secondaryConstructorWithInitializersFromClassBody.txt +++ b/compiler/testData/ir/irText/classes/secondaryConstructorWithInitializersFromClassBody.txt @@ -12,7 +12,7 @@ FILE /secondaryConstructorWithInitializersFromClassBody.kt FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'x: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'x: Int' type=kotlin.Int origin=null receiver: THIS of 'TestProperty' type=TestProperty CONSTRUCTOR public constructor TestProperty() BLOCK_BODY @@ -24,11 +24,11 @@ FILE /secondaryConstructorWithInitializersFromClassBody.kt FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'x: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'x: Int' type=kotlin.Int origin=null receiver: THIS of 'TestInitBlock' type=TestInitBlock ANONYMOUS_INITIALIZER TestInitBlock BLOCK_BODY - SET_BACKING_FIELD 'x: Int' type=kotlin.Unit operator=null + SET_BACKING_FIELD 'x: Int' type=kotlin.Unit origin=null receiver: THIS of 'TestInitBlock' type=TestInitBlock value: CONST Int type=kotlin.Int value='0' CONSTRUCTOR public constructor TestInitBlock() diff --git a/compiler/testData/ir/irText/classes/superCalls.txt b/compiler/testData/ir/irText/classes/superCalls.txt index f47ba03c018..8e7fe408527 100644 --- a/compiler/testData/ir/irText/classes/superCalls.txt +++ b/compiler/testData/ir/irText/classes/superCalls.txt @@ -13,7 +13,7 @@ FILE /superCalls.kt FUN DEFAULT_PROPERTY_ACCESSOR public open fun (): kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='(): String' - GET_BACKING_FIELD 'bar: String' type=kotlin.String operator=null + GET_BACKING_FIELD 'bar: String' type=kotlin.String origin=null receiver: THIS of 'Base' type=Base CLASS CLASS Derived CONSTRUCTOR public constructor Derived() @@ -22,11 +22,11 @@ FILE /superCalls.kt INSTANCE_INITIALIZER_CALL classDescriptor='Derived' FUN public open override fun foo(): kotlin.Unit BLOCK_BODY - CALL 'foo(): Unit' superQualifier=Base type=kotlin.Unit operator=null + CALL 'foo(): Unit' superQualifier=Base type=kotlin.Unit origin=null $this: THIS of 'Derived' type=Base PROPERTY public open override val bar: kotlin.String FUN public open override fun (): kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='(): String' - CALL '(): String' superQualifier=Base type=kotlin.String operator=GET_PROPERTY + CALL '(): String' superQualifier=Base type=kotlin.String origin=GET_PROPERTY $this: THIS of 'Derived' type=Base diff --git a/compiler/testData/ir/irText/declarations/classLevelProperties.txt b/compiler/testData/ir/irText/declarations/classLevelProperties.txt index 6ae3eece39d..6bb3c0e1be5 100644 --- a/compiler/testData/ir/irText/declarations/classLevelProperties.txt +++ b/compiler/testData/ir/irText/declarations/classLevelProperties.txt @@ -11,7 +11,7 @@ FILE /classLevelProperties.kt FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'test1: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'test1: Int' type=kotlin.Int origin=null receiver: THIS of 'C' type=C PROPERTY public final val test2: kotlin.Int FUN public final fun (): kotlin.Int @@ -25,13 +25,13 @@ FILE /classLevelProperties.kt FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'test3: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'test3: Int' type=kotlin.Int origin=null receiver: THIS of 'C' type=C FUN DEFAULT_PROPERTY_ACCESSOR public final fun (: kotlin.Int): kotlin.Unit BLOCK_BODY - SET_BACKING_FIELD 'test3: Int' type=kotlin.Unit operator=null + SET_BACKING_FIELD 'test3: Int' type=kotlin.Unit origin=null receiver: THIS of 'C' type=C - value: GET_VAR 'value-parameter : Int' type=kotlin.Int operator=null + value: GET_VAR 'value-parameter : Int' type=kotlin.Int origin=null PROPERTY public final var test4: kotlin.Int FIELD PROPERTY_BACKING_FIELD public final var test4: kotlin.Int EXPRESSION_BODY @@ -39,12 +39,12 @@ FILE /classLevelProperties.kt FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'test4: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'test4: Int' type=kotlin.Int origin=null receiver: THIS of 'C' type=C FUN public final fun (value: kotlin.Int): kotlin.Unit BLOCK_BODY - SET_BACKING_FIELD 'test4: Int' type=kotlin.Unit operator=EQ - value: GET_VAR 'value-parameter value: Int' type=kotlin.Int operator=null + SET_BACKING_FIELD 'test4: Int' type=kotlin.Unit origin=EQ + value: GET_VAR 'value-parameter value: Int' type=kotlin.Int origin=null PROPERTY public final var test5: kotlin.Int FIELD PROPERTY_BACKING_FIELD public final var test5: kotlin.Int EXPRESSION_BODY @@ -52,13 +52,13 @@ FILE /classLevelProperties.kt FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'test5: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'test5: Int' type=kotlin.Int origin=null receiver: THIS of 'C' type=C FUN private final fun (: kotlin.Int): kotlin.Unit BLOCK_BODY - SET_BACKING_FIELD 'test5: Int' type=kotlin.Unit operator=null + SET_BACKING_FIELD 'test5: Int' type=kotlin.Unit origin=null receiver: THIS of 'C' type=C - value: GET_VAR 'value-parameter : Int' type=kotlin.Int operator=null + value: GET_VAR 'value-parameter : Int' type=kotlin.Int origin=null PROPERTY public final val test6: kotlin.Int = 1 FIELD PROPERTY_BACKING_FIELD public final val test6: kotlin.Int = 1 EXPRESSION_BODY @@ -66,44 +66,44 @@ FILE /classLevelProperties.kt FUN public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'test6: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'test6: Int' type=kotlin.Int origin=null receiver: THIS of 'C' type=C PROPERTY public final val test7: kotlin.Int FIELD DELEGATE val `test7$delegate`: kotlin.Lazy EXPRESSION_BODY - CALL 'lazy(() -> Int): Lazy' type=kotlin.Lazy operator=null - initializer: BLOCK type=() -> kotlin.Int operator=LAMBDA + CALL 'lazy(() -> Int): Lazy' type=kotlin.Lazy origin=null + initializer: BLOCK type=() -> kotlin.Int origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA local final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' CONST Int type=kotlin.Int value='42' - CALLABLE_REFERENCE '(): Int' type=() -> kotlin.Int operator=LAMBDA + CALLABLE_REFERENCE '(): Int' type=() -> kotlin.Int origin=LAMBDA FUN DELEGATED_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - CALL 'getValue(Any?, KProperty<*>) on Lazy: Int' type=kotlin.Int operator=null - $receiver: GET_BACKING_FIELD '`test7$delegate`: Lazy' type=kotlin.Lazy operator=null + CALL 'getValue(Any?, KProperty<*>) on Lazy: Int' type=kotlin.Int origin=null + $receiver: GET_BACKING_FIELD '`test7$delegate`: Lazy' type=kotlin.Lazy origin=null receiver: THIS of 'C' type=C thisRef: THIS of 'C' type=C - property: CALLABLE_REFERENCE 'test7: Int' type=kotlin.reflect.KProperty1 operator=PROPERTY_REFERENCE_FOR_DELEGATE + property: CALLABLE_REFERENCE 'test7: Int' type=kotlin.reflect.KProperty1 origin=PROPERTY_REFERENCE_FOR_DELEGATE PROPERTY public final var test8: kotlin.Int FIELD DELEGATE val `test8$delegate`: java.util.HashMap EXPRESSION_BODY - CALL 'hashMapOf(vararg Pair): HashMap' type=java.util.HashMap operator=null + CALL 'hashMapOf(vararg Pair): HashMap' type=java.util.HashMap origin=null FUN DELEGATED_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - CALL 'getValue(Any?, KProperty<*>) on MutableMap: Int' type=kotlin.Int operator=null - $receiver: GET_BACKING_FIELD '`test8$delegate`: HashMap' type=java.util.HashMap operator=null + CALL 'getValue(Any?, KProperty<*>) on MutableMap: Int' type=kotlin.Int origin=null + $receiver: GET_BACKING_FIELD '`test8$delegate`: HashMap' type=java.util.HashMap origin=null receiver: THIS of 'C' type=C thisRef: THIS of 'C' type=C - property: CALLABLE_REFERENCE 'test8: Int' type=kotlin.reflect.KMutableProperty1 operator=PROPERTY_REFERENCE_FOR_DELEGATE + property: CALLABLE_REFERENCE 'test8: Int' type=kotlin.reflect.KMutableProperty1 origin=PROPERTY_REFERENCE_FOR_DELEGATE FUN DELEGATED_PROPERTY_ACCESSOR public final fun (: kotlin.Int): kotlin.Unit BLOCK_BODY RETURN type=kotlin.Nothing from='(Int): Unit' - CALL 'setValue(Any?, KProperty<*>, Int) on MutableMap: Unit' type=kotlin.Unit operator=null - $receiver: GET_BACKING_FIELD '`test8$delegate`: HashMap' type=java.util.HashMap operator=null + CALL 'setValue(Any?, KProperty<*>, Int) on MutableMap: Unit' type=kotlin.Unit origin=null + $receiver: GET_BACKING_FIELD '`test8$delegate`: HashMap' type=java.util.HashMap origin=null receiver: THIS of 'C' type=C thisRef: THIS of 'C' type=C - property: CALLABLE_REFERENCE 'test8: Int' type=kotlin.reflect.KMutableProperty1 operator=PROPERTY_REFERENCE_FOR_DELEGATE - value: GET_VAR 'value-parameter : Int' type=kotlin.Int operator=null + property: CALLABLE_REFERENCE 'test8: Int' type=kotlin.reflect.KMutableProperty1 origin=PROPERTY_REFERENCE_FOR_DELEGATE + value: GET_VAR 'value-parameter : Int' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/declarations/delegatedProperties.txt b/compiler/testData/ir/irText/declarations/delegatedProperties.txt index 93fbcf32971..100cce84103 100644 --- a/compiler/testData/ir/irText/declarations/delegatedProperties.txt +++ b/compiler/testData/ir/irText/declarations/delegatedProperties.txt @@ -2,20 +2,20 @@ FILE /delegatedProperties.kt PROPERTY public val test1: kotlin.Int FIELD DELEGATE val `test1$delegate`: kotlin.Lazy EXPRESSION_BODY - CALL 'lazy(() -> Int): Lazy' type=kotlin.Lazy operator=null - initializer: BLOCK type=() -> kotlin.Int operator=LAMBDA + CALL 'lazy(() -> Int): Lazy' type=kotlin.Lazy origin=null + initializer: BLOCK type=() -> kotlin.Int origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA local final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' CONST Int type=kotlin.Int value='42' - CALLABLE_REFERENCE '(): Int' type=() -> kotlin.Int operator=LAMBDA + CALLABLE_REFERENCE '(): Int' type=() -> kotlin.Int origin=LAMBDA FUN DELEGATED_PROPERTY_ACCESSOR public fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - CALL 'getValue(Any?, KProperty<*>) on Lazy: Int' type=kotlin.Int operator=null - $receiver: GET_BACKING_FIELD '`test1$delegate`: Lazy' type=kotlin.Lazy operator=null + CALL 'getValue(Any?, KProperty<*>) on Lazy: Int' type=kotlin.Int origin=null + $receiver: GET_BACKING_FIELD '`test1$delegate`: Lazy' type=kotlin.Lazy origin=null thisRef: CONST Null type=kotlin.Nothing? value='null' - property: CALLABLE_REFERENCE 'test1: Int' type=kotlin.reflect.KProperty0 operator=PROPERTY_REFERENCE_FOR_DELEGATE + property: CALLABLE_REFERENCE 'test1: Int' type=kotlin.reflect.KProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE CLASS CLASS C CONSTRUCTOR public constructor C(map: kotlin.collections.MutableMap) BLOCK_BODY @@ -24,68 +24,68 @@ FILE /delegatedProperties.kt PROPERTY public final val map: kotlin.collections.MutableMap FIELD PROPERTY_BACKING_FIELD public final val map: kotlin.collections.MutableMap EXPRESSION_BODY - GET_VAR 'value-parameter map: MutableMap' type=kotlin.collections.MutableMap operator=INITIALIZE_PROPERTY_FROM_PARAMETER + GET_VAR 'value-parameter map: MutableMap' type=kotlin.collections.MutableMap origin=INITIALIZE_PROPERTY_FROM_PARAMETER FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.collections.MutableMap BLOCK_BODY RETURN type=kotlin.Nothing from='(): MutableMap' - GET_BACKING_FIELD 'map: MutableMap' type=kotlin.collections.MutableMap operator=null + GET_BACKING_FIELD 'map: MutableMap' type=kotlin.collections.MutableMap origin=null receiver: THIS of 'C' type=C PROPERTY public final val test2: kotlin.Int FIELD DELEGATE val `test2$delegate`: kotlin.Lazy EXPRESSION_BODY - CALL 'lazy(() -> Int): Lazy' type=kotlin.Lazy operator=null - initializer: BLOCK type=() -> kotlin.Int operator=LAMBDA + CALL 'lazy(() -> Int): Lazy' type=kotlin.Lazy origin=null + initializer: BLOCK type=() -> kotlin.Int origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA local final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' CONST Int type=kotlin.Int value='42' - CALLABLE_REFERENCE '(): Int' type=() -> kotlin.Int operator=LAMBDA + CALLABLE_REFERENCE '(): Int' type=() -> kotlin.Int origin=LAMBDA FUN DELEGATED_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - CALL 'getValue(Any?, KProperty<*>) on Lazy: Int' type=kotlin.Int operator=null - $receiver: GET_BACKING_FIELD '`test2$delegate`: Lazy' type=kotlin.Lazy operator=null + CALL 'getValue(Any?, KProperty<*>) on Lazy: Int' type=kotlin.Int origin=null + $receiver: GET_BACKING_FIELD '`test2$delegate`: Lazy' type=kotlin.Lazy origin=null receiver: THIS of 'C' type=C thisRef: THIS of 'C' type=C - property: CALLABLE_REFERENCE 'test2: Int' type=kotlin.reflect.KProperty1 operator=PROPERTY_REFERENCE_FOR_DELEGATE + property: CALLABLE_REFERENCE 'test2: Int' type=kotlin.reflect.KProperty1 origin=PROPERTY_REFERENCE_FOR_DELEGATE PROPERTY public final var test3: kotlin.Any FIELD DELEGATE val `test3$delegate`: kotlin.collections.MutableMap EXPRESSION_BODY - CALL '(): MutableMap' type=kotlin.collections.MutableMap operator=GET_PROPERTY + CALL '(): MutableMap' type=kotlin.collections.MutableMap origin=GET_PROPERTY $this: THIS of 'C' type=C FUN DELEGATED_PROPERTY_ACCESSOR public final fun (): kotlin.Any BLOCK_BODY RETURN type=kotlin.Nothing from='(): Any' - CALL 'getValue(Any?, KProperty<*>) on MutableMap: Any' type=kotlin.Any operator=null - $receiver: GET_BACKING_FIELD '`test3$delegate`: MutableMap' type=kotlin.collections.MutableMap operator=null + CALL 'getValue(Any?, KProperty<*>) on MutableMap: Any' type=kotlin.Any origin=null + $receiver: GET_BACKING_FIELD '`test3$delegate`: MutableMap' type=kotlin.collections.MutableMap origin=null receiver: THIS of 'C' type=C thisRef: THIS of 'C' type=C - property: CALLABLE_REFERENCE 'test3: Any' type=kotlin.reflect.KMutableProperty1 operator=PROPERTY_REFERENCE_FOR_DELEGATE + property: CALLABLE_REFERENCE 'test3: Any' type=kotlin.reflect.KMutableProperty1 origin=PROPERTY_REFERENCE_FOR_DELEGATE FUN DELEGATED_PROPERTY_ACCESSOR public final fun (: kotlin.Any): kotlin.Unit BLOCK_BODY RETURN type=kotlin.Nothing from='(Any): Unit' - CALL 'setValue(Any?, KProperty<*>, Any) on MutableMap: Unit' type=kotlin.Unit operator=null - $receiver: GET_BACKING_FIELD '`test3$delegate`: MutableMap' type=kotlin.collections.MutableMap operator=null + CALL 'setValue(Any?, KProperty<*>, Any) on MutableMap: Unit' type=kotlin.Unit origin=null + $receiver: GET_BACKING_FIELD '`test3$delegate`: MutableMap' type=kotlin.collections.MutableMap origin=null receiver: THIS of 'C' type=C thisRef: THIS of 'C' type=C - property: CALLABLE_REFERENCE 'test3: Any' type=kotlin.reflect.KMutableProperty1 operator=PROPERTY_REFERENCE_FOR_DELEGATE - value: GET_VAR 'value-parameter : Any' type=kotlin.Any operator=null + property: CALLABLE_REFERENCE 'test3: Any' type=kotlin.reflect.KMutableProperty1 origin=PROPERTY_REFERENCE_FOR_DELEGATE + value: GET_VAR 'value-parameter : Any' type=kotlin.Any origin=null PROPERTY public var test4: kotlin.Any FIELD DELEGATE val `test4$delegate`: java.util.HashMap EXPRESSION_BODY - CALL 'hashMapOf(vararg Pair): HashMap' type=java.util.HashMap operator=null + CALL 'hashMapOf(vararg Pair): HashMap' type=java.util.HashMap origin=null FUN DELEGATED_PROPERTY_ACCESSOR public fun (): kotlin.Any BLOCK_BODY RETURN type=kotlin.Nothing from='(): Any' - CALL 'getValue(Any?, KProperty<*>) on MutableMap: Any' type=kotlin.Any operator=null - $receiver: GET_BACKING_FIELD '`test4$delegate`: HashMap' type=java.util.HashMap operator=null + CALL 'getValue(Any?, KProperty<*>) on MutableMap: Any' type=kotlin.Any origin=null + $receiver: GET_BACKING_FIELD '`test4$delegate`: HashMap' type=java.util.HashMap origin=null thisRef: CONST Null type=kotlin.Nothing? value='null' - property: CALLABLE_REFERENCE 'test4: Any' type=kotlin.reflect.KMutableProperty0 operator=PROPERTY_REFERENCE_FOR_DELEGATE + property: CALLABLE_REFERENCE 'test4: Any' type=kotlin.reflect.KMutableProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE FUN DELEGATED_PROPERTY_ACCESSOR public fun (: kotlin.Any): kotlin.Unit BLOCK_BODY RETURN type=kotlin.Nothing from='(Any): Unit' - CALL 'setValue(Any?, KProperty<*>, Any) on MutableMap: Unit' type=kotlin.Unit operator=null - $receiver: GET_BACKING_FIELD '`test4$delegate`: HashMap' type=java.util.HashMap operator=null + CALL 'setValue(Any?, KProperty<*>, Any) on MutableMap: Unit' type=kotlin.Unit origin=null + $receiver: GET_BACKING_FIELD '`test4$delegate`: HashMap' type=java.util.HashMap origin=null thisRef: CONST Null type=kotlin.Nothing? value='null' - property: CALLABLE_REFERENCE 'test4: Any' type=kotlin.reflect.KMutableProperty0 operator=PROPERTY_REFERENCE_FOR_DELEGATE - value: GET_VAR 'value-parameter : Any' type=kotlin.Any operator=null + property: CALLABLE_REFERENCE 'test4: Any' type=kotlin.reflect.KMutableProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE + value: GET_VAR 'value-parameter : Any' type=kotlin.Any origin=null diff --git a/compiler/testData/ir/irText/declarations/fileWithAnnotations.txt b/compiler/testData/ir/irText/declarations/fileWithAnnotations.txt index 12bcb753da0..643da44d236 100644 --- a/compiler/testData/ir/irText/declarations/fileWithAnnotations.txt +++ b/compiler/testData/ir/irText/declarations/fileWithAnnotations.txt @@ -10,4 +10,4 @@ FILE /fileWithAnnotations.kt FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'bar: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'bar: Int' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/declarations/localDelegatedProperties.txt b/compiler/testData/ir/irText/declarations/localDelegatedProperties.txt index 17a6a9ea13d..da648035912 100644 --- a/compiler/testData/ir/irText/declarations/localDelegatedProperties.txt +++ b/compiler/testData/ir/irText/declarations/localDelegatedProperties.txt @@ -3,53 +3,53 @@ FILE /localDelegatedProperties.kt BLOCK_BODY LOCAL_DELEGATED_PROPERTY val x: kotlin.Int VAR DELEGATE val `x$delegate`: kotlin.Lazy - CALL 'lazy(() -> Int): Lazy' type=kotlin.Lazy operator=null - initializer: BLOCK type=() -> kotlin.Int operator=LAMBDA + CALL 'lazy(() -> Int): Lazy' type=kotlin.Lazy origin=null + initializer: BLOCK type=() -> kotlin.Int origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA local final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' CONST Int type=kotlin.Int value='42' - CALLABLE_REFERENCE '(): Int' type=() -> kotlin.Int operator=LAMBDA + CALLABLE_REFERENCE '(): Int' type=() -> kotlin.Int origin=LAMBDA FUN DELEGATED_PROPERTY_ACCESSOR local final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - CALL 'getValue(Any?, KProperty<*>) on Lazy: Int' type=kotlin.Int operator=null - $receiver: GET_VAR '`x$delegate`: Lazy' type=kotlin.Lazy operator=null + CALL 'getValue(Any?, KProperty<*>) on Lazy: Int' type=kotlin.Int origin=null + $receiver: GET_VAR '`x$delegate`: Lazy' type=kotlin.Lazy origin=null thisRef: CONST Null type=kotlin.Nothing? value='null' - property: CALLABLE_REFERENCE 'x: Int' type=kotlin.reflect.KProperty0 operator=PROPERTY_REFERENCE_FOR_DELEGATE - CALL 'println(Int): Unit' type=kotlin.Unit operator=null - message: CALL '(): Int' type=kotlin.Int operator=GET_LOCAL_PROPERTY + property: CALLABLE_REFERENCE 'x: Int' type=kotlin.reflect.KProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE + CALL 'println(Int): Unit' type=kotlin.Unit origin=null + message: CALL '(): Int' type=kotlin.Int origin=GET_LOCAL_PROPERTY FUN public fun test2(): kotlin.Unit BLOCK_BODY LOCAL_DELEGATED_PROPERTY var x: kotlin.Int VAR DELEGATE val `x$delegate`: java.util.HashMap - CALL 'hashMapOf(vararg Pair): HashMap' type=java.util.HashMap operator=null + CALL 'hashMapOf(vararg Pair): HashMap' type=java.util.HashMap origin=null FUN DELEGATED_PROPERTY_ACCESSOR local final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - CALL 'getValue(Any?, KProperty<*>) on MutableMap: Int' type=kotlin.Int operator=null - $receiver: GET_VAR '`x$delegate`: HashMap' type=java.util.HashMap operator=null + CALL 'getValue(Any?, KProperty<*>) on MutableMap: Int' type=kotlin.Int origin=null + $receiver: GET_VAR '`x$delegate`: HashMap' type=java.util.HashMap origin=null thisRef: CONST Null type=kotlin.Nothing? value='null' - property: CALLABLE_REFERENCE 'x: Int' type=kotlin.reflect.KMutableProperty0 operator=PROPERTY_REFERENCE_FOR_DELEGATE + property: CALLABLE_REFERENCE 'x: Int' type=kotlin.reflect.KMutableProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE FUN DELEGATED_PROPERTY_ACCESSOR local final fun (value: kotlin.Int): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(Int): Int' - TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.Int - CALL 'setValue(Any?, KProperty<*>, Int) on MutableMap: Unit' type=kotlin.Unit operator=null - $receiver: GET_VAR '`x$delegate`: HashMap' type=java.util.HashMap operator=null + TYPE_OP origin=IMPLICIT_CAST typeOperand=kotlin.Int + CALL 'setValue(Any?, KProperty<*>, Int) on MutableMap: Unit' type=kotlin.Unit origin=null + $receiver: GET_VAR '`x$delegate`: HashMap' type=java.util.HashMap origin=null thisRef: CONST Null type=kotlin.Nothing? value='null' - property: CALLABLE_REFERENCE 'x: Int' type=kotlin.reflect.KMutableProperty0 operator=PROPERTY_REFERENCE_FOR_DELEGATE - value: GET_VAR 'value-parameter value: Int' type=kotlin.Int operator=null - CALL '(Int): Int' type=kotlin.Int operator=EQ + property: CALLABLE_REFERENCE 'x: Int' type=kotlin.reflect.KMutableProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE + value: GET_VAR 'value-parameter value: Int' type=kotlin.Int origin=null + CALL '(Int): Int' type=kotlin.Int origin=EQ value: CONST Int type=kotlin.Int value='0' - BLOCK type=kotlin.Int operator=POSTFIX_INCR + BLOCK type=kotlin.Int origin=POSTFIX_INCR VAR IR_TEMPORARY_VARIABLE val tmp0: kotlin.Int - CALL '(): Int' type=kotlin.Int operator=POSTFIX_INCR - CALL '(Int): Int' type=kotlin.Int operator=POSTFIX_INCR - value: CALL 'inc(): Int' type=kotlin.Int operator=POSTFIX_INCR - $this: GET_VAR 'tmp0: Int' type=kotlin.Int operator=null - GET_VAR 'tmp0: Int' type=kotlin.Int operator=null - CALL '(Int): Int' type=kotlin.Int operator=PLUSEQ - value: CALL 'plus(Int): Int' type=kotlin.Int operator=PLUSEQ - $this: CALL '(): Int' type=kotlin.Int operator=PLUSEQ + CALL '(): Int' type=kotlin.Int origin=POSTFIX_INCR + CALL '(Int): Int' type=kotlin.Int origin=POSTFIX_INCR + value: CALL 'inc(): Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'tmp0: Int' type=kotlin.Int origin=null + GET_VAR 'tmp0: Int' type=kotlin.Int origin=null + CALL '(Int): Int' type=kotlin.Int origin=PLUSEQ + value: CALL 'plus(Int): Int' type=kotlin.Int origin=PLUSEQ + $this: CALL '(): Int' type=kotlin.Int origin=PLUSEQ other: CONST Int type=kotlin.Int value='1' diff --git a/compiler/testData/ir/irText/declarations/packageLevelProperties.txt b/compiler/testData/ir/irText/declarations/packageLevelProperties.txt index 984fd0b5043..f1d0dab6ee0 100644 --- a/compiler/testData/ir/irText/declarations/packageLevelProperties.txt +++ b/compiler/testData/ir/irText/declarations/packageLevelProperties.txt @@ -6,7 +6,7 @@ FILE /packageLevelProperties.kt FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'test1: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'test1: Int' type=kotlin.Int origin=null PROPERTY public val test2: kotlin.Int FUN public fun (): kotlin.Int BLOCK_BODY @@ -19,11 +19,11 @@ FILE /packageLevelProperties.kt FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'test3: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'test3: Int' type=kotlin.Int origin=null FUN DEFAULT_PROPERTY_ACCESSOR public fun (: kotlin.Int): kotlin.Unit BLOCK_BODY - SET_BACKING_FIELD 'test3: Int' type=kotlin.Unit operator=null - value: GET_VAR 'value-parameter : Int' type=kotlin.Int operator=null + SET_BACKING_FIELD 'test3: Int' type=kotlin.Unit origin=null + value: GET_VAR 'value-parameter : Int' type=kotlin.Int origin=null PROPERTY public var test4: kotlin.Int FIELD PROPERTY_BACKING_FIELD public var test4: kotlin.Int EXPRESSION_BODY @@ -31,11 +31,11 @@ FILE /packageLevelProperties.kt FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'test4: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'test4: Int' type=kotlin.Int origin=null FUN public fun (value: kotlin.Int): kotlin.Unit BLOCK_BODY - SET_BACKING_FIELD 'test4: Int' type=kotlin.Unit operator=EQ - value: GET_VAR 'value-parameter value: Int' type=kotlin.Int operator=null + SET_BACKING_FIELD 'test4: Int' type=kotlin.Unit origin=EQ + value: GET_VAR 'value-parameter value: Int' type=kotlin.Int origin=null PROPERTY public var test5: kotlin.Int FIELD PROPERTY_BACKING_FIELD public var test5: kotlin.Int EXPRESSION_BODY @@ -43,11 +43,11 @@ FILE /packageLevelProperties.kt FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'test5: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'test5: Int' type=kotlin.Int origin=null FUN private fun (: kotlin.Int): kotlin.Unit BLOCK_BODY - SET_BACKING_FIELD 'test5: Int' type=kotlin.Unit operator=null - value: GET_VAR 'value-parameter : Int' type=kotlin.Int operator=null + SET_BACKING_FIELD 'test5: Int' type=kotlin.Unit origin=null + value: GET_VAR 'value-parameter : Int' type=kotlin.Int origin=null PROPERTY public val test6: kotlin.Int = 1 FIELD PROPERTY_BACKING_FIELD public val test6: kotlin.Int = 1 EXPRESSION_BODY @@ -55,40 +55,40 @@ FILE /packageLevelProperties.kt FUN public fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'test6: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'test6: Int' type=kotlin.Int origin=null PROPERTY public val test7: kotlin.Int FIELD DELEGATE val `test7$delegate`: kotlin.Lazy EXPRESSION_BODY - CALL 'lazy(() -> Int): Lazy' type=kotlin.Lazy operator=null - initializer: BLOCK type=() -> kotlin.Int operator=LAMBDA + CALL 'lazy(() -> Int): Lazy' type=kotlin.Lazy origin=null + initializer: BLOCK type=() -> kotlin.Int origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA local final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' CONST Int type=kotlin.Int value='42' - CALLABLE_REFERENCE '(): Int' type=() -> kotlin.Int operator=LAMBDA + CALLABLE_REFERENCE '(): Int' type=() -> kotlin.Int origin=LAMBDA FUN DELEGATED_PROPERTY_ACCESSOR public fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - CALL 'getValue(Any?, KProperty<*>) on Lazy: Int' type=kotlin.Int operator=null - $receiver: GET_BACKING_FIELD '`test7$delegate`: Lazy' type=kotlin.Lazy operator=null + CALL 'getValue(Any?, KProperty<*>) on Lazy: Int' type=kotlin.Int origin=null + $receiver: GET_BACKING_FIELD '`test7$delegate`: Lazy' type=kotlin.Lazy origin=null thisRef: CONST Null type=kotlin.Nothing? value='null' - property: CALLABLE_REFERENCE 'test7: Int' type=kotlin.reflect.KProperty0 operator=PROPERTY_REFERENCE_FOR_DELEGATE + property: CALLABLE_REFERENCE 'test7: Int' type=kotlin.reflect.KProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE PROPERTY public var test8: kotlin.Int FIELD DELEGATE val `test8$delegate`: java.util.HashMap EXPRESSION_BODY - CALL 'hashMapOf(vararg Pair): HashMap' type=java.util.HashMap operator=null + CALL 'hashMapOf(vararg Pair): HashMap' type=java.util.HashMap origin=null FUN DELEGATED_PROPERTY_ACCESSOR public fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - CALL 'getValue(Any?, KProperty<*>) on MutableMap: Int' type=kotlin.Int operator=null - $receiver: GET_BACKING_FIELD '`test8$delegate`: HashMap' type=java.util.HashMap operator=null + CALL 'getValue(Any?, KProperty<*>) on MutableMap: Int' type=kotlin.Int origin=null + $receiver: GET_BACKING_FIELD '`test8$delegate`: HashMap' type=java.util.HashMap origin=null thisRef: CONST Null type=kotlin.Nothing? value='null' - property: CALLABLE_REFERENCE 'test8: Int' type=kotlin.reflect.KMutableProperty0 operator=PROPERTY_REFERENCE_FOR_DELEGATE + property: CALLABLE_REFERENCE 'test8: Int' type=kotlin.reflect.KMutableProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE FUN DELEGATED_PROPERTY_ACCESSOR public fun (: kotlin.Int): kotlin.Unit BLOCK_BODY RETURN type=kotlin.Nothing from='(Int): Unit' - CALL 'setValue(Any?, KProperty<*>, Int) on MutableMap: Unit' type=kotlin.Unit operator=null - $receiver: GET_BACKING_FIELD '`test8$delegate`: HashMap' type=java.util.HashMap operator=null + CALL 'setValue(Any?, KProperty<*>, Int) on MutableMap: Unit' type=kotlin.Unit origin=null + $receiver: GET_BACKING_FIELD '`test8$delegate`: HashMap' type=java.util.HashMap origin=null thisRef: CONST Null type=kotlin.Nothing? value='null' - property: CALLABLE_REFERENCE 'test8: Int' type=kotlin.reflect.KMutableProperty0 operator=PROPERTY_REFERENCE_FOR_DELEGATE - value: GET_VAR 'value-parameter : Int' type=kotlin.Int operator=null + property: CALLABLE_REFERENCE 'test8: Int' type=kotlin.reflect.KMutableProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE + value: GET_VAR 'value-parameter : Int' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/declarations/primaryCtorDefaultArguments.txt b/compiler/testData/ir/irText/declarations/primaryCtorDefaultArguments.txt index a194ce2f3d5..046f3859abd 100644 --- a/compiler/testData/ir/irText/declarations/primaryCtorDefaultArguments.txt +++ b/compiler/testData/ir/irText/declarations/primaryCtorDefaultArguments.txt @@ -9,9 +9,9 @@ FILE /primaryCtorDefaultArguments.kt PROPERTY public final val x: kotlin.Int FIELD PROPERTY_BACKING_FIELD public final val x: kotlin.Int EXPRESSION_BODY - GET_VAR 'value-parameter x: Int = ...' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER + GET_VAR 'value-parameter x: Int = ...' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'x: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'x: Int' type=kotlin.Int origin=null receiver: THIS of 'Test' type=Test diff --git a/compiler/testData/ir/irText/declarations/primaryCtorProperties.txt b/compiler/testData/ir/irText/declarations/primaryCtorProperties.txt index d31ee0b267b..13eeb08c496 100644 --- a/compiler/testData/ir/irText/declarations/primaryCtorProperties.txt +++ b/compiler/testData/ir/irText/declarations/primaryCtorProperties.txt @@ -7,23 +7,23 @@ FILE /primaryCtorProperties.kt PROPERTY public final val test1: kotlin.Int FIELD PROPERTY_BACKING_FIELD public final val test1: kotlin.Int EXPRESSION_BODY - GET_VAR 'value-parameter test1: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER + GET_VAR 'value-parameter test1: Int' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'test1: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'test1: Int' type=kotlin.Int origin=null receiver: THIS of 'C' type=C PROPERTY public final var test2: kotlin.Int FIELD PROPERTY_BACKING_FIELD public final var test2: kotlin.Int EXPRESSION_BODY - GET_VAR 'value-parameter test2: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER + GET_VAR 'value-parameter test2: Int' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'test2: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'test2: Int' type=kotlin.Int origin=null receiver: THIS of 'C' type=C FUN DEFAULT_PROPERTY_ACCESSOR public final fun (: kotlin.Int): kotlin.Unit BLOCK_BODY - SET_BACKING_FIELD 'test2: Int' type=kotlin.Unit operator=null + SET_BACKING_FIELD 'test2: Int' type=kotlin.Unit origin=null receiver: THIS of 'C' type=C - value: GET_VAR 'value-parameter : Int' type=kotlin.Int operator=null + value: GET_VAR 'value-parameter : Int' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/errors/suppressedNonPublicCall.txt b/compiler/testData/ir/irText/errors/suppressedNonPublicCall.txt index ae0625d5426..6c6d3cbb61a 100644 --- a/compiler/testData/ir/irText/errors/suppressedNonPublicCall.txt +++ b/compiler/testData/ir/irText/errors/suppressedNonPublicCall.txt @@ -8,5 +8,5 @@ FILE /suppressedNonPublicCall.kt BLOCK_BODY FUN public inline fun C.foo(): kotlin.Unit BLOCK_BODY - CALL 'bar(): Unit' type=kotlin.Unit operator=null + CALL 'bar(): Unit' type=kotlin.Unit origin=null $this: $RECEIVER of 'foo() on C: Unit' type=C diff --git a/compiler/testData/ir/irText/errors/unresolvedReference.txt b/compiler/testData/ir/irText/errors/unresolvedReference.txt index a232a3ff54f..9c0459f5afa 100644 --- a/compiler/testData/ir/irText/errors/unresolvedReference.txt +++ b/compiler/testData/ir/irText/errors/unresolvedReference.txt @@ -6,7 +6,7 @@ FILE /unresolvedReference.kt FUN DEFAULT_PROPERTY_ACCESSOR public fun (): [ERROR : Type for unresolved] BLOCK_BODY RETURN type=kotlin.Nothing from='(): [ERROR : Type for unresolved]' - GET_BACKING_FIELD 'test1: [ERROR : Type for unresolved]' type=[ERROR : Type for unresolved] operator=null + GET_BACKING_FIELD 'test1: [ERROR : Type for unresolved]' type=[ERROR : Type for unresolved] origin=null PROPERTY public val test2: [ERROR : Unresolved] FIELD PROPERTY_BACKING_FIELD public val test2: [ERROR : Unresolved] EXPRESSION_BODY @@ -14,7 +14,7 @@ FILE /unresolvedReference.kt FUN DEFAULT_PROPERTY_ACCESSOR public fun (): [ERROR : Unresolved] BLOCK_BODY RETURN type=kotlin.Nothing from='(): [ERROR : Unresolved]' - GET_BACKING_FIELD 'test2: [ERROR : Unresolved]' type=[ERROR : Unresolved] operator=null + GET_BACKING_FIELD 'test2: [ERROR : Unresolved]' type=[ERROR : Unresolved] origin=null PROPERTY public val test3: [ERROR : Type for 42.unresolved(56)] FIELD PROPERTY_BACKING_FIELD public val test3: [ERROR : Type for 42.unresolved(56)] EXPRESSION_BODY @@ -24,7 +24,7 @@ FILE /unresolvedReference.kt FUN DEFAULT_PROPERTY_ACCESSOR public fun (): [ERROR : Type for 42.unresolved(56)] BLOCK_BODY RETURN type=kotlin.Nothing from='(): [ERROR : Type for 42.unresolved(56)]' - GET_BACKING_FIELD 'test3: [ERROR : Type for 42.unresolved(56)]' type=[ERROR : Type for 42.unresolved(56)] operator=null + GET_BACKING_FIELD 'test3: [ERROR : Type for 42.unresolved(56)]' type=[ERROR : Type for 42.unresolved(56)] origin=null PROPERTY public val test4: [ERROR : Type for 42 *] FIELD PROPERTY_BACKING_FIELD public val test4: [ERROR : Type for 42 *] EXPRESSION_BODY @@ -32,4 +32,4 @@ FILE /unresolvedReference.kt FUN DEFAULT_PROPERTY_ACCESSOR public fun (): [ERROR : Type for 42 *] BLOCK_BODY RETURN type=kotlin.Nothing from='(): [ERROR : Type for 42 *]' - GET_BACKING_FIELD 'test4: [ERROR : Type for 42 *]' type=[ERROR : Type for 42 *] operator=null + GET_BACKING_FIELD 'test4: [ERROR : Type for 42 *]' type=[ERROR : Type for 42 *] origin=null diff --git a/compiler/testData/ir/irText/expressions/arrayAccess.txt b/compiler/testData/ir/irText/expressions/arrayAccess.txt index 82538aaf5d6..4f56665c188 100644 --- a/compiler/testData/ir/irText/expressions/arrayAccess.txt +++ b/compiler/testData/ir/irText/expressions/arrayAccess.txt @@ -6,7 +6,7 @@ FILE /arrayAccess.kt FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'p: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'p: Int' type=kotlin.Int origin=null FUN public fun foo(): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='foo(): Int' @@ -14,14 +14,14 @@ FILE /arrayAccess.kt FUN public fun test(a: kotlin.IntArray): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='test(IntArray): Int' - CALL 'plus(Int): Int' type=kotlin.Int operator=PLUS - $this: CALL 'plus(Int): Int' type=kotlin.Int operator=PLUS - $this: CALL 'get(Int): Int' type=kotlin.Int operator=GET_ARRAY_ELEMENT - $this: GET_VAR 'value-parameter a: IntArray' type=kotlin.IntArray operator=null + CALL 'plus(Int): Int' type=kotlin.Int origin=PLUS + $this: CALL 'plus(Int): Int' type=kotlin.Int origin=PLUS + $this: CALL 'get(Int): Int' type=kotlin.Int origin=GET_ARRAY_ELEMENT + $this: GET_VAR 'value-parameter a: IntArray' type=kotlin.IntArray origin=null index: CONST Int type=kotlin.Int value='0' - other: CALL 'get(Int): Int' type=kotlin.Int operator=GET_ARRAY_ELEMENT - $this: GET_VAR 'value-parameter a: IntArray' type=kotlin.IntArray operator=null - index: CALL '(): Int' type=kotlin.Int operator=GET_PROPERTY - other: CALL 'get(Int): Int' type=kotlin.Int operator=GET_ARRAY_ELEMENT - $this: GET_VAR 'value-parameter a: IntArray' type=kotlin.IntArray operator=null - index: CALL 'foo(): Int' type=kotlin.Int operator=null + other: CALL 'get(Int): Int' type=kotlin.Int origin=GET_ARRAY_ELEMENT + $this: GET_VAR 'value-parameter a: IntArray' type=kotlin.IntArray origin=null + index: CALL '(): Int' type=kotlin.Int origin=GET_PROPERTY + other: CALL 'get(Int): Int' type=kotlin.Int origin=GET_ARRAY_ELEMENT + $this: GET_VAR 'value-parameter a: IntArray' type=kotlin.IntArray origin=null + index: CALL 'foo(): Int' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/arrayAssignment.txt b/compiler/testData/ir/irText/expressions/arrayAssignment.txt index 8e47f7e66ce..55c3dc58090 100644 --- a/compiler/testData/ir/irText/expressions/arrayAssignment.txt +++ b/compiler/testData/ir/irText/expressions/arrayAssignment.txt @@ -2,13 +2,13 @@ FILE /arrayAssignment.kt FUN public fun test(): kotlin.Unit BLOCK_BODY VAR val x: kotlin.IntArray - CALL 'intArrayOf(vararg Int): IntArray' type=kotlin.IntArray operator=null + CALL 'intArrayOf(vararg Int): IntArray' type=kotlin.IntArray origin=null elements: VARARG type=IntArray varargElementType=Int CONST Int type=kotlin.Int value='1' CONST Int type=kotlin.Int value='2' CONST Int type=kotlin.Int value='3' - CALL 'set(Int, Int): Unit' type=kotlin.Unit operator=EQ - $this: GET_VAR 'x: IntArray' type=kotlin.IntArray operator=null + CALL 'set(Int, Int): Unit' type=kotlin.Unit origin=EQ + $this: GET_VAR 'x: IntArray' type=kotlin.IntArray origin=null index: CONST Int type=kotlin.Int value='1' value: CONST Int type=kotlin.Int value='0' FUN public fun foo(): kotlin.Int @@ -17,11 +17,11 @@ FILE /arrayAssignment.kt CONST Int type=kotlin.Int value='1' FUN public fun test2(): kotlin.Unit BLOCK_BODY - CALL 'set(Int, Int): Unit' type=kotlin.Unit operator=EQ - $this: CALL 'intArrayOf(vararg Int): IntArray' type=kotlin.IntArray operator=null + CALL 'set(Int, Int): Unit' type=kotlin.Unit origin=EQ + $this: CALL 'intArrayOf(vararg Int): IntArray' type=kotlin.IntArray origin=null elements: VARARG type=IntArray varargElementType=Int CONST Int type=kotlin.Int value='1' CONST Int type=kotlin.Int value='2' CONST Int type=kotlin.Int value='3' - index: CALL 'foo(): Int' type=kotlin.Int operator=null + index: CALL 'foo(): Int' type=kotlin.Int origin=null value: CONST Int type=kotlin.Int value='1' diff --git a/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.txt b/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.txt index b1bae84053a..e5c01e2b738 100644 --- a/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.txt +++ b/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.txt @@ -2,7 +2,7 @@ FILE /arrayAugmentedAssignment1.kt FUN public fun foo(): kotlin.IntArray BLOCK_BODY RETURN type=kotlin.Nothing from='foo(): IntArray' - CALL 'intArrayOf(vararg Int): IntArray' type=kotlin.IntArray operator=null + CALL 'intArrayOf(vararg Int): IntArray' type=kotlin.IntArray origin=null elements: VARARG type=IntArray varargElementType=Int CONST Int type=kotlin.Int value='1' CONST Int type=kotlin.Int value='2' @@ -19,59 +19,59 @@ FILE /arrayAugmentedAssignment1.kt PROPERTY public final val x: kotlin.IntArray FIELD PROPERTY_BACKING_FIELD public final val x: kotlin.IntArray EXPRESSION_BODY - GET_VAR 'value-parameter x: IntArray' type=kotlin.IntArray operator=INITIALIZE_PROPERTY_FROM_PARAMETER + GET_VAR 'value-parameter x: IntArray' type=kotlin.IntArray origin=INITIALIZE_PROPERTY_FROM_PARAMETER FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.IntArray BLOCK_BODY RETURN type=kotlin.Nothing from='(): IntArray' - GET_BACKING_FIELD 'x: IntArray' type=kotlin.IntArray operator=null + GET_BACKING_FIELD 'x: IntArray' type=kotlin.IntArray origin=null receiver: THIS of 'C' type=C FUN public fun testVariable(): kotlin.Unit BLOCK_BODY VAR var x: kotlin.IntArray - CALL 'foo(): IntArray' type=kotlin.IntArray operator=null - BLOCK type=kotlin.Unit operator=PLUSEQ + CALL 'foo(): IntArray' type=kotlin.IntArray origin=null + BLOCK type=kotlin.Unit origin=PLUSEQ VAR IR_TEMPORARY_VARIABLE val tmp0_array: kotlin.IntArray - GET_VAR 'x: IntArray' type=kotlin.IntArray operator=null + GET_VAR 'x: IntArray' type=kotlin.IntArray origin=null VAR IR_TEMPORARY_VARIABLE val tmp1_index0: kotlin.Int CONST Int type=kotlin.Int value='0' - CALL 'set(Int, Int): Unit' type=kotlin.Unit operator=PLUSEQ - $this: GET_VAR 'tmp0_array: IntArray' type=kotlin.IntArray operator=null - index: GET_VAR 'tmp1_index0: Int' type=kotlin.Int operator=null - value: CALL 'plus(Int): Int' type=kotlin.Int operator=PLUSEQ - $this: CALL 'get(Int): Int' type=kotlin.Int operator=PLUSEQ - $this: GET_VAR 'tmp0_array: IntArray' type=kotlin.IntArray operator=null - index: GET_VAR 'tmp1_index0: Int' type=kotlin.Int operator=null + CALL 'set(Int, Int): Unit' type=kotlin.Unit origin=PLUSEQ + $this: GET_VAR 'tmp0_array: IntArray' type=kotlin.IntArray origin=null + index: GET_VAR 'tmp1_index0: Int' type=kotlin.Int origin=null + value: CALL 'plus(Int): Int' type=kotlin.Int origin=PLUSEQ + $this: CALL 'get(Int): Int' type=kotlin.Int origin=PLUSEQ + $this: GET_VAR 'tmp0_array: IntArray' type=kotlin.IntArray origin=null + index: GET_VAR 'tmp1_index0: Int' type=kotlin.Int origin=null other: CONST Int type=kotlin.Int value='1' FUN public fun testCall(): kotlin.Unit BLOCK_BODY - BLOCK type=kotlin.Unit operator=MULTEQ + BLOCK type=kotlin.Unit origin=MULTEQ VAR IR_TEMPORARY_VARIABLE val tmp0_array: kotlin.IntArray - CALL 'foo(): IntArray' type=kotlin.IntArray operator=null + CALL 'foo(): IntArray' type=kotlin.IntArray origin=null VAR IR_TEMPORARY_VARIABLE val tmp1_index0: kotlin.Int - CALL 'bar(): Int' type=kotlin.Int operator=null - CALL 'set(Int, Int): Unit' type=kotlin.Unit operator=MULTEQ - $this: GET_VAR 'tmp0_array: IntArray' type=kotlin.IntArray operator=null - index: GET_VAR 'tmp1_index0: Int' type=kotlin.Int operator=null - value: CALL 'times(Int): Int' type=kotlin.Int operator=MULTEQ - $this: CALL 'get(Int): Int' type=kotlin.Int operator=MULTEQ - $this: GET_VAR 'tmp0_array: IntArray' type=kotlin.IntArray operator=null - index: GET_VAR 'tmp1_index0: Int' type=kotlin.Int operator=null + CALL 'bar(): Int' type=kotlin.Int origin=null + CALL 'set(Int, Int): Unit' type=kotlin.Unit origin=MULTEQ + $this: GET_VAR 'tmp0_array: IntArray' type=kotlin.IntArray origin=null + index: GET_VAR 'tmp1_index0: Int' type=kotlin.Int origin=null + value: CALL 'times(Int): Int' type=kotlin.Int origin=MULTEQ + $this: CALL 'get(Int): Int' type=kotlin.Int origin=MULTEQ + $this: GET_VAR 'tmp0_array: IntArray' type=kotlin.IntArray origin=null + index: GET_VAR 'tmp1_index0: Int' type=kotlin.Int origin=null other: CONST Int type=kotlin.Int value='2' FUN public fun testMember(c: C): kotlin.Unit BLOCK_BODY - BLOCK type=kotlin.Int operator=POSTFIX_INCR + BLOCK type=kotlin.Int origin=POSTFIX_INCR VAR IR_TEMPORARY_VARIABLE val tmp0_array: kotlin.IntArray - CALL '(): IntArray' type=kotlin.IntArray operator=GET_PROPERTY - $this: GET_VAR 'value-parameter c: C' type=C operator=null + CALL '(): IntArray' type=kotlin.IntArray origin=GET_PROPERTY + $this: GET_VAR 'value-parameter c: C' type=C origin=null VAR IR_TEMPORARY_VARIABLE val tmp1_index0: kotlin.Int CONST Int type=kotlin.Int value='0' VAR IR_TEMPORARY_VARIABLE val tmp2: kotlin.Int - CALL 'get(Int): Int' type=kotlin.Int operator=POSTFIX_INCR - $this: GET_VAR 'tmp0_array: IntArray' type=kotlin.IntArray operator=null - index: GET_VAR 'tmp1_index0: Int' type=kotlin.Int operator=null - CALL 'set(Int, Int): Unit' type=kotlin.Unit operator=POSTFIX_INCR - $this: GET_VAR 'tmp0_array: IntArray' type=kotlin.IntArray operator=null - index: GET_VAR 'tmp1_index0: Int' type=kotlin.Int operator=null - value: CALL 'inc(): Int' type=kotlin.Int operator=POSTFIX_INCR - $this: GET_VAR 'tmp2: Int' type=kotlin.Int operator=null - GET_VAR 'tmp2: Int' type=kotlin.Int operator=null + CALL 'get(Int): Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'tmp0_array: IntArray' type=kotlin.IntArray origin=null + index: GET_VAR 'tmp1_index0: Int' type=kotlin.Int origin=null + CALL 'set(Int, Int): Unit' type=kotlin.Unit origin=POSTFIX_INCR + $this: GET_VAR 'tmp0_array: IntArray' type=kotlin.IntArray origin=null + index: GET_VAR 'tmp1_index0: Int' type=kotlin.Int origin=null + value: CALL 'inc(): Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'tmp2: Int' type=kotlin.Int origin=null + GET_VAR 'tmp2: Int' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment2.txt b/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment2.txt index a7bc65185d7..1c121c28056 100644 --- a/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment2.txt +++ b/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment2.txt @@ -5,17 +5,17 @@ FILE /arrayAugmentedAssignment2.kt FUN public abstract operator fun IA.set(index: kotlin.String, value: kotlin.Int): kotlin.Unit FUN public fun IB.test(a: IA): kotlin.Unit BLOCK_BODY - BLOCK type=kotlin.Unit operator=PLUSEQ + BLOCK type=kotlin.Unit origin=PLUSEQ VAR IR_TEMPORARY_VARIABLE val tmp0_array: IA - GET_VAR 'value-parameter a: IA' type=IA operator=null + GET_VAR 'value-parameter a: IA' type=IA origin=null VAR IR_TEMPORARY_VARIABLE val tmp1_index0: kotlin.String CONST String type=kotlin.String value='' - CALL 'set(String, Int) on IA: Unit' type=kotlin.Unit operator=PLUSEQ + CALL 'set(String, Int) on IA: Unit' type=kotlin.Unit origin=PLUSEQ $this: $RECEIVER of 'test(IA) on IB: Unit' type=IB - $receiver: GET_VAR 'tmp0_array: IA' type=IA operator=null - index: GET_VAR 'tmp1_index0: String' type=kotlin.String operator=null - value: CALL 'plus(Int): Int' type=kotlin.Int operator=PLUSEQ - $this: CALL 'get(String): Int' type=kotlin.Int operator=PLUSEQ - $this: GET_VAR 'tmp0_array: IA' type=IA operator=null - index: GET_VAR 'tmp1_index0: String' type=kotlin.String operator=null + $receiver: GET_VAR 'tmp0_array: IA' type=IA origin=null + index: GET_VAR 'tmp1_index0: String' type=kotlin.String origin=null + value: CALL 'plus(Int): Int' type=kotlin.Int origin=PLUSEQ + $this: CALL 'get(String): Int' type=kotlin.Int origin=PLUSEQ + $this: GET_VAR 'tmp0_array: IA' type=IA origin=null + index: GET_VAR 'tmp1_index0: String' type=kotlin.String origin=null other: CONST Int type=kotlin.Int value='42' diff --git a/compiler/testData/ir/irText/expressions/assignments.txt b/compiler/testData/ir/irText/expressions/assignments.txt index 9d4d2ded46e..9e59157f3be 100644 --- a/compiler/testData/ir/irText/expressions/assignments.txt +++ b/compiler/testData/ir/irText/expressions/assignments.txt @@ -7,29 +7,29 @@ FILE /assignments.kt PROPERTY public final var x: kotlin.Int FIELD PROPERTY_BACKING_FIELD public final var x: kotlin.Int EXPRESSION_BODY - GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER + GET_VAR 'value-parameter x: Int' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'x: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'x: Int' type=kotlin.Int origin=null receiver: THIS of 'Ref' type=Ref FUN DEFAULT_PROPERTY_ACCESSOR public final fun (: kotlin.Int): kotlin.Unit BLOCK_BODY - SET_BACKING_FIELD 'x: Int' type=kotlin.Unit operator=null + SET_BACKING_FIELD 'x: Int' type=kotlin.Unit origin=null receiver: THIS of 'Ref' type=Ref - value: GET_VAR 'value-parameter : Int' type=kotlin.Int operator=null + value: GET_VAR 'value-parameter : Int' type=kotlin.Int origin=null FUN public fun test1(): kotlin.Unit BLOCK_BODY VAR var x: kotlin.Int CONST Int type=kotlin.Int value='0' - SET_VAR 'x: Int' type=kotlin.Unit operator=EQ + SET_VAR 'x: Int' type=kotlin.Unit origin=EQ CONST Int type=kotlin.Int value='1' - SET_VAR 'x: Int' type=kotlin.Unit operator=EQ - CALL 'plus(Int): Int' type=kotlin.Int operator=PLUS - $this: GET_VAR 'x: Int' type=kotlin.Int operator=null + SET_VAR 'x: Int' type=kotlin.Unit origin=EQ + CALL 'plus(Int): Int' type=kotlin.Int origin=PLUS + $this: GET_VAR 'x: Int' type=kotlin.Int origin=null other: CONST Int type=kotlin.Int value='1' FUN public fun test2(r: Ref): kotlin.Unit BLOCK_BODY - CALL '(Int): Unit' type=kotlin.Unit operator=EQ - $this: GET_VAR 'value-parameter r: Ref' type=Ref operator=null + CALL '(Int): Unit' type=kotlin.Unit origin=EQ + $this: GET_VAR 'value-parameter r: Ref' type=Ref origin=null : CONST Int type=kotlin.Int value='0' diff --git a/compiler/testData/ir/irText/expressions/augmentedAssignment1.txt b/compiler/testData/ir/irText/expressions/augmentedAssignment1.txt index 0a2bd96dd46..9b24072fe3d 100644 --- a/compiler/testData/ir/irText/expressions/augmentedAssignment1.txt +++ b/compiler/testData/ir/irText/expressions/augmentedAssignment1.txt @@ -6,59 +6,59 @@ FILE /augmentedAssignment1.kt FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'p: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'p: Int' type=kotlin.Int origin=null FUN DEFAULT_PROPERTY_ACCESSOR public fun (: kotlin.Int): kotlin.Unit BLOCK_BODY - SET_BACKING_FIELD 'p: Int' type=kotlin.Unit operator=null - value: GET_VAR 'value-parameter : Int' type=kotlin.Int operator=null + SET_BACKING_FIELD 'p: Int' type=kotlin.Unit origin=null + value: GET_VAR 'value-parameter : Int' type=kotlin.Int origin=null FUN public fun testVariable(): kotlin.Unit BLOCK_BODY VAR var x: kotlin.Int CONST Int type=kotlin.Int value='0' - SET_VAR 'x: Int' type=kotlin.Unit operator=PLUSEQ - CALL 'plus(Int): Int' type=kotlin.Int operator=PLUSEQ - $this: GET_VAR 'x: Int' type=kotlin.Int operator=PLUSEQ + SET_VAR 'x: Int' type=kotlin.Unit origin=PLUSEQ + CALL 'plus(Int): Int' type=kotlin.Int origin=PLUSEQ + $this: GET_VAR 'x: Int' type=kotlin.Int origin=PLUSEQ other: CONST Int type=kotlin.Int value='1' - SET_VAR 'x: Int' type=kotlin.Unit operator=MINUSEQ - CALL 'minus(Int): Int' type=kotlin.Int operator=MINUSEQ - $this: GET_VAR 'x: Int' type=kotlin.Int operator=MINUSEQ + SET_VAR 'x: Int' type=kotlin.Unit origin=MINUSEQ + CALL 'minus(Int): Int' type=kotlin.Int origin=MINUSEQ + $this: GET_VAR 'x: Int' type=kotlin.Int origin=MINUSEQ other: CONST Int type=kotlin.Int value='2' - SET_VAR 'x: Int' type=kotlin.Unit operator=MULTEQ - CALL 'times(Int): Int' type=kotlin.Int operator=MULTEQ - $this: GET_VAR 'x: Int' type=kotlin.Int operator=MULTEQ + SET_VAR 'x: Int' type=kotlin.Unit origin=MULTEQ + CALL 'times(Int): Int' type=kotlin.Int origin=MULTEQ + $this: GET_VAR 'x: Int' type=kotlin.Int origin=MULTEQ other: CONST Int type=kotlin.Int value='3' - SET_VAR 'x: Int' type=kotlin.Unit operator=DIVEQ - CALL 'div(Int): Int' type=kotlin.Int operator=DIVEQ - $this: GET_VAR 'x: Int' type=kotlin.Int operator=DIVEQ + SET_VAR 'x: Int' type=kotlin.Unit origin=DIVEQ + CALL 'div(Int): Int' type=kotlin.Int origin=DIVEQ + $this: GET_VAR 'x: Int' type=kotlin.Int origin=DIVEQ other: CONST Int type=kotlin.Int value='4' - SET_VAR 'x: Int' type=kotlin.Unit operator=PERCEQ - CALL 'mod(Int): Int' type=kotlin.Int operator=PERCEQ - $this: GET_VAR 'x: Int' type=kotlin.Int operator=PERCEQ + SET_VAR 'x: Int' type=kotlin.Unit origin=PERCEQ + CALL 'mod(Int): Int' type=kotlin.Int origin=PERCEQ + $this: GET_VAR 'x: Int' type=kotlin.Int origin=PERCEQ other: CONST Int type=kotlin.Int value='5' FUN public fun testProperty(): kotlin.Unit BLOCK_BODY - BLOCK type=kotlin.Unit operator=PLUSEQ - CALL '(Int): Unit' type=kotlin.Unit operator=PLUSEQ - : CALL 'plus(Int): Int' type=kotlin.Int operator=PLUSEQ - $this: CALL '(): Int' type=kotlin.Int operator=PLUSEQ + BLOCK type=kotlin.Unit origin=PLUSEQ + CALL '(Int): Unit' type=kotlin.Unit origin=PLUSEQ + : CALL 'plus(Int): Int' type=kotlin.Int origin=PLUSEQ + $this: CALL '(): Int' type=kotlin.Int origin=PLUSEQ other: CONST Int type=kotlin.Int value='1' - BLOCK type=kotlin.Unit operator=MINUSEQ - CALL '(Int): Unit' type=kotlin.Unit operator=MINUSEQ - : CALL 'minus(Int): Int' type=kotlin.Int operator=MINUSEQ - $this: CALL '(): Int' type=kotlin.Int operator=MINUSEQ + BLOCK type=kotlin.Unit origin=MINUSEQ + CALL '(Int): Unit' type=kotlin.Unit origin=MINUSEQ + : CALL 'minus(Int): Int' type=kotlin.Int origin=MINUSEQ + $this: CALL '(): Int' type=kotlin.Int origin=MINUSEQ other: CONST Int type=kotlin.Int value='2' - BLOCK type=kotlin.Unit operator=MULTEQ - CALL '(Int): Unit' type=kotlin.Unit operator=MULTEQ - : CALL 'times(Int): Int' type=kotlin.Int operator=MULTEQ - $this: CALL '(): Int' type=kotlin.Int operator=MULTEQ + BLOCK type=kotlin.Unit origin=MULTEQ + CALL '(Int): Unit' type=kotlin.Unit origin=MULTEQ + : CALL 'times(Int): Int' type=kotlin.Int origin=MULTEQ + $this: CALL '(): Int' type=kotlin.Int origin=MULTEQ other: CONST Int type=kotlin.Int value='3' - BLOCK type=kotlin.Unit operator=DIVEQ - CALL '(Int): Unit' type=kotlin.Unit operator=DIVEQ - : CALL 'div(Int): Int' type=kotlin.Int operator=DIVEQ - $this: CALL '(): Int' type=kotlin.Int operator=DIVEQ + BLOCK type=kotlin.Unit origin=DIVEQ + CALL '(Int): Unit' type=kotlin.Unit origin=DIVEQ + : CALL 'div(Int): Int' type=kotlin.Int origin=DIVEQ + $this: CALL '(): Int' type=kotlin.Int origin=DIVEQ other: CONST Int type=kotlin.Int value='4' - BLOCK type=kotlin.Unit operator=PERCEQ - CALL '(Int): Unit' type=kotlin.Unit operator=PERCEQ - : CALL 'mod(Int): Int' type=kotlin.Int operator=PERCEQ - $this: CALL '(): Int' type=kotlin.Int operator=PERCEQ + BLOCK type=kotlin.Unit origin=PERCEQ + CALL '(Int): Unit' type=kotlin.Unit origin=PERCEQ + : CALL 'mod(Int): Int' type=kotlin.Int origin=PERCEQ + $this: CALL '(): Int' type=kotlin.Int origin=PERCEQ other: CONST Int type=kotlin.Int value='5' diff --git a/compiler/testData/ir/irText/expressions/augmentedAssignment2.txt b/compiler/testData/ir/irText/expressions/augmentedAssignment2.txt index e96bde29530..6d2b57ee169 100644 --- a/compiler/testData/ir/irText/expressions/augmentedAssignment2.txt +++ b/compiler/testData/ir/irText/expressions/augmentedAssignment2.txt @@ -17,49 +17,49 @@ FILE /augmentedAssignment2.kt PROPERTY public val p: A FIELD PROPERTY_BACKING_FIELD public val p: A EXPRESSION_BODY - CALL 'constructor A()' type=A operator=null + CALL 'constructor A()' type=A origin=null FUN DEFAULT_PROPERTY_ACCESSOR public fun (): A BLOCK_BODY RETURN type=kotlin.Nothing from='(): A' - GET_BACKING_FIELD 'p: A' type=A operator=null + GET_BACKING_FIELD 'p: A' type=A origin=null FUN public fun testVariable(): kotlin.Unit BLOCK_BODY VAR val a: A - CALL 'constructor A()' type=A operator=null - CALL 'plusAssign(String) on A: Unit' type=kotlin.Unit operator=PLUSEQ - $receiver: GET_VAR 'a: A' type=A operator=PLUSEQ + CALL 'constructor A()' type=A origin=null + CALL 'plusAssign(String) on A: Unit' type=kotlin.Unit origin=PLUSEQ + $receiver: GET_VAR 'a: A' type=A origin=PLUSEQ s: CONST String type=kotlin.String value='+=' - CALL 'minusAssign(String) on A: Unit' type=kotlin.Unit operator=MINUSEQ - $receiver: GET_VAR 'a: A' type=A operator=MINUSEQ + CALL 'minusAssign(String) on A: Unit' type=kotlin.Unit origin=MINUSEQ + $receiver: GET_VAR 'a: A' type=A origin=MINUSEQ s: CONST String type=kotlin.String value='-=' - CALL 'timesAssign(String) on A: Unit' type=kotlin.Unit operator=MULTEQ - $receiver: GET_VAR 'a: A' type=A operator=MULTEQ + CALL 'timesAssign(String) on A: Unit' type=kotlin.Unit origin=MULTEQ + $receiver: GET_VAR 'a: A' type=A origin=MULTEQ s: CONST String type=kotlin.String value='*=' - CALL 'divAssign(String) on A: Unit' type=kotlin.Unit operator=DIVEQ - $receiver: GET_VAR 'a: A' type=A operator=DIVEQ + CALL 'divAssign(String) on A: Unit' type=kotlin.Unit origin=DIVEQ + $receiver: GET_VAR 'a: A' type=A origin=DIVEQ s: CONST String type=kotlin.String value='/=' - CALL 'modAssign(String) on A: Unit' type=kotlin.Unit operator=PERCEQ - $receiver: GET_VAR 'a: A' type=A operator=PERCEQ + CALL 'modAssign(String) on A: Unit' type=kotlin.Unit origin=PERCEQ + $receiver: GET_VAR 'a: A' type=A origin=PERCEQ s: CONST String type=kotlin.String value='*=' FUN public fun testProperty(): kotlin.Unit BLOCK_BODY - BLOCK type=kotlin.Unit operator=PLUSEQ - CALL 'plusAssign(String) on A: Unit' type=kotlin.Unit operator=PLUSEQ - $receiver: CALL '(): A' type=A operator=PLUSEQ + BLOCK type=kotlin.Unit origin=PLUSEQ + CALL 'plusAssign(String) on A: Unit' type=kotlin.Unit origin=PLUSEQ + $receiver: CALL '(): A' type=A origin=PLUSEQ s: CONST String type=kotlin.String value='+=' - BLOCK type=kotlin.Unit operator=MINUSEQ - CALL 'minusAssign(String) on A: Unit' type=kotlin.Unit operator=MINUSEQ - $receiver: CALL '(): A' type=A operator=MINUSEQ + BLOCK type=kotlin.Unit origin=MINUSEQ + CALL 'minusAssign(String) on A: Unit' type=kotlin.Unit origin=MINUSEQ + $receiver: CALL '(): A' type=A origin=MINUSEQ s: CONST String type=kotlin.String value='-=' - BLOCK type=kotlin.Unit operator=MULTEQ - CALL 'timesAssign(String) on A: Unit' type=kotlin.Unit operator=MULTEQ - $receiver: CALL '(): A' type=A operator=MULTEQ + BLOCK type=kotlin.Unit origin=MULTEQ + CALL 'timesAssign(String) on A: Unit' type=kotlin.Unit origin=MULTEQ + $receiver: CALL '(): A' type=A origin=MULTEQ s: CONST String type=kotlin.String value='*=' - BLOCK type=kotlin.Unit operator=DIVEQ - CALL 'divAssign(String) on A: Unit' type=kotlin.Unit operator=DIVEQ - $receiver: CALL '(): A' type=A operator=DIVEQ + BLOCK type=kotlin.Unit origin=DIVEQ + CALL 'divAssign(String) on A: Unit' type=kotlin.Unit origin=DIVEQ + $receiver: CALL '(): A' type=A origin=DIVEQ s: CONST String type=kotlin.String value='/=' - BLOCK type=kotlin.Unit operator=PERCEQ - CALL 'modAssign(String) on A: Unit' type=kotlin.Unit operator=PERCEQ - $receiver: CALL '(): A' type=A operator=PERCEQ + BLOCK type=kotlin.Unit origin=PERCEQ + CALL 'modAssign(String) on A: Unit' type=kotlin.Unit origin=PERCEQ + $receiver: CALL '(): A' type=A origin=PERCEQ s: CONST String type=kotlin.String value='%=' diff --git a/compiler/testData/ir/irText/expressions/augmentedAssignmentWithExpression.txt b/compiler/testData/ir/irText/expressions/augmentedAssignmentWithExpression.txt index d15f90f7c4c..cf256bda5d5 100644 --- a/compiler/testData/ir/irText/expressions/augmentedAssignmentWithExpression.txt +++ b/compiler/testData/ir/irText/expressions/augmentedAssignmentWithExpression.txt @@ -8,26 +8,26 @@ FILE /augmentedAssignmentWithExpression.kt BLOCK_BODY FUN public final fun test1(): kotlin.Unit BLOCK_BODY - CALL 'plusAssign(Int): Unit' type=kotlin.Unit operator=PLUSEQ + CALL 'plusAssign(Int): Unit' type=kotlin.Unit origin=PLUSEQ $this: THIS of 'Host' type=Host x: CONST Int type=kotlin.Int value='1' FUN public fun foo(): Host BLOCK_BODY RETURN type=kotlin.Nothing from='foo(): Host' - CALL 'constructor Host()' type=Host operator=null + CALL 'constructor Host()' type=Host origin=null FUN public fun Host.test2(): kotlin.Unit BLOCK_BODY - CALL 'plusAssign(Int): Unit' type=kotlin.Unit operator=PLUSEQ + CALL 'plusAssign(Int): Unit' type=kotlin.Unit origin=PLUSEQ $this: $RECEIVER of 'test2() on Host: Unit' type=Host x: CONST Int type=kotlin.Int value='1' FUN public fun test3(): kotlin.Unit BLOCK_BODY - CALL 'plusAssign(Int): Unit' type=kotlin.Unit operator=PLUSEQ - $this: CALL 'foo(): Host' type=Host operator=null + CALL 'plusAssign(Int): Unit' type=kotlin.Unit origin=PLUSEQ + $this: CALL 'foo(): Host' type=Host origin=null x: CONST Int type=kotlin.Int value='1' FUN public fun test4(a: () -> Host): kotlin.Unit BLOCK_BODY - CALL 'plusAssign(Int): Unit' type=kotlin.Unit operator=PLUSEQ - $this: CALL 'invoke(): Host' type=Host operator=INVOKE - $this: GET_VAR 'value-parameter a: () -> Host' type=() -> Host operator=VARIABLE_AS_FUNCTION + CALL 'plusAssign(Int): Unit' type=kotlin.Unit origin=PLUSEQ + $this: CALL 'invoke(): Host' type=Host origin=INVOKE + $this: GET_VAR 'value-parameter a: () -> Host' type=() -> Host origin=VARIABLE_AS_FUNCTION x: CONST Int type=kotlin.Int value='1' diff --git a/compiler/testData/ir/irText/expressions/badBreakContinue.txt b/compiler/testData/ir/irText/expressions/badBreakContinue.txt index 40574f244cc..2a34b6696ba 100644 --- a/compiler/testData/ir/irText/expressions/badBreakContinue.txt +++ b/compiler/testData/ir/irText/expressions/badBreakContinue.txt @@ -5,28 +5,28 @@ FILE /badBreakContinue.kt ERROR_EXPR 'Loop not found for continue expression: continue' type=kotlin.Nothing FUN public fun test2(): kotlin.Unit BLOCK_BODY - WHILE label=L1 operator=WHILE_LOOP + WHILE label=L1 origin=WHILE_LOOP condition: CONST Boolean type=kotlin.Boolean value='true' - body: BLOCK type=kotlin.Nothing operator=null + body: BLOCK type=kotlin.Nothing origin=null ERROR_EXPR 'Loop not found for break expression: break@ERROR' type=kotlin.Nothing ERROR_EXPR 'Loop not found for continue expression: continue@ERROR' type=kotlin.Nothing FUN public fun test3(): kotlin.Unit BLOCK_BODY - WHILE label=L1 operator=WHILE_LOOP + WHILE label=L1 origin=WHILE_LOOP condition: CONST Boolean type=kotlin.Boolean value='true' - body: BLOCK type=kotlin.Unit operator=null + body: BLOCK type=kotlin.Unit origin=null VAR val lambda: () -> kotlin.Nothing - BLOCK type=() -> kotlin.Nothing operator=LAMBDA + BLOCK type=() -> kotlin.Nothing origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA local final fun (): kotlin.Nothing BLOCK_BODY ERROR_EXPR 'Loop not found for break expression: break@L1' type=kotlin.Nothing ERROR_EXPR 'Loop not found for continue expression: continue@L1' type=kotlin.Nothing - CALLABLE_REFERENCE '(): Nothing' type=() -> kotlin.Nothing operator=LAMBDA + CALLABLE_REFERENCE '(): Nothing' type=() -> kotlin.Nothing origin=LAMBDA FUN public fun test4(): kotlin.Unit BLOCK_BODY - WHILE label=null operator=WHILE_LOOP + WHILE label=null origin=WHILE_LOOP condition: ERROR_EXPR 'Loop not found for break expression: break' type=kotlin.Nothing - body: BLOCK type=kotlin.Unit operator=null - WHILE label=null operator=WHILE_LOOP + body: BLOCK type=kotlin.Unit origin=null + WHILE label=null origin=WHILE_LOOP condition: ERROR_EXPR 'Loop not found for continue expression: continue' type=kotlin.Nothing - body: BLOCK type=kotlin.Unit operator=null + body: BLOCK type=kotlin.Unit origin=null diff --git a/compiler/testData/ir/irText/expressions/bangbang.txt b/compiler/testData/ir/irText/expressions/bangbang.txt index 5be63385211..df1e0f6bf49 100644 --- a/compiler/testData/ir/irText/expressions/bangbang.txt +++ b/compiler/testData/ir/irText/expressions/bangbang.txt @@ -2,33 +2,33 @@ FILE /bangbang.kt FUN public fun test1(a: kotlin.Any?): kotlin.Any BLOCK_BODY RETURN type=kotlin.Nothing from='test1(Any?): Any' - BLOCK type=kotlin.Any operator=EXCLEXCL + BLOCK type=kotlin.Any origin=EXCLEXCL VAR IR_TEMPORARY_VARIABLE val tmp0_notnull: kotlin.Any? - GET_VAR 'value-parameter a: Any?' type=kotlin.Any? operator=null - WHEN type=kotlin.Any operator=null - if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQ - arg0: GET_VAR 'tmp0_notnull: Any?' type=kotlin.Any? operator=null + GET_VAR 'value-parameter a: Any?' type=kotlin.Any? origin=null + WHEN type=kotlin.Any origin=null + if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'tmp0_notnull: Any?' type=kotlin.Any? origin=null arg1: CONST Null type=kotlin.Nothing? value='null' - then: CALL 'THROW_NPE(): Nothing' type=kotlin.Nothing operator=EXCLEXCL - else: GET_VAR 'tmp0_notnull: Any?' type=kotlin.Any? operator=null + then: CALL 'THROW_NPE(): Nothing' type=kotlin.Nothing origin=EXCLEXCL + else: GET_VAR 'tmp0_notnull: Any?' type=kotlin.Any? origin=null FUN public fun test2(a: kotlin.Any?): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='test2(Any?): Int' - BLOCK type=kotlin.Int operator=EXCLEXCL + BLOCK type=kotlin.Int origin=EXCLEXCL VAR IR_TEMPORARY_VARIABLE val tmp1_notnull: kotlin.Int? - BLOCK type=kotlin.Int? operator=SAFE_CALL + BLOCK type=kotlin.Int? origin=SAFE_CALL VAR IR_TEMPORARY_VARIABLE val tmp0_safe_receiver: kotlin.Any? - GET_VAR 'value-parameter a: Any?' type=kotlin.Any? operator=null - WHEN type=kotlin.Int? operator=SAFE_CALL - if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQ - arg0: GET_VAR 'tmp0_safe_receiver: Any?' type=kotlin.Any? operator=null + GET_VAR 'value-parameter a: Any?' type=kotlin.Any? origin=null + WHEN type=kotlin.Int? origin=SAFE_CALL + if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'tmp0_safe_receiver: Any?' type=kotlin.Any? origin=null arg1: CONST Null type=kotlin.Nothing? value='null' then: CONST Null type=kotlin.Nothing? value='null' - else: CALL 'hashCode(): Int' type=kotlin.Int operator=null - $this: GET_VAR 'tmp0_safe_receiver: Any?' type=kotlin.Any? operator=null - WHEN type=kotlin.Int operator=null - if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQ - arg0: GET_VAR 'tmp1_notnull: Int?' type=kotlin.Int? operator=null + else: CALL 'hashCode(): Int' type=kotlin.Int origin=null + $this: GET_VAR 'tmp0_safe_receiver: Any?' type=kotlin.Any? origin=null + WHEN type=kotlin.Int origin=null + if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'tmp1_notnull: Int?' type=kotlin.Int? origin=null arg1: CONST Null type=kotlin.Nothing? value='null' - then: CALL 'THROW_NPE(): Nothing' type=kotlin.Nothing operator=EXCLEXCL - else: GET_VAR 'tmp1_notnull: Int?' type=kotlin.Int? operator=null + then: CALL 'THROW_NPE(): Nothing' type=kotlin.Nothing origin=EXCLEXCL + else: GET_VAR 'tmp1_notnull: Int?' type=kotlin.Int? origin=null diff --git a/compiler/testData/ir/irText/expressions/booleanOperators.txt b/compiler/testData/ir/irText/expressions/booleanOperators.txt index 73897376a3e..40cb7fe8e3f 100644 --- a/compiler/testData/ir/irText/expressions/booleanOperators.txt +++ b/compiler/testData/ir/irText/expressions/booleanOperators.txt @@ -2,26 +2,26 @@ FILE /booleanOperators.kt FUN public fun test1(a: kotlin.Boolean, b: kotlin.Boolean): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='test1(Boolean, Boolean): Boolean' - WHEN type=kotlin.Boolean operator=ANDAND - if: GET_VAR 'value-parameter a: Boolean' type=kotlin.Boolean operator=null - then: GET_VAR 'value-parameter b: Boolean' type=kotlin.Boolean operator=null + WHEN type=kotlin.Boolean origin=ANDAND + if: GET_VAR 'value-parameter a: Boolean' type=kotlin.Boolean origin=null + then: GET_VAR 'value-parameter b: Boolean' type=kotlin.Boolean origin=null else: CONST Boolean type=kotlin.Boolean value='false' FUN public fun test2(a: kotlin.Boolean, b: kotlin.Boolean): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='test2(Boolean, Boolean): Boolean' - WHEN type=kotlin.Boolean operator=OROR - if: GET_VAR 'value-parameter a: Boolean' type=kotlin.Boolean operator=null + WHEN type=kotlin.Boolean origin=OROR + if: GET_VAR 'value-parameter a: Boolean' type=kotlin.Boolean origin=null then: CONST Boolean type=kotlin.Boolean value='true' - else: GET_VAR 'value-parameter b: Boolean' type=kotlin.Boolean operator=null + else: GET_VAR 'value-parameter b: Boolean' type=kotlin.Boolean origin=null FUN public fun test1x(a: kotlin.Boolean, b: kotlin.Boolean): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='test1x(Boolean, Boolean): Boolean' - CALL 'and(Boolean): Boolean' type=kotlin.Boolean operator=null - $this: GET_VAR 'value-parameter a: Boolean' type=kotlin.Boolean operator=null - other: GET_VAR 'value-parameter b: Boolean' type=kotlin.Boolean operator=null + CALL 'and(Boolean): Boolean' type=kotlin.Boolean origin=null + $this: GET_VAR 'value-parameter a: Boolean' type=kotlin.Boolean origin=null + other: GET_VAR 'value-parameter b: Boolean' type=kotlin.Boolean origin=null FUN public fun test2x(a: kotlin.Boolean, b: kotlin.Boolean): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='test2x(Boolean, Boolean): Boolean' - CALL 'or(Boolean): Boolean' type=kotlin.Boolean operator=null - $this: GET_VAR 'value-parameter a: Boolean' type=kotlin.Boolean operator=null - other: GET_VAR 'value-parameter b: Boolean' type=kotlin.Boolean operator=null + CALL 'or(Boolean): Boolean' type=kotlin.Boolean origin=null + $this: GET_VAR 'value-parameter a: Boolean' type=kotlin.Boolean origin=null + other: GET_VAR 'value-parameter b: Boolean' type=kotlin.Boolean origin=null diff --git a/compiler/testData/ir/irText/expressions/boundCallableReferences.txt b/compiler/testData/ir/irText/expressions/boundCallableReferences.txt index 46ebea42889..7ed1d9a911f 100644 --- a/compiler/testData/ir/irText/expressions/boundCallableReferences.txt +++ b/compiler/testData/ir/irText/expressions/boundCallableReferences.txt @@ -13,34 +13,34 @@ FILE /boundCallableReferences.kt FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'bar: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'bar: Int' type=kotlin.Int origin=null receiver: THIS of 'A' type=A FUN public fun A.qux(): kotlin.Unit BLOCK_BODY PROPERTY public val test1: kotlin.reflect.KFunction0 FIELD PROPERTY_BACKING_FIELD public val test1: kotlin.reflect.KFunction0 EXPRESSION_BODY - CALLABLE_REFERENCE 'foo(): Unit' type=kotlin.reflect.KFunction0 operator=null - $this: CALL 'constructor A()' type=A operator=null + CALLABLE_REFERENCE 'foo(): Unit' type=kotlin.reflect.KFunction0 origin=null + $this: CALL 'constructor A()' type=A origin=null FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.reflect.KFunction0 BLOCK_BODY RETURN type=kotlin.Nothing from='(): KFunction0' - GET_BACKING_FIELD 'test1: KFunction0' type=kotlin.reflect.KFunction0 operator=null + GET_BACKING_FIELD 'test1: KFunction0' type=kotlin.reflect.KFunction0 origin=null PROPERTY public val test2: kotlin.reflect.KProperty0 FIELD PROPERTY_BACKING_FIELD public val test2: kotlin.reflect.KProperty0 EXPRESSION_BODY - CALLABLE_REFERENCE 'bar: Int' type=kotlin.reflect.KProperty0 operator=null - $this: CALL 'constructor A()' type=A operator=null + CALLABLE_REFERENCE 'bar: Int' type=kotlin.reflect.KProperty0 origin=null + $this: CALL 'constructor A()' type=A origin=null FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.reflect.KProperty0 BLOCK_BODY RETURN type=kotlin.Nothing from='(): KProperty0' - GET_BACKING_FIELD 'test2: KProperty0' type=kotlin.reflect.KProperty0 operator=null + GET_BACKING_FIELD 'test2: KProperty0' type=kotlin.reflect.KProperty0 origin=null PROPERTY public val test3: kotlin.reflect.KFunction0 FIELD PROPERTY_BACKING_FIELD public val test3: kotlin.reflect.KFunction0 EXPRESSION_BODY - CALLABLE_REFERENCE 'qux() on A: Unit' type=kotlin.reflect.KFunction0 operator=null - $receiver: CALL 'constructor A()' type=A operator=null + CALLABLE_REFERENCE 'qux() on A: Unit' type=kotlin.reflect.KFunction0 origin=null + $receiver: CALL 'constructor A()' type=A origin=null FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.reflect.KFunction0 BLOCK_BODY RETURN type=kotlin.Nothing from='(): KFunction0' - GET_BACKING_FIELD 'test3: KFunction0' type=kotlin.reflect.KFunction0 operator=null + GET_BACKING_FIELD 'test3: KFunction0' type=kotlin.reflect.KFunction0 origin=null diff --git a/compiler/testData/ir/irText/expressions/breakContinue.txt b/compiler/testData/ir/irText/expressions/breakContinue.txt index e3adf1d4ef5..40e86a3c20b 100644 --- a/compiler/testData/ir/irText/expressions/breakContinue.txt +++ b/compiler/testData/ir/irText/expressions/breakContinue.txt @@ -1,57 +1,57 @@ FILE /breakContinue.kt FUN public fun test1(): kotlin.Unit BLOCK_BODY - WHILE label=null operator=WHILE_LOOP + WHILE label=null origin=WHILE_LOOP condition: CONST Boolean type=kotlin.Boolean value='true' - body: BLOCK type=kotlin.Nothing operator=null + body: BLOCK type=kotlin.Nothing origin=null BREAK label=null loop.label=null depth=0 - DO_WHILE label=null operator=DO_WHILE_LOOP - body: BLOCK type=kotlin.Unit operator=null + DO_WHILE label=null origin=DO_WHILE_LOOP + body: BLOCK type=kotlin.Unit origin=null BREAK label=null loop.label=null depth=0 condition: CONST Boolean type=kotlin.Boolean value='true' - WHILE label=null operator=WHILE_LOOP + WHILE label=null origin=WHILE_LOOP condition: CONST Boolean type=kotlin.Boolean value='true' - body: BLOCK type=kotlin.Nothing operator=null + body: BLOCK type=kotlin.Nothing origin=null CONTINUE label=null loop.label=null depth=0 - DO_WHILE label=null operator=DO_WHILE_LOOP - body: BLOCK type=kotlin.Unit operator=null + DO_WHILE label=null origin=DO_WHILE_LOOP + body: BLOCK type=kotlin.Unit origin=null CONTINUE label=null loop.label=null depth=0 condition: CONST Boolean type=kotlin.Boolean value='true' FUN public fun test2(): kotlin.Unit BLOCK_BODY - WHILE label=OUTER operator=WHILE_LOOP + WHILE label=OUTER origin=WHILE_LOOP condition: CONST Boolean type=kotlin.Boolean value='true' - body: BLOCK type=kotlin.Nothing operator=null - WHILE label=INNER operator=WHILE_LOOP + body: BLOCK type=kotlin.Nothing origin=null + WHILE label=INNER origin=WHILE_LOOP condition: CONST Boolean type=kotlin.Boolean value='true' - body: BLOCK type=kotlin.Nothing operator=null + body: BLOCK type=kotlin.Nothing origin=null BREAK label=INNER loop.label=INNER depth=0 BREAK label=OUTER loop.label=OUTER depth=1 BREAK label=OUTER loop.label=OUTER depth=0 - WHILE label=OUTER operator=WHILE_LOOP + WHILE label=OUTER origin=WHILE_LOOP condition: CONST Boolean type=kotlin.Boolean value='true' - body: BLOCK type=kotlin.Nothing operator=null - WHILE label=INNER operator=WHILE_LOOP + body: BLOCK type=kotlin.Nothing origin=null + WHILE label=INNER origin=WHILE_LOOP condition: CONST Boolean type=kotlin.Boolean value='true' - body: BLOCK type=kotlin.Nothing operator=null + body: BLOCK type=kotlin.Nothing origin=null CONTINUE label=INNER loop.label=INNER depth=0 CONTINUE label=OUTER loop.label=OUTER depth=1 CONTINUE label=OUTER loop.label=OUTER depth=0 FUN public fun test3(): kotlin.Unit BLOCK_BODY - WHILE label=L operator=WHILE_LOOP + WHILE label=L origin=WHILE_LOOP condition: CONST Boolean type=kotlin.Boolean value='true' - body: BLOCK type=kotlin.Nothing operator=null - WHILE label=L operator=WHILE_LOOP + body: BLOCK type=kotlin.Nothing origin=null + WHILE label=L origin=WHILE_LOOP condition: CONST Boolean type=kotlin.Boolean value='true' - body: BLOCK type=kotlin.Nothing operator=null + body: BLOCK type=kotlin.Nothing origin=null BREAK label=L loop.label=L depth=0 BREAK label=L loop.label=L depth=0 - WHILE label=L operator=WHILE_LOOP + WHILE label=L origin=WHILE_LOOP condition: CONST Boolean type=kotlin.Boolean value='true' - body: BLOCK type=kotlin.Nothing operator=null - WHILE label=L operator=WHILE_LOOP + body: BLOCK type=kotlin.Nothing origin=null + WHILE label=L origin=WHILE_LOOP condition: CONST Boolean type=kotlin.Boolean value='true' - body: BLOCK type=kotlin.Nothing operator=null + body: BLOCK type=kotlin.Nothing origin=null CONTINUE label=L loop.label=L depth=0 CONTINUE label=L loop.label=L depth=0 diff --git a/compiler/testData/ir/irText/expressions/breakContinueInLoopHeader.txt b/compiler/testData/ir/irText/expressions/breakContinueInLoopHeader.txt index 533b38f82e3..5c41ba57148 100644 --- a/compiler/testData/ir/irText/expressions/breakContinueInLoopHeader.txt +++ b/compiler/testData/ir/irText/expressions/breakContinueInLoopHeader.txt @@ -1,79 +1,79 @@ FILE /breakContinueInLoopHeader.kt FUN public fun test1(c: kotlin.Boolean?): kotlin.Unit BLOCK_BODY - WHILE label=L operator=WHILE_LOOP + WHILE label=L origin=WHILE_LOOP condition: CONST Boolean type=kotlin.Boolean value='true' - body: BLOCK type=kotlin.Unit operator=null - WHILE label=null operator=WHILE_LOOP - condition: BLOCK type=kotlin.Boolean operator=ELVIS + body: BLOCK type=kotlin.Unit origin=null + WHILE label=null origin=WHILE_LOOP + condition: BLOCK type=kotlin.Boolean origin=ELVIS VAR IR_TEMPORARY_VARIABLE val tmp0_elvis_lhs: kotlin.Boolean? - GET_VAR 'value-parameter c: Boolean?' type=kotlin.Boolean? operator=null - WHEN type=kotlin.Boolean operator=null - if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQ - arg0: GET_VAR 'tmp0_elvis_lhs: Boolean?' type=kotlin.Boolean? operator=null + GET_VAR 'value-parameter c: Boolean?' type=kotlin.Boolean? origin=null + WHEN type=kotlin.Boolean origin=null + if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'tmp0_elvis_lhs: Boolean?' type=kotlin.Boolean? origin=null arg1: CONST Null type=kotlin.Nothing? value='null' then: BREAK label=null loop.label=L depth=1 - else: GET_VAR 'tmp0_elvis_lhs: Boolean?' type=kotlin.Boolean? operator=null + else: GET_VAR 'tmp0_elvis_lhs: Boolean?' type=kotlin.Boolean? origin=null FUN public fun test2(c: kotlin.Boolean?): kotlin.Unit BLOCK_BODY - WHILE label=L operator=WHILE_LOOP + WHILE label=L origin=WHILE_LOOP condition: CONST Boolean type=kotlin.Boolean value='true' - body: BLOCK type=kotlin.Unit operator=null - WHILE label=null operator=WHILE_LOOP - condition: BLOCK type=kotlin.Boolean operator=ELVIS + body: BLOCK type=kotlin.Unit origin=null + WHILE label=null origin=WHILE_LOOP + condition: BLOCK type=kotlin.Boolean origin=ELVIS VAR IR_TEMPORARY_VARIABLE val tmp0_elvis_lhs: kotlin.Boolean? - GET_VAR 'value-parameter c: Boolean?' type=kotlin.Boolean? operator=null - WHEN type=kotlin.Boolean operator=null - if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQ - arg0: GET_VAR 'tmp0_elvis_lhs: Boolean?' type=kotlin.Boolean? operator=null + GET_VAR 'value-parameter c: Boolean?' type=kotlin.Boolean? origin=null + WHEN type=kotlin.Boolean origin=null + if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'tmp0_elvis_lhs: Boolean?' type=kotlin.Boolean? origin=null arg1: CONST Null type=kotlin.Nothing? value='null' then: CONTINUE label=null loop.label=L depth=1 - else: GET_VAR 'tmp0_elvis_lhs: Boolean?' type=kotlin.Boolean? operator=null + else: GET_VAR 'tmp0_elvis_lhs: Boolean?' type=kotlin.Boolean? origin=null FUN public fun test3(ss: kotlin.collections.List?): kotlin.Unit BLOCK_BODY - WHILE label=L operator=WHILE_LOOP + WHILE label=L origin=WHILE_LOOP condition: CONST Boolean type=kotlin.Boolean value='true' - body: BLOCK type=kotlin.Unit operator=null - BLOCK type=kotlin.Unit operator=FOR_LOOP + body: BLOCK type=kotlin.Unit origin=null + BLOCK type=kotlin.Unit origin=FOR_LOOP VAR IR_TEMPORARY_VARIABLE val tmp1_iterator: kotlin.collections.Iterator - CALL 'iterator(): Iterator' type=kotlin.collections.Iterator operator=FOR_LOOP_ITERATOR - $this: BLOCK type=kotlin.collections.List operator=ELVIS + CALL 'iterator(): Iterator' type=kotlin.collections.Iterator origin=FOR_LOOP_ITERATOR + $this: BLOCK type=kotlin.collections.List origin=ELVIS VAR IR_TEMPORARY_VARIABLE val tmp0_elvis_lhs: kotlin.collections.List? - GET_VAR 'value-parameter ss: List?' type=kotlin.collections.List? operator=null - WHEN type=kotlin.collections.List operator=null - if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQ - arg0: GET_VAR 'tmp0_elvis_lhs: List?' type=kotlin.collections.List? operator=null + GET_VAR 'value-parameter ss: List?' type=kotlin.collections.List? origin=null + WHEN type=kotlin.collections.List origin=null + if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'tmp0_elvis_lhs: List?' type=kotlin.collections.List? origin=null arg1: CONST Null type=kotlin.Nothing? value='null' then: CONTINUE label=null loop.label=L depth=0 - else: GET_VAR 'tmp0_elvis_lhs: List?' type=kotlin.collections.List? operator=null - WHILE label=null operator=FOR_LOOP_INNER_WHILE - condition: CALL 'hasNext(): Boolean' type=kotlin.Boolean operator=FOR_LOOP_HAS_NEXT - $this: GET_VAR 'tmp1_iterator: Iterator' type=kotlin.collections.Iterator operator=null - body: BLOCK type=kotlin.Unit operator=FOR_LOOP_INNER_WHILE + else: GET_VAR 'tmp0_elvis_lhs: List?' type=kotlin.collections.List? origin=null + WHILE label=null origin=FOR_LOOP_INNER_WHILE + condition: CALL 'hasNext(): Boolean' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + $this: GET_VAR 'tmp1_iterator: Iterator' type=kotlin.collections.Iterator origin=null + body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE VAR val s: kotlin.String - CALL 'next(): String' type=kotlin.String operator=FOR_LOOP_NEXT - $this: GET_VAR 'tmp1_iterator: Iterator' type=kotlin.collections.Iterator operator=null + CALL 'next(): String' type=kotlin.String origin=FOR_LOOP_NEXT + $this: GET_VAR 'tmp1_iterator: Iterator' type=kotlin.collections.Iterator origin=null FUN public fun test4(ss: kotlin.collections.List?): kotlin.Unit BLOCK_BODY - WHILE label=L operator=WHILE_LOOP + WHILE label=L origin=WHILE_LOOP condition: CONST Boolean type=kotlin.Boolean value='true' - body: BLOCK type=kotlin.Unit operator=null - BLOCK type=kotlin.Unit operator=FOR_LOOP + body: BLOCK type=kotlin.Unit origin=null + BLOCK type=kotlin.Unit origin=FOR_LOOP VAR IR_TEMPORARY_VARIABLE val tmp1_iterator: kotlin.collections.Iterator - CALL 'iterator(): Iterator' type=kotlin.collections.Iterator operator=FOR_LOOP_ITERATOR - $this: BLOCK type=kotlin.collections.List operator=ELVIS + CALL 'iterator(): Iterator' type=kotlin.collections.Iterator origin=FOR_LOOP_ITERATOR + $this: BLOCK type=kotlin.collections.List origin=ELVIS VAR IR_TEMPORARY_VARIABLE val tmp0_elvis_lhs: kotlin.collections.List? - GET_VAR 'value-parameter ss: List?' type=kotlin.collections.List? operator=null - WHEN type=kotlin.collections.List operator=null - if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQ - arg0: GET_VAR 'tmp0_elvis_lhs: List?' type=kotlin.collections.List? operator=null + GET_VAR 'value-parameter ss: List?' type=kotlin.collections.List? origin=null + WHEN type=kotlin.collections.List origin=null + if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'tmp0_elvis_lhs: List?' type=kotlin.collections.List? origin=null arg1: CONST Null type=kotlin.Nothing? value='null' then: BREAK label=null loop.label=L depth=0 - else: GET_VAR 'tmp0_elvis_lhs: List?' type=kotlin.collections.List? operator=null - WHILE label=null operator=FOR_LOOP_INNER_WHILE - condition: CALL 'hasNext(): Boolean' type=kotlin.Boolean operator=FOR_LOOP_HAS_NEXT - $this: GET_VAR 'tmp1_iterator: Iterator' type=kotlin.collections.Iterator operator=null - body: BLOCK type=kotlin.Unit operator=FOR_LOOP_INNER_WHILE + else: GET_VAR 'tmp0_elvis_lhs: List?' type=kotlin.collections.List? origin=null + WHILE label=null origin=FOR_LOOP_INNER_WHILE + condition: CALL 'hasNext(): Boolean' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + $this: GET_VAR 'tmp1_iterator: Iterator' type=kotlin.collections.Iterator origin=null + body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE VAR val s: kotlin.String - CALL 'next(): String' type=kotlin.String operator=FOR_LOOP_NEXT - $this: GET_VAR 'tmp1_iterator: Iterator' type=kotlin.collections.Iterator operator=null + CALL 'next(): String' type=kotlin.String origin=FOR_LOOP_NEXT + $this: GET_VAR 'tmp1_iterator: Iterator' type=kotlin.collections.Iterator origin=null diff --git a/compiler/testData/ir/irText/expressions/callWithReorderedArguments.txt b/compiler/testData/ir/irText/expressions/callWithReorderedArguments.txt index 2ac23823706..954f2b2cf25 100644 --- a/compiler/testData/ir/irText/expressions/callWithReorderedArguments.txt +++ b/compiler/testData/ir/irText/expressions/callWithReorderedArguments.txt @@ -19,22 +19,22 @@ FILE /callWithReorderedArguments.kt CONST Int type=kotlin.Int value='2' FUN public fun test(): kotlin.Unit BLOCK_BODY - CALL 'foo(Int, Int): Unit' type=kotlin.Unit operator=null - a: CALL 'noReorder1(): Int' type=kotlin.Int operator=null - b: CALL 'noReorder2(): Int' type=kotlin.Int operator=null - BLOCK type=kotlin.Unit operator=ARGUMENTS_REORDERING_FOR_CALL + CALL 'foo(Int, Int): Unit' type=kotlin.Unit origin=null + a: CALL 'noReorder1(): Int' type=kotlin.Int origin=null + b: CALL 'noReorder2(): Int' type=kotlin.Int origin=null + BLOCK type=kotlin.Unit origin=ARGUMENTS_REORDERING_FOR_CALL VAR IR_TEMPORARY_VARIABLE val tmp0_b: kotlin.Int - CALL 'reordered1(): Int' type=kotlin.Int operator=null + CALL 'reordered1(): Int' type=kotlin.Int origin=null VAR IR_TEMPORARY_VARIABLE val tmp1_a: kotlin.Int - CALL 'reordered2(): Int' type=kotlin.Int operator=null - CALL 'foo(Int, Int): Unit' type=kotlin.Unit operator=null - a: GET_VAR 'tmp1_a: Int' type=kotlin.Int operator=null - b: GET_VAR 'tmp0_b: Int' type=kotlin.Int operator=null - BLOCK type=kotlin.Unit operator=ARGUMENTS_REORDERING_FOR_CALL + CALL 'reordered2(): Int' type=kotlin.Int origin=null + CALL 'foo(Int, Int): Unit' type=kotlin.Unit origin=null + a: GET_VAR 'tmp1_a: Int' type=kotlin.Int origin=null + b: GET_VAR 'tmp0_b: Int' type=kotlin.Int origin=null + BLOCK type=kotlin.Unit origin=ARGUMENTS_REORDERING_FOR_CALL VAR IR_TEMPORARY_VARIABLE val tmp2_b: kotlin.Int CONST Int type=kotlin.Int value='1' VAR IR_TEMPORARY_VARIABLE val tmp3_a: kotlin.Int - CALL 'reordered2(): Int' type=kotlin.Int operator=null - CALL 'foo(Int, Int): Unit' type=kotlin.Unit operator=null - a: GET_VAR 'tmp3_a: Int' type=kotlin.Int operator=null - b: GET_VAR 'tmp2_b: Int' type=kotlin.Int operator=null + CALL 'reordered2(): Int' type=kotlin.Int origin=null + CALL 'foo(Int, Int): Unit' type=kotlin.Unit origin=null + a: GET_VAR 'tmp3_a: Int' type=kotlin.Int origin=null + b: GET_VAR 'tmp2_b: Int' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/calls.txt b/compiler/testData/ir/irText/expressions/calls.txt index bdc254b8de1..417b9fdf871 100644 --- a/compiler/testData/ir/irText/expressions/calls.txt +++ b/compiler/testData/ir/irText/expressions/calls.txt @@ -2,21 +2,21 @@ FILE /calls.kt FUN public fun foo(x: kotlin.Int, y: kotlin.Int): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='foo(Int, Int): Int' - GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=null + GET_VAR 'value-parameter x: Int' type=kotlin.Int origin=null FUN public fun bar(x: kotlin.Int): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='bar(Int): Int' - CALL 'foo(Int, Int): Int' type=kotlin.Int operator=null - x: GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=null + CALL 'foo(Int, Int): Int' type=kotlin.Int origin=null + x: GET_VAR 'value-parameter x: Int' type=kotlin.Int origin=null y: CONST Int type=kotlin.Int value='1' FUN public fun qux(x: kotlin.Int): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='qux(Int): Int' - CALL 'foo(Int, Int): Int' type=kotlin.Int operator=null - x: CALL 'foo(Int, Int): Int' type=kotlin.Int operator=null - x: GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=null - y: GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=null - y: GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=null + CALL 'foo(Int, Int): Int' type=kotlin.Int origin=null + x: CALL 'foo(Int, Int): Int' type=kotlin.Int origin=null + x: GET_VAR 'value-parameter x: Int' type=kotlin.Int origin=null + y: GET_VAR 'value-parameter x: Int' type=kotlin.Int origin=null + y: GET_VAR 'value-parameter x: Int' type=kotlin.Int origin=null FUN public fun kotlin.Int.ext1(): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='ext1() on Int: Int' @@ -24,13 +24,13 @@ FILE /calls.kt FUN public fun kotlin.Int.ext2(x: kotlin.Int): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='ext2(Int) on Int: Int' - CALL 'foo(Int, Int): Int' type=kotlin.Int operator=null + CALL 'foo(Int, Int): Int' type=kotlin.Int origin=null x: $RECEIVER of 'ext2(Int) on Int: Int' type=kotlin.Int - y: GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=null + y: GET_VAR 'value-parameter x: Int' type=kotlin.Int origin=null FUN public fun kotlin.Int.ext3(x: kotlin.Int): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='ext3(Int) on Int: Int' - CALL 'foo(Int, Int): Int' type=kotlin.Int operator=null - x: CALL 'ext1() on Int: Int' type=kotlin.Int operator=null + CALL 'foo(Int, Int): Int' type=kotlin.Int origin=null + x: CALL 'ext1() on Int: Int' type=kotlin.Int origin=null $receiver: $RECEIVER of 'ext3(Int) on Int: Int' type=kotlin.Int - y: GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=null + y: GET_VAR 'value-parameter x: Int' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/chainOfSafeCalls.txt b/compiler/testData/ir/irText/expressions/chainOfSafeCalls.txt index 3cb9f1fdecd..0be40ad52d2 100644 --- a/compiler/testData/ir/irText/expressions/chainOfSafeCalls.txt +++ b/compiler/testData/ir/irText/expressions/chainOfSafeCalls.txt @@ -15,40 +15,40 @@ FILE /chainOfSafeCalls.kt FUN public fun test(nc: C?): C? BLOCK_BODY RETURN type=kotlin.Nothing from='test(C?): C?' - BLOCK type=C? operator=SAFE_CALL + BLOCK type=C? origin=SAFE_CALL VAR IR_TEMPORARY_VARIABLE val tmp3_safe_receiver: C? - BLOCK type=C? operator=SAFE_CALL + BLOCK type=C? origin=SAFE_CALL VAR IR_TEMPORARY_VARIABLE val tmp2_safe_receiver: C? - BLOCK type=C? operator=SAFE_CALL + BLOCK type=C? origin=SAFE_CALL VAR IR_TEMPORARY_VARIABLE val tmp1_safe_receiver: C? - BLOCK type=C? operator=SAFE_CALL + BLOCK type=C? origin=SAFE_CALL VAR IR_TEMPORARY_VARIABLE val tmp0_safe_receiver: C? - GET_VAR 'value-parameter nc: C?' type=C? operator=null - WHEN type=C? operator=SAFE_CALL - if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQ - arg0: GET_VAR 'tmp0_safe_receiver: C?' type=C? operator=null + GET_VAR 'value-parameter nc: C?' type=C? origin=null + WHEN type=C? origin=SAFE_CALL + if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'tmp0_safe_receiver: C?' type=C? origin=null arg1: CONST Null type=kotlin.Nothing? value='null' then: CONST Null type=kotlin.Nothing? value='null' - else: CALL 'foo(): C' type=C operator=null - $this: GET_VAR 'tmp0_safe_receiver: C?' type=C? operator=null - WHEN type=C? operator=SAFE_CALL - if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQ - arg0: GET_VAR 'tmp1_safe_receiver: C?' type=C? operator=null + else: CALL 'foo(): C' type=C origin=null + $this: GET_VAR 'tmp0_safe_receiver: C?' type=C? origin=null + WHEN type=C? origin=SAFE_CALL + if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'tmp1_safe_receiver: C?' type=C? origin=null arg1: CONST Null type=kotlin.Nothing? value='null' then: CONST Null type=kotlin.Nothing? value='null' - else: CALL 'bar(): C?' type=C? operator=null - $this: GET_VAR 'tmp1_safe_receiver: C?' type=C? operator=null - WHEN type=C? operator=SAFE_CALL - if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQ - arg0: GET_VAR 'tmp2_safe_receiver: C?' type=C? operator=null + else: CALL 'bar(): C?' type=C? origin=null + $this: GET_VAR 'tmp1_safe_receiver: C?' type=C? origin=null + WHEN type=C? origin=SAFE_CALL + if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'tmp2_safe_receiver: C?' type=C? origin=null arg1: CONST Null type=kotlin.Nothing? value='null' then: CONST Null type=kotlin.Nothing? value='null' - else: CALL 'foo(): C' type=C operator=null - $this: GET_VAR 'tmp2_safe_receiver: C?' type=C? operator=null - WHEN type=C? operator=SAFE_CALL - if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQ - arg0: GET_VAR 'tmp3_safe_receiver: C?' type=C? operator=null + else: CALL 'foo(): C' type=C origin=null + $this: GET_VAR 'tmp2_safe_receiver: C?' type=C? origin=null + WHEN type=C? origin=SAFE_CALL + if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'tmp3_safe_receiver: C?' type=C? origin=null arg1: CONST Null type=kotlin.Nothing? value='null' then: CONST Null type=kotlin.Nothing? value='null' - else: CALL 'foo(): C' type=C operator=null - $this: GET_VAR 'tmp3_safe_receiver: C?' type=C? operator=null + else: CALL 'foo(): C' type=C origin=null + $this: GET_VAR 'tmp3_safe_receiver: C?' type=C? origin=null diff --git a/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.txt b/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.txt index 132cd2be0d6..fe80e55147e 100644 --- a/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.txt +++ b/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.txt @@ -11,13 +11,13 @@ FILE /complexAugmentedAssignment.kt FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'x1: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'x1: Int' type=kotlin.Int origin=null receiver: THIS of 'X1' type=X1 FUN DEFAULT_PROPERTY_ACCESSOR public final fun (: kotlin.Int): kotlin.Unit BLOCK_BODY - SET_BACKING_FIELD 'x1: Int' type=kotlin.Unit operator=null + SET_BACKING_FIELD 'x1: Int' type=kotlin.Unit origin=null receiver: THIS of 'X1' type=X1 - value: GET_VAR 'value-parameter : Int' type=kotlin.Int operator=null + value: GET_VAR 'value-parameter : Int' type=kotlin.Int origin=null CLASS OBJECT X2 CONSTRUCTOR private constructor X2() BLOCK_BODY @@ -30,13 +30,13 @@ FILE /complexAugmentedAssignment.kt FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'x2: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'x2: Int' type=kotlin.Int origin=null receiver: THIS of 'X2' type=X1.X2 FUN DEFAULT_PROPERTY_ACCESSOR public final fun (: kotlin.Int): kotlin.Unit BLOCK_BODY - SET_BACKING_FIELD 'x2: Int' type=kotlin.Unit operator=null + SET_BACKING_FIELD 'x2: Int' type=kotlin.Unit origin=null receiver: THIS of 'X2' type=X1.X2 - value: GET_VAR 'value-parameter : Int' type=kotlin.Int operator=null + value: GET_VAR 'value-parameter : Int' type=kotlin.Int origin=null CLASS OBJECT X3 CONSTRUCTOR private constructor X3() BLOCK_BODY @@ -49,76 +49,76 @@ FILE /complexAugmentedAssignment.kt FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'x3: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'x3: Int' type=kotlin.Int origin=null receiver: THIS of 'X3' type=X1.X2.X3 FUN DEFAULT_PROPERTY_ACCESSOR public final fun (: kotlin.Int): kotlin.Unit BLOCK_BODY - SET_BACKING_FIELD 'x3: Int' type=kotlin.Unit operator=null + SET_BACKING_FIELD 'x3: Int' type=kotlin.Unit origin=null receiver: THIS of 'X3' type=X1.X2.X3 - value: GET_VAR 'value-parameter : Int' type=kotlin.Int operator=null + value: GET_VAR 'value-parameter : Int' type=kotlin.Int origin=null FUN public fun test1(a: kotlin.IntArray): kotlin.Unit BLOCK_BODY VAR var i: kotlin.Int CONST Int type=kotlin.Int value='0' - BLOCK type=kotlin.Int operator=POSTFIX_INCR + BLOCK type=kotlin.Int origin=POSTFIX_INCR VAR IR_TEMPORARY_VARIABLE val tmp1_array: kotlin.IntArray - GET_VAR 'value-parameter a: IntArray' type=kotlin.IntArray operator=null + GET_VAR 'value-parameter a: IntArray' type=kotlin.IntArray origin=null VAR IR_TEMPORARY_VARIABLE val tmp2_index0: kotlin.Int - BLOCK type=kotlin.Int operator=POSTFIX_INCR + BLOCK type=kotlin.Int origin=POSTFIX_INCR VAR IR_TEMPORARY_VARIABLE val tmp0: kotlin.Int - GET_VAR 'i: Int' type=kotlin.Int operator=POSTFIX_INCR - SET_VAR 'i: Int' type=kotlin.Unit operator=POSTFIX_INCR - CALL 'inc(): Int' type=kotlin.Int operator=POSTFIX_INCR - $this: GET_VAR 'tmp0: Int' type=kotlin.Int operator=null - GET_VAR 'tmp0: Int' type=kotlin.Int operator=null + GET_VAR 'i: Int' type=kotlin.Int origin=POSTFIX_INCR + SET_VAR 'i: Int' type=kotlin.Unit origin=POSTFIX_INCR + CALL 'inc(): Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'tmp0: Int' type=kotlin.Int origin=null + GET_VAR 'tmp0: Int' type=kotlin.Int origin=null VAR IR_TEMPORARY_VARIABLE val tmp3: kotlin.Int - CALL 'get(Int): Int' type=kotlin.Int operator=POSTFIX_INCR - $this: GET_VAR 'tmp1_array: IntArray' type=kotlin.IntArray operator=null - index: GET_VAR 'tmp2_index0: Int' type=kotlin.Int operator=null - CALL 'set(Int, Int): Unit' type=kotlin.Unit operator=POSTFIX_INCR - $this: GET_VAR 'tmp1_array: IntArray' type=kotlin.IntArray operator=null - index: GET_VAR 'tmp2_index0: Int' type=kotlin.Int operator=null - value: CALL 'inc(): Int' type=kotlin.Int operator=POSTFIX_INCR - $this: GET_VAR 'tmp3: Int' type=kotlin.Int operator=null - GET_VAR 'tmp3: Int' type=kotlin.Int operator=null + CALL 'get(Int): Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'tmp1_array: IntArray' type=kotlin.IntArray origin=null + index: GET_VAR 'tmp2_index0: Int' type=kotlin.Int origin=null + CALL 'set(Int, Int): Unit' type=kotlin.Unit origin=POSTFIX_INCR + $this: GET_VAR 'tmp1_array: IntArray' type=kotlin.IntArray origin=null + index: GET_VAR 'tmp2_index0: Int' type=kotlin.Int origin=null + value: CALL 'inc(): Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'tmp3: Int' type=kotlin.Int origin=null + GET_VAR 'tmp3: Int' type=kotlin.Int origin=null FUN public fun test2(): kotlin.Unit BLOCK_BODY - BLOCK type=kotlin.Int operator=POSTFIX_INCR + BLOCK type=kotlin.Int origin=POSTFIX_INCR VAR IR_TEMPORARY_VARIABLE val tmp0_this: X1 GET_OBJECT 'X1' type=X1 - BLOCK type=kotlin.Int operator=POSTFIX_INCR + BLOCK type=kotlin.Int origin=POSTFIX_INCR VAR IR_TEMPORARY_VARIABLE val tmp1: kotlin.Int - CALL '(): Int' type=kotlin.Int operator=POSTFIX_INCR - $this: GET_VAR 'tmp0_this: X1' type=X1 operator=null - CALL '(Int): Unit' type=kotlin.Unit operator=POSTFIX_INCR - $this: GET_VAR 'tmp0_this: X1' type=X1 operator=null - : CALL 'inc(): Int' type=kotlin.Int operator=POSTFIX_INCR - $this: GET_VAR 'tmp1: Int' type=kotlin.Int operator=null - GET_VAR 'tmp1: Int' type=kotlin.Int operator=null - BLOCK type=kotlin.Int operator=POSTFIX_INCR + CALL '(): Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'tmp0_this: X1' type=X1 origin=null + CALL '(Int): Unit' type=kotlin.Unit origin=POSTFIX_INCR + $this: GET_VAR 'tmp0_this: X1' type=X1 origin=null + : CALL 'inc(): Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'tmp1: Int' type=kotlin.Int origin=null + GET_VAR 'tmp1: Int' type=kotlin.Int origin=null + BLOCK type=kotlin.Int origin=POSTFIX_INCR VAR IR_TEMPORARY_VARIABLE val tmp2_this: X1.X2 GET_OBJECT 'X2' type=X1.X2 - BLOCK type=kotlin.Int operator=POSTFIX_INCR + BLOCK type=kotlin.Int origin=POSTFIX_INCR VAR IR_TEMPORARY_VARIABLE val tmp3: kotlin.Int - CALL '(): Int' type=kotlin.Int operator=POSTFIX_INCR - $this: GET_VAR 'tmp2_this: X1.X2' type=X1.X2 operator=null - CALL '(Int): Unit' type=kotlin.Unit operator=POSTFIX_INCR - $this: GET_VAR 'tmp2_this: X1.X2' type=X1.X2 operator=null - : CALL 'inc(): Int' type=kotlin.Int operator=POSTFIX_INCR - $this: GET_VAR 'tmp3: Int' type=kotlin.Int operator=null - GET_VAR 'tmp3: Int' type=kotlin.Int operator=null - BLOCK type=kotlin.Int operator=POSTFIX_INCR + CALL '(): Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'tmp2_this: X1.X2' type=X1.X2 origin=null + CALL '(Int): Unit' type=kotlin.Unit origin=POSTFIX_INCR + $this: GET_VAR 'tmp2_this: X1.X2' type=X1.X2 origin=null + : CALL 'inc(): Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'tmp3: Int' type=kotlin.Int origin=null + GET_VAR 'tmp3: Int' type=kotlin.Int origin=null + BLOCK type=kotlin.Int origin=POSTFIX_INCR VAR IR_TEMPORARY_VARIABLE val tmp4_this: X1.X2.X3 GET_OBJECT 'X3' type=X1.X2.X3 - BLOCK type=kotlin.Int operator=POSTFIX_INCR + BLOCK type=kotlin.Int origin=POSTFIX_INCR VAR IR_TEMPORARY_VARIABLE val tmp5: kotlin.Int - CALL '(): Int' type=kotlin.Int operator=POSTFIX_INCR - $this: GET_VAR 'tmp4_this: X1.X2.X3' type=X1.X2.X3 operator=null - CALL '(Int): Unit' type=kotlin.Unit operator=POSTFIX_INCR - $this: GET_VAR 'tmp4_this: X1.X2.X3' type=X1.X2.X3 operator=null - : CALL 'inc(): Int' type=kotlin.Int operator=POSTFIX_INCR - $this: GET_VAR 'tmp5: Int' type=kotlin.Int operator=null - GET_VAR 'tmp5: Int' type=kotlin.Int operator=null + CALL '(): Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'tmp4_this: X1.X2.X3' type=X1.X2.X3 origin=null + CALL '(Int): Unit' type=kotlin.Unit origin=POSTFIX_INCR + $this: GET_VAR 'tmp4_this: X1.X2.X3' type=X1.X2.X3 origin=null + : CALL 'inc(): Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'tmp5: Int' type=kotlin.Int origin=null + GET_VAR 'tmp5: Int' type=kotlin.Int origin=null CLASS CLASS B CONSTRUCTOR public constructor B(s: kotlin.Int = ...) s: EXPRESSION_BODY @@ -129,17 +129,17 @@ FILE /complexAugmentedAssignment.kt PROPERTY public final var s: kotlin.Int FIELD PROPERTY_BACKING_FIELD public final var s: kotlin.Int EXPRESSION_BODY - GET_VAR 'value-parameter s: Int = ...' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER + GET_VAR 'value-parameter s: Int = ...' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 's: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 's: Int' type=kotlin.Int origin=null receiver: THIS of 'B' type=B FUN DEFAULT_PROPERTY_ACCESSOR public final fun (: kotlin.Int): kotlin.Unit BLOCK_BODY - SET_BACKING_FIELD 's: Int' type=kotlin.Unit operator=null + SET_BACKING_FIELD 's: Int' type=kotlin.Unit origin=null receiver: THIS of 'B' type=B - value: GET_VAR 'value-parameter : Int' type=kotlin.Int operator=null + value: GET_VAR 'value-parameter : Int' type=kotlin.Int origin=null CLASS OBJECT Host CONSTRUCTOR private constructor Host() BLOCK_BODY @@ -147,20 +147,20 @@ FILE /complexAugmentedAssignment.kt INSTANCE_INITIALIZER_CALL classDescriptor='Host' FUN public final operator fun B.plusAssign(b: B): kotlin.Unit BLOCK_BODY - BLOCK type=kotlin.Unit operator=PLUSEQ + BLOCK type=kotlin.Unit origin=PLUSEQ VAR IR_TEMPORARY_VARIABLE val tmp0_this: B $RECEIVER of 'plusAssign(B) on B: Unit' type=B - CALL '(Int): Unit' type=kotlin.Unit operator=PLUSEQ - $this: GET_VAR 'tmp0_this: B' type=B operator=null - : CALL 'plus(Int): Int' type=kotlin.Int operator=PLUSEQ - $this: CALL '(): Int' type=kotlin.Int operator=PLUSEQ - $this: GET_VAR 'tmp0_this: B' type=B operator=null - other: CALL '(): Int' type=kotlin.Int operator=GET_PROPERTY - $this: GET_VAR 'value-parameter b: B' type=B operator=null + CALL '(Int): Unit' type=kotlin.Unit origin=PLUSEQ + $this: GET_VAR 'tmp0_this: B' type=B origin=null + : CALL 'plus(Int): Int' type=kotlin.Int origin=PLUSEQ + $this: CALL '(): Int' type=kotlin.Int origin=PLUSEQ + $this: GET_VAR 'tmp0_this: B' type=B origin=null + other: CALL '(): Int' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR 'value-parameter b: B' type=B origin=null FUN public fun Host.test3(v: B): kotlin.Unit BLOCK_BODY - CALL 'plusAssign(B) on B: Unit' type=kotlin.Unit operator=PLUSEQ + CALL 'plusAssign(B) on B: Unit' type=kotlin.Unit origin=PLUSEQ $this: $RECEIVER of 'test3(B) on Host: Unit' type=Host - $receiver: GET_VAR 'value-parameter v: B' type=B operator=PLUSEQ - b: CALL 'constructor B(Int = ...)' type=B operator=null + $receiver: GET_VAR 'value-parameter v: B' type=B origin=PLUSEQ + b: CALL 'constructor B(Int = ...)' type=B origin=null s: CONST Int type=kotlin.Int value='1000' diff --git a/compiler/testData/ir/irText/expressions/conventionComparisons.txt b/compiler/testData/ir/irText/expressions/conventionComparisons.txt index 0a9dfd6e043..78f5bb46930 100644 --- a/compiler/testData/ir/irText/expressions/conventionComparisons.txt +++ b/compiler/testData/ir/irText/expressions/conventionComparisons.txt @@ -5,32 +5,32 @@ FILE /conventionComparisons.kt FUN public fun IB.test1(a1: IA, a2: IA): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='test1(IA, IA) on IB: Boolean' - CALL 'GT0(Int): Boolean' type=kotlin.Boolean operator=GT - arg0: CALL 'compareTo(IA) on IA: Int' type=kotlin.Int operator=GT + CALL 'GT0(Int): Boolean' type=kotlin.Boolean origin=GT + arg0: CALL 'compareTo(IA) on IA: Int' type=kotlin.Int origin=GT $this: $RECEIVER of 'test1(IA, IA) on IB: Boolean' type=IB - $receiver: GET_VAR 'value-parameter a1: IA' type=IA operator=null - other: GET_VAR 'value-parameter a2: IA' type=IA operator=null + $receiver: GET_VAR 'value-parameter a1: IA' type=IA origin=null + other: GET_VAR 'value-parameter a2: IA' type=IA origin=null FUN public fun IB.test2(a1: IA, a2: IA): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='test2(IA, IA) on IB: Boolean' - CALL 'GTEQ0(Int): Boolean' type=kotlin.Boolean operator=GTEQ - arg0: CALL 'compareTo(IA) on IA: Int' type=kotlin.Int operator=GTEQ + CALL 'GTEQ0(Int): Boolean' type=kotlin.Boolean origin=GTEQ + arg0: CALL 'compareTo(IA) on IA: Int' type=kotlin.Int origin=GTEQ $this: $RECEIVER of 'test2(IA, IA) on IB: Boolean' type=IB - $receiver: GET_VAR 'value-parameter a1: IA' type=IA operator=null - other: GET_VAR 'value-parameter a2: IA' type=IA operator=null + $receiver: GET_VAR 'value-parameter a1: IA' type=IA origin=null + other: GET_VAR 'value-parameter a2: IA' type=IA origin=null FUN public fun IB.test3(a1: IA, a2: IA): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='test3(IA, IA) on IB: Boolean' - CALL 'LT0(Int): Boolean' type=kotlin.Boolean operator=LT - arg0: CALL 'compareTo(IA) on IA: Int' type=kotlin.Int operator=LT + CALL 'LT0(Int): Boolean' type=kotlin.Boolean origin=LT + arg0: CALL 'compareTo(IA) on IA: Int' type=kotlin.Int origin=LT $this: $RECEIVER of 'test3(IA, IA) on IB: Boolean' type=IB - $receiver: GET_VAR 'value-parameter a1: IA' type=IA operator=null - other: GET_VAR 'value-parameter a2: IA' type=IA operator=null + $receiver: GET_VAR 'value-parameter a1: IA' type=IA origin=null + other: GET_VAR 'value-parameter a2: IA' type=IA origin=null FUN public fun IB.test4(a1: IA, a2: IA): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='test4(IA, IA) on IB: Boolean' - CALL 'LTEQ0(Int): Boolean' type=kotlin.Boolean operator=LTEQ - arg0: CALL 'compareTo(IA) on IA: Int' type=kotlin.Int operator=LTEQ + CALL 'LTEQ0(Int): Boolean' type=kotlin.Boolean origin=LTEQ + arg0: CALL 'compareTo(IA) on IA: Int' type=kotlin.Int origin=LTEQ $this: $RECEIVER of 'test4(IA, IA) on IB: Boolean' type=IB - $receiver: GET_VAR 'value-parameter a1: IA' type=IA operator=null - other: GET_VAR 'value-parameter a2: IA' type=IA operator=null + $receiver: GET_VAR 'value-parameter a1: IA' type=IA origin=null + other: GET_VAR 'value-parameter a2: IA' type=IA origin=null diff --git a/compiler/testData/ir/irText/expressions/destructuring1.txt b/compiler/testData/ir/irText/expressions/destructuring1.txt index c6219675916..4413f2b4456 100644 --- a/compiler/testData/ir/irText/expressions/destructuring1.txt +++ b/compiler/testData/ir/irText/expressions/destructuring1.txt @@ -19,14 +19,14 @@ FILE /destructuring1.kt CONST Int type=kotlin.Int value='2' FUN public fun B.test(): kotlin.Unit BLOCK_BODY - COMPOSITE type=kotlin.Unit operator=DESTRUCTURING_DECLARATION + COMPOSITE type=kotlin.Unit origin=DESTRUCTURING_DECLARATION VAR IR_TEMPORARY_VARIABLE val tmp0_container: A GET_OBJECT 'A' type=A VAR val x: kotlin.Int - CALL 'component1() on A: Int' type=kotlin.Int operator=COMPONENT_N(index=1) + CALL 'component1() on A: Int' type=kotlin.Int origin=COMPONENT_N(index=1) $this: $RECEIVER of 'test() on B: Unit' type=B - $receiver: GET_VAR 'tmp0_container: A' type=A operator=null + $receiver: GET_VAR 'tmp0_container: A' type=A origin=null VAR val y: kotlin.Int - CALL 'component2() on A: Int' type=kotlin.Int operator=COMPONENT_N(index=2) + CALL 'component2() on A: Int' type=kotlin.Int origin=COMPONENT_N(index=2) $this: $RECEIVER of 'test() on B: Unit' type=B - $receiver: GET_VAR 'tmp0_container: A' type=A operator=null + $receiver: GET_VAR 'tmp0_container: A' type=A origin=null diff --git a/compiler/testData/ir/irText/expressions/dotQualified.txt b/compiler/testData/ir/irText/expressions/dotQualified.txt index 439102db77b..8739a5c4d09 100644 --- a/compiler/testData/ir/irText/expressions/dotQualified.txt +++ b/compiler/testData/ir/irText/expressions/dotQualified.txt @@ -2,18 +2,18 @@ FILE /dotQualified.kt FUN public fun length(s: kotlin.String): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='length(String): Int' - CALL '(): Int' type=kotlin.Int operator=GET_PROPERTY - $this: GET_VAR 'value-parameter s: String' type=kotlin.String operator=null + CALL '(): Int' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR 'value-parameter s: String' type=kotlin.String origin=null FUN public fun lengthN(s: kotlin.String?): kotlin.Int? BLOCK_BODY RETURN type=kotlin.Nothing from='lengthN(String?): Int?' - BLOCK type=kotlin.Int? operator=SAFE_CALL + BLOCK type=kotlin.Int? origin=SAFE_CALL VAR IR_TEMPORARY_VARIABLE val tmp0_safe_receiver: kotlin.String? - GET_VAR 'value-parameter s: String?' type=kotlin.String? operator=null - WHEN type=kotlin.Int? operator=SAFE_CALL - if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQ - arg0: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? operator=null + GET_VAR 'value-parameter s: String?' type=kotlin.String? origin=null + WHEN type=kotlin.Int? origin=SAFE_CALL + if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null arg1: CONST Null type=kotlin.Nothing? value='null' then: CONST Null type=kotlin.Nothing? value='null' - else: CALL '(): Int' type=kotlin.Int operator=GET_PROPERTY - $this: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? operator=null + else: CALL '(): Int' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null diff --git a/compiler/testData/ir/irText/expressions/elvis.txt b/compiler/testData/ir/irText/expressions/elvis.txt index 28ef4353c15..2975971b780 100644 --- a/compiler/testData/ir/irText/expressions/elvis.txt +++ b/compiler/testData/ir/irText/expressions/elvis.txt @@ -6,7 +6,7 @@ FILE /elvis.kt FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.Any? BLOCK_BODY RETURN type=kotlin.Nothing from='(): Any?' - GET_BACKING_FIELD 'p: Any?' type=kotlin.Any? operator=null + GET_BACKING_FIELD 'p: Any?' type=kotlin.Any? origin=null FUN public fun foo(): kotlin.Any? BLOCK_BODY RETURN type=kotlin.Nothing from='foo(): Any?' @@ -14,72 +14,72 @@ FILE /elvis.kt FUN public fun test1(a: kotlin.Any?, b: kotlin.Any): kotlin.Any BLOCK_BODY RETURN type=kotlin.Nothing from='test1(Any?, Any): Any' - BLOCK type=kotlin.Any operator=ELVIS + BLOCK type=kotlin.Any origin=ELVIS VAR IR_TEMPORARY_VARIABLE val tmp0_elvis_lhs: kotlin.Any? - GET_VAR 'value-parameter a: Any?' type=kotlin.Any? operator=null - WHEN type=kotlin.Any operator=null - if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQ - arg0: GET_VAR 'tmp0_elvis_lhs: Any?' type=kotlin.Any? operator=null + GET_VAR 'value-parameter a: Any?' type=kotlin.Any? origin=null + WHEN type=kotlin.Any origin=null + if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'tmp0_elvis_lhs: Any?' type=kotlin.Any? origin=null arg1: CONST Null type=kotlin.Nothing? value='null' - then: GET_VAR 'value-parameter b: Any' type=kotlin.Any operator=null - else: GET_VAR 'tmp0_elvis_lhs: Any?' type=kotlin.Any? operator=null + then: GET_VAR 'value-parameter b: Any' type=kotlin.Any origin=null + else: GET_VAR 'tmp0_elvis_lhs: Any?' type=kotlin.Any? origin=null FUN public fun test2(a: kotlin.String?, b: kotlin.Any): kotlin.Any BLOCK_BODY RETURN type=kotlin.Nothing from='test2(String?, Any): Any' - BLOCK type=kotlin.Any operator=ELVIS + BLOCK type=kotlin.Any origin=ELVIS VAR IR_TEMPORARY_VARIABLE val tmp0_elvis_lhs: kotlin.String? - GET_VAR 'value-parameter a: String?' type=kotlin.String? operator=null - WHEN type=kotlin.Any operator=null - if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQ - arg0: GET_VAR 'tmp0_elvis_lhs: String?' type=kotlin.String? operator=null + GET_VAR 'value-parameter a: String?' type=kotlin.String? origin=null + WHEN type=kotlin.Any origin=null + if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'tmp0_elvis_lhs: String?' type=kotlin.String? origin=null arg1: CONST Null type=kotlin.Nothing? value='null' - then: GET_VAR 'value-parameter b: Any' type=kotlin.Any operator=null - else: GET_VAR 'tmp0_elvis_lhs: String?' type=kotlin.String? operator=null + then: GET_VAR 'value-parameter b: Any' type=kotlin.Any origin=null + else: GET_VAR 'tmp0_elvis_lhs: String?' type=kotlin.String? origin=null FUN public fun test3(a: kotlin.Any?, b: kotlin.Any?): kotlin.String BLOCK_BODY - WHEN type=kotlin.Unit operator=IF - if: TYPE_OP operator=NOT_INSTANCEOF typeOperand=kotlin.String - GET_VAR 'value-parameter b: Any?' type=kotlin.Any? operator=null + WHEN type=kotlin.Unit origin=IF + if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=kotlin.String + GET_VAR 'value-parameter b: Any?' type=kotlin.Any? origin=null then: RETURN type=kotlin.Nothing from='test3(Any?, Any?): String' CONST String type=kotlin.String value='' - WHEN type=kotlin.Unit operator=IF - if: TYPE_OP operator=NOT_INSTANCEOF typeOperand=kotlin.String? - GET_VAR 'value-parameter a: Any?' type=kotlin.Any? operator=null + WHEN type=kotlin.Unit origin=IF + if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=kotlin.String? + GET_VAR 'value-parameter a: Any?' type=kotlin.Any? origin=null then: RETURN type=kotlin.Nothing from='test3(Any?, Any?): String' CONST String type=kotlin.String value='' RETURN type=kotlin.Nothing from='test3(Any?, Any?): String' - BLOCK type=kotlin.String operator=ELVIS + BLOCK type=kotlin.String origin=ELVIS VAR IR_TEMPORARY_VARIABLE val tmp0_elvis_lhs: kotlin.Any? - GET_VAR 'value-parameter a: Any?' type=kotlin.Any? operator=null - WHEN type=kotlin.String operator=null - if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQ - arg0: GET_VAR 'tmp0_elvis_lhs: Any?' type=kotlin.Any? operator=null + GET_VAR 'value-parameter a: Any?' type=kotlin.Any? origin=null + WHEN type=kotlin.String origin=null + if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'tmp0_elvis_lhs: Any?' type=kotlin.Any? origin=null arg1: CONST Null type=kotlin.Nothing? value='null' - then: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.String - GET_VAR 'value-parameter b: Any?' type=kotlin.Any? operator=null - else: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.String - GET_VAR 'tmp0_elvis_lhs: Any?' type=kotlin.Any? operator=null + then: TYPE_OP origin=IMPLICIT_CAST typeOperand=kotlin.String + GET_VAR 'value-parameter b: Any?' type=kotlin.Any? origin=null + else: TYPE_OP origin=IMPLICIT_CAST typeOperand=kotlin.String + GET_VAR 'tmp0_elvis_lhs: Any?' type=kotlin.Any? origin=null FUN public fun test4(x: kotlin.Any): kotlin.Any BLOCK_BODY RETURN type=kotlin.Nothing from='test4(Any): Any' - BLOCK type=kotlin.Any operator=ELVIS + BLOCK type=kotlin.Any origin=ELVIS VAR IR_TEMPORARY_VARIABLE val tmp0_elvis_lhs: kotlin.Any? - CALL '(): Any?' type=kotlin.Any? operator=GET_PROPERTY - WHEN type=kotlin.Any operator=null - if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQ - arg0: GET_VAR 'tmp0_elvis_lhs: Any?' type=kotlin.Any? operator=null + CALL '(): Any?' type=kotlin.Any? origin=GET_PROPERTY + WHEN type=kotlin.Any origin=null + if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'tmp0_elvis_lhs: Any?' type=kotlin.Any? origin=null arg1: CONST Null type=kotlin.Nothing? value='null' - then: GET_VAR 'value-parameter x: Any' type=kotlin.Any operator=null - else: GET_VAR 'tmp0_elvis_lhs: Any?' type=kotlin.Any? operator=null + then: GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null + else: GET_VAR 'tmp0_elvis_lhs: Any?' type=kotlin.Any? origin=null FUN public fun test5(x: kotlin.Any): kotlin.Any BLOCK_BODY RETURN type=kotlin.Nothing from='test5(Any): Any' - BLOCK type=kotlin.Any operator=ELVIS + BLOCK type=kotlin.Any origin=ELVIS VAR IR_TEMPORARY_VARIABLE val tmp0_elvis_lhs: kotlin.Any? - CALL 'foo(): Any?' type=kotlin.Any? operator=null - WHEN type=kotlin.Any operator=null - if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQ - arg0: GET_VAR 'tmp0_elvis_lhs: Any?' type=kotlin.Any? operator=null + CALL 'foo(): Any?' type=kotlin.Any? origin=null + WHEN type=kotlin.Any origin=null + if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'tmp0_elvis_lhs: Any?' type=kotlin.Any? origin=null arg1: CONST Null type=kotlin.Nothing? value='null' - then: GET_VAR 'value-parameter x: Any' type=kotlin.Any operator=null - else: GET_VAR 'tmp0_elvis_lhs: Any?' type=kotlin.Any? operator=null + then: GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null + else: GET_VAR 'tmp0_elvis_lhs: Any?' type=kotlin.Any? origin=null diff --git a/compiler/testData/ir/irText/expressions/equality.txt b/compiler/testData/ir/irText/expressions/equality.txt index a003d19dbf2..2f9859f049a 100644 --- a/compiler/testData/ir/irText/expressions/equality.txt +++ b/compiler/testData/ir/irText/expressions/equality.txt @@ -2,19 +2,19 @@ FILE /equality.kt FUN public fun test1(a: kotlin.Int, b: kotlin.Int): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='test1(Int, Int): Boolean' - CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQ - arg0: GET_VAR 'value-parameter a: Int' type=kotlin.Int operator=null - arg1: GET_VAR 'value-parameter b: Int' type=kotlin.Int operator=null + CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'value-parameter a: Int' type=kotlin.Int origin=null + arg1: GET_VAR 'value-parameter b: Int' type=kotlin.Int origin=null FUN public fun test2(a: kotlin.Int, b: kotlin.Int): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='test2(Int, Int): Boolean' - CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean operator=EXCLEQ - arg0: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EXCLEQ - arg0: GET_VAR 'value-parameter a: Int' type=kotlin.Int operator=null - arg1: GET_VAR 'value-parameter b: Int' type=kotlin.Int operator=null + CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EXCLEQ + arg0: GET_VAR 'value-parameter a: Int' type=kotlin.Int origin=null + arg1: GET_VAR 'value-parameter b: Int' type=kotlin.Int origin=null FUN public fun test3(a: kotlin.Any?, b: kotlin.Any?): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='test3(Any?, Any?): Boolean' - CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQ - arg0: GET_VAR 'value-parameter a: Any?' type=kotlin.Any? operator=null - arg1: GET_VAR 'value-parameter b: Any?' type=kotlin.Any? operator=null + CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'value-parameter a: Any?' type=kotlin.Any? origin=null + arg1: GET_VAR 'value-parameter b: Any?' type=kotlin.Any? origin=null diff --git a/compiler/testData/ir/irText/expressions/extensionPropertyGetterCall.txt b/compiler/testData/ir/irText/expressions/extensionPropertyGetterCall.txt index a06fd44a153..343326169c6 100644 --- a/compiler/testData/ir/irText/expressions/extensionPropertyGetterCall.txt +++ b/compiler/testData/ir/irText/expressions/extensionPropertyGetterCall.txt @@ -7,5 +7,5 @@ FILE /extensionPropertyGetterCall.kt FUN public fun kotlin.String.test5(): kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='test5() on String: String' - CALL '() on String: String' type=kotlin.String operator=GET_PROPERTY + CALL '() on String: String' type=kotlin.String origin=GET_PROPERTY $receiver: $RECEIVER of 'test5() on String: String' type=kotlin.String diff --git a/compiler/testData/ir/irText/expressions/field.txt b/compiler/testData/ir/irText/expressions/field.txt index b9fb8fc3382..77f561a1683 100644 --- a/compiler/testData/ir/irText/expressions/field.txt +++ b/compiler/testData/ir/irText/expressions/field.txt @@ -6,11 +6,11 @@ FILE /field.kt FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'testSimple: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'testSimple: Int' type=kotlin.Int origin=null FUN public fun (value: kotlin.Int): kotlin.Unit BLOCK_BODY - SET_BACKING_FIELD 'testSimple: Int' type=kotlin.Unit operator=EQ - value: GET_VAR 'value-parameter value: Int' type=kotlin.Int operator=null + SET_BACKING_FIELD 'testSimple: Int' type=kotlin.Unit origin=EQ + value: GET_VAR 'value-parameter value: Int' type=kotlin.Int origin=null PROPERTY public var testAugmented: kotlin.Int FIELD PROPERTY_BACKING_FIELD public var testAugmented: kotlin.Int EXPRESSION_BODY @@ -18,10 +18,10 @@ FILE /field.kt FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'testAugmented: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'testAugmented: Int' type=kotlin.Int origin=null FUN public fun (value: kotlin.Int): kotlin.Unit BLOCK_BODY - SET_BACKING_FIELD 'testAugmented: Int' type=kotlin.Unit operator=PLUSEQ - value: CALL 'plus(Int): Int' type=kotlin.Int operator=PLUSEQ - $this: GET_BACKING_FIELD 'testAugmented: Int' type=kotlin.Int operator=PLUSEQ - other: GET_VAR 'value-parameter value: Int' type=kotlin.Int operator=null + SET_BACKING_FIELD 'testAugmented: Int' type=kotlin.Unit origin=PLUSEQ + value: CALL 'plus(Int): Int' type=kotlin.Int origin=PLUSEQ + $this: GET_BACKING_FIELD 'testAugmented: Int' type=kotlin.Int origin=PLUSEQ + other: GET_VAR 'value-parameter value: Int' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/for.txt b/compiler/testData/ir/irText/expressions/for.txt index 60eb175fd8f..335bc57312a 100644 --- a/compiler/testData/ir/irText/expressions/for.txt +++ b/compiler/testData/ir/irText/expressions/for.txt @@ -1,54 +1,54 @@ FILE /for.kt FUN public fun testEmpty(ss: kotlin.collections.List): kotlin.Unit BLOCK_BODY - BLOCK type=kotlin.Unit operator=FOR_LOOP + BLOCK type=kotlin.Unit origin=FOR_LOOP VAR IR_TEMPORARY_VARIABLE val tmp0_iterator: kotlin.collections.Iterator - CALL 'iterator(): Iterator' type=kotlin.collections.Iterator operator=FOR_LOOP_ITERATOR - $this: GET_VAR 'value-parameter ss: List' type=kotlin.collections.List operator=null - WHILE label=null operator=FOR_LOOP_INNER_WHILE - condition: CALL 'hasNext(): Boolean' type=kotlin.Boolean operator=FOR_LOOP_HAS_NEXT - $this: GET_VAR 'tmp0_iterator: Iterator' type=kotlin.collections.Iterator operator=null - body: BLOCK type=kotlin.Unit operator=FOR_LOOP_INNER_WHILE + CALL 'iterator(): Iterator' type=kotlin.collections.Iterator origin=FOR_LOOP_ITERATOR + $this: GET_VAR 'value-parameter ss: List' type=kotlin.collections.List origin=null + WHILE label=null origin=FOR_LOOP_INNER_WHILE + condition: CALL 'hasNext(): Boolean' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + $this: GET_VAR 'tmp0_iterator: Iterator' type=kotlin.collections.Iterator origin=null + body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE VAR val s: kotlin.String - CALL 'next(): String' type=kotlin.String operator=FOR_LOOP_NEXT - $this: GET_VAR 'tmp0_iterator: Iterator' type=kotlin.collections.Iterator operator=null + CALL 'next(): String' type=kotlin.String origin=FOR_LOOP_NEXT + $this: GET_VAR 'tmp0_iterator: Iterator' type=kotlin.collections.Iterator origin=null FUN public fun testIterable(ss: kotlin.collections.List): kotlin.Unit BLOCK_BODY - BLOCK type=kotlin.Unit operator=FOR_LOOP + BLOCK type=kotlin.Unit origin=FOR_LOOP VAR IR_TEMPORARY_VARIABLE val tmp0_iterator: kotlin.collections.Iterator - CALL 'iterator(): Iterator' type=kotlin.collections.Iterator operator=FOR_LOOP_ITERATOR - $this: GET_VAR 'value-parameter ss: List' type=kotlin.collections.List operator=null - WHILE label=null operator=FOR_LOOP_INNER_WHILE - condition: CALL 'hasNext(): Boolean' type=kotlin.Boolean operator=FOR_LOOP_HAS_NEXT - $this: GET_VAR 'tmp0_iterator: Iterator' type=kotlin.collections.Iterator operator=null - body: BLOCK type=kotlin.Unit operator=FOR_LOOP_INNER_WHILE + CALL 'iterator(): Iterator' type=kotlin.collections.Iterator origin=FOR_LOOP_ITERATOR + $this: GET_VAR 'value-parameter ss: List' type=kotlin.collections.List origin=null + WHILE label=null origin=FOR_LOOP_INNER_WHILE + condition: CALL 'hasNext(): Boolean' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + $this: GET_VAR 'tmp0_iterator: Iterator' type=kotlin.collections.Iterator origin=null + body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE VAR val s: kotlin.String - CALL 'next(): String' type=kotlin.String operator=FOR_LOOP_NEXT - $this: GET_VAR 'tmp0_iterator: Iterator' type=kotlin.collections.Iterator operator=null - BLOCK type=kotlin.Unit operator=null - CALL 'println(Any?): Unit' type=kotlin.Unit operator=null - message: GET_VAR 's: String' type=kotlin.String operator=null + CALL 'next(): String' type=kotlin.String origin=FOR_LOOP_NEXT + $this: GET_VAR 'tmp0_iterator: Iterator' type=kotlin.collections.Iterator origin=null + BLOCK type=kotlin.Unit origin=null + CALL 'println(Any?): Unit' type=kotlin.Unit origin=null + message: GET_VAR 's: String' type=kotlin.String origin=null FUN public fun testDestructuring(pp: kotlin.collections.List>): kotlin.Unit BLOCK_BODY - BLOCK type=kotlin.Unit operator=FOR_LOOP + BLOCK type=kotlin.Unit origin=FOR_LOOP VAR IR_TEMPORARY_VARIABLE val tmp0_iterator: kotlin.collections.Iterator> - CALL 'iterator(): Iterator>' type=kotlin.collections.Iterator> operator=FOR_LOOP_ITERATOR - $this: GET_VAR 'value-parameter pp: List>' type=kotlin.collections.List> operator=null - WHILE label=null operator=FOR_LOOP_INNER_WHILE - condition: CALL 'hasNext(): Boolean' type=kotlin.Boolean operator=FOR_LOOP_HAS_NEXT - $this: GET_VAR 'tmp0_iterator: Iterator>' type=kotlin.collections.Iterator> operator=null - body: BLOCK type=kotlin.Unit operator=FOR_LOOP_INNER_WHILE + CALL 'iterator(): Iterator>' type=kotlin.collections.Iterator> origin=FOR_LOOP_ITERATOR + $this: GET_VAR 'value-parameter pp: List>' type=kotlin.collections.List> origin=null + WHILE label=null origin=FOR_LOOP_INNER_WHILE + condition: CALL 'hasNext(): Boolean' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + $this: GET_VAR 'tmp0_iterator: Iterator>' type=kotlin.collections.Iterator> origin=null + body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE VAR IR_TEMPORARY_VARIABLE val tmp1_loop_parameter: kotlin.Pair - CALL 'next(): Pair' type=kotlin.Pair operator=FOR_LOOP_NEXT - $this: GET_VAR 'tmp0_iterator: Iterator>' type=kotlin.collections.Iterator> operator=null + CALL 'next(): Pair' type=kotlin.Pair origin=FOR_LOOP_NEXT + $this: GET_VAR 'tmp0_iterator: Iterator>' type=kotlin.collections.Iterator> origin=null VAR val i: kotlin.Int - CALL 'component1(): Int' type=kotlin.Int operator=COMPONENT_N(index=1) - $this: GET_VAR 'tmp1_loop_parameter: Pair' type=kotlin.Pair operator=null + CALL 'component1(): Int' type=kotlin.Int origin=COMPONENT_N(index=1) + $this: GET_VAR 'tmp1_loop_parameter: Pair' type=kotlin.Pair origin=null VAR val s: kotlin.String - CALL 'component2(): String' type=kotlin.String operator=COMPONENT_N(index=2) - $this: GET_VAR 'tmp1_loop_parameter: Pair' type=kotlin.Pair operator=null - BLOCK type=kotlin.Unit operator=null - CALL 'println(Int): Unit' type=kotlin.Unit operator=null - message: GET_VAR 'i: Int' type=kotlin.Int operator=null - CALL 'println(Any?): Unit' type=kotlin.Unit operator=null - message: GET_VAR 's: String' type=kotlin.String operator=null + CALL 'component2(): String' type=kotlin.String origin=COMPONENT_N(index=2) + $this: GET_VAR 'tmp1_loop_parameter: Pair' type=kotlin.Pair origin=null + BLOCK type=kotlin.Unit origin=null + CALL 'println(Int): Unit' type=kotlin.Unit origin=null + message: GET_VAR 'i: Int' type=kotlin.Int origin=null + CALL 'println(Any?): Unit' type=kotlin.Unit origin=null + message: GET_VAR 's: String' type=kotlin.String origin=null diff --git a/compiler/testData/ir/irText/expressions/forWithBreakContinue.txt b/compiler/testData/ir/irText/expressions/forWithBreakContinue.txt index c3c9d3574c5..22ef064dfc5 100644 --- a/compiler/testData/ir/irText/expressions/forWithBreakContinue.txt +++ b/compiler/testData/ir/irText/expressions/forWithBreakContinue.txt @@ -1,90 +1,90 @@ FILE /forWithBreakContinue.kt FUN public fun testForBreak1(ss: kotlin.collections.List): kotlin.Unit BLOCK_BODY - BLOCK type=kotlin.Unit operator=FOR_LOOP + BLOCK type=kotlin.Unit origin=FOR_LOOP VAR IR_TEMPORARY_VARIABLE val tmp0_iterator: kotlin.collections.Iterator - CALL 'iterator(): Iterator' type=kotlin.collections.Iterator operator=FOR_LOOP_ITERATOR - $this: GET_VAR 'value-parameter ss: List' type=kotlin.collections.List operator=null - WHILE label=null operator=FOR_LOOP_INNER_WHILE - condition: CALL 'hasNext(): Boolean' type=kotlin.Boolean operator=FOR_LOOP_HAS_NEXT - $this: GET_VAR 'tmp0_iterator: Iterator' type=kotlin.collections.Iterator operator=null - body: BLOCK type=kotlin.Unit operator=FOR_LOOP_INNER_WHILE + CALL 'iterator(): Iterator' type=kotlin.collections.Iterator origin=FOR_LOOP_ITERATOR + $this: GET_VAR 'value-parameter ss: List' type=kotlin.collections.List origin=null + WHILE label=null origin=FOR_LOOP_INNER_WHILE + condition: CALL 'hasNext(): Boolean' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + $this: GET_VAR 'tmp0_iterator: Iterator' type=kotlin.collections.Iterator origin=null + body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE VAR val s: kotlin.String - CALL 'next(): String' type=kotlin.String operator=FOR_LOOP_NEXT - $this: GET_VAR 'tmp0_iterator: Iterator' type=kotlin.collections.Iterator operator=null - BLOCK type=kotlin.Nothing operator=null + CALL 'next(): String' type=kotlin.String origin=FOR_LOOP_NEXT + $this: GET_VAR 'tmp0_iterator: Iterator' type=kotlin.collections.Iterator origin=null + BLOCK type=kotlin.Nothing origin=null BREAK label=null loop.label=null depth=0 FUN public fun testForBreak2(ss: kotlin.collections.List): kotlin.Unit BLOCK_BODY - BLOCK type=kotlin.Unit operator=FOR_LOOP + BLOCK type=kotlin.Unit origin=FOR_LOOP VAR IR_TEMPORARY_VARIABLE val tmp0_iterator: kotlin.collections.Iterator - CALL 'iterator(): Iterator' type=kotlin.collections.Iterator operator=FOR_LOOP_ITERATOR - $this: GET_VAR 'value-parameter ss: List' type=kotlin.collections.List operator=null - WHILE label=OUTER operator=FOR_LOOP_INNER_WHILE - condition: CALL 'hasNext(): Boolean' type=kotlin.Boolean operator=FOR_LOOP_HAS_NEXT - $this: GET_VAR 'tmp0_iterator: Iterator' type=kotlin.collections.Iterator operator=null - body: BLOCK type=kotlin.Unit operator=FOR_LOOP_INNER_WHILE + CALL 'iterator(): Iterator' type=kotlin.collections.Iterator origin=FOR_LOOP_ITERATOR + $this: GET_VAR 'value-parameter ss: List' type=kotlin.collections.List origin=null + WHILE label=OUTER origin=FOR_LOOP_INNER_WHILE + condition: CALL 'hasNext(): Boolean' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + $this: GET_VAR 'tmp0_iterator: Iterator' type=kotlin.collections.Iterator origin=null + body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE VAR val s1: kotlin.String - CALL 'next(): String' type=kotlin.String operator=FOR_LOOP_NEXT - $this: GET_VAR 'tmp0_iterator: Iterator' type=kotlin.collections.Iterator operator=null - BLOCK type=kotlin.Nothing operator=null - BLOCK type=kotlin.Unit operator=FOR_LOOP + CALL 'next(): String' type=kotlin.String origin=FOR_LOOP_NEXT + $this: GET_VAR 'tmp0_iterator: Iterator' type=kotlin.collections.Iterator origin=null + BLOCK type=kotlin.Nothing origin=null + BLOCK type=kotlin.Unit origin=FOR_LOOP VAR IR_TEMPORARY_VARIABLE val tmp1_iterator: kotlin.collections.Iterator - CALL 'iterator(): Iterator' type=kotlin.collections.Iterator operator=FOR_LOOP_ITERATOR - $this: GET_VAR 'value-parameter ss: List' type=kotlin.collections.List operator=null - WHILE label=INNER operator=FOR_LOOP_INNER_WHILE - condition: CALL 'hasNext(): Boolean' type=kotlin.Boolean operator=FOR_LOOP_HAS_NEXT - $this: GET_VAR 'tmp1_iterator: Iterator' type=kotlin.collections.Iterator operator=null - body: BLOCK type=kotlin.Unit operator=FOR_LOOP_INNER_WHILE + CALL 'iterator(): Iterator' type=kotlin.collections.Iterator origin=FOR_LOOP_ITERATOR + $this: GET_VAR 'value-parameter ss: List' type=kotlin.collections.List origin=null + WHILE label=INNER origin=FOR_LOOP_INNER_WHILE + condition: CALL 'hasNext(): Boolean' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + $this: GET_VAR 'tmp1_iterator: Iterator' type=kotlin.collections.Iterator origin=null + body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE VAR val s2: kotlin.String - CALL 'next(): String' type=kotlin.String operator=FOR_LOOP_NEXT - $this: GET_VAR 'tmp1_iterator: Iterator' type=kotlin.collections.Iterator operator=null - BLOCK type=kotlin.Nothing operator=null + CALL 'next(): String' type=kotlin.String origin=FOR_LOOP_NEXT + $this: GET_VAR 'tmp1_iterator: Iterator' type=kotlin.collections.Iterator origin=null + BLOCK type=kotlin.Nothing origin=null BREAK label=OUTER loop.label=OUTER depth=1 BREAK label=INNER loop.label=INNER depth=0 BREAK label=null loop.label=INNER depth=0 BREAK label=OUTER loop.label=OUTER depth=0 FUN public fun testForContinue1(ss: kotlin.collections.List): kotlin.Unit BLOCK_BODY - BLOCK type=kotlin.Unit operator=FOR_LOOP + BLOCK type=kotlin.Unit origin=FOR_LOOP VAR IR_TEMPORARY_VARIABLE val tmp0_iterator: kotlin.collections.Iterator - CALL 'iterator(): Iterator' type=kotlin.collections.Iterator operator=FOR_LOOP_ITERATOR - $this: GET_VAR 'value-parameter ss: List' type=kotlin.collections.List operator=null - WHILE label=null operator=FOR_LOOP_INNER_WHILE - condition: CALL 'hasNext(): Boolean' type=kotlin.Boolean operator=FOR_LOOP_HAS_NEXT - $this: GET_VAR 'tmp0_iterator: Iterator' type=kotlin.collections.Iterator operator=null - body: BLOCK type=kotlin.Unit operator=FOR_LOOP_INNER_WHILE + CALL 'iterator(): Iterator' type=kotlin.collections.Iterator origin=FOR_LOOP_ITERATOR + $this: GET_VAR 'value-parameter ss: List' type=kotlin.collections.List origin=null + WHILE label=null origin=FOR_LOOP_INNER_WHILE + condition: CALL 'hasNext(): Boolean' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + $this: GET_VAR 'tmp0_iterator: Iterator' type=kotlin.collections.Iterator origin=null + body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE VAR val s: kotlin.String - CALL 'next(): String' type=kotlin.String operator=FOR_LOOP_NEXT - $this: GET_VAR 'tmp0_iterator: Iterator' type=kotlin.collections.Iterator operator=null - BLOCK type=kotlin.Nothing operator=null + CALL 'next(): String' type=kotlin.String origin=FOR_LOOP_NEXT + $this: GET_VAR 'tmp0_iterator: Iterator' type=kotlin.collections.Iterator origin=null + BLOCK type=kotlin.Nothing origin=null CONTINUE label=null loop.label=null depth=0 FUN public fun testForContinue2(ss: kotlin.collections.List): kotlin.Unit BLOCK_BODY - BLOCK type=kotlin.Unit operator=FOR_LOOP + BLOCK type=kotlin.Unit origin=FOR_LOOP VAR IR_TEMPORARY_VARIABLE val tmp0_iterator: kotlin.collections.Iterator - CALL 'iterator(): Iterator' type=kotlin.collections.Iterator operator=FOR_LOOP_ITERATOR - $this: GET_VAR 'value-parameter ss: List' type=kotlin.collections.List operator=null - WHILE label=OUTER operator=FOR_LOOP_INNER_WHILE - condition: CALL 'hasNext(): Boolean' type=kotlin.Boolean operator=FOR_LOOP_HAS_NEXT - $this: GET_VAR 'tmp0_iterator: Iterator' type=kotlin.collections.Iterator operator=null - body: BLOCK type=kotlin.Unit operator=FOR_LOOP_INNER_WHILE + CALL 'iterator(): Iterator' type=kotlin.collections.Iterator origin=FOR_LOOP_ITERATOR + $this: GET_VAR 'value-parameter ss: List' type=kotlin.collections.List origin=null + WHILE label=OUTER origin=FOR_LOOP_INNER_WHILE + condition: CALL 'hasNext(): Boolean' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + $this: GET_VAR 'tmp0_iterator: Iterator' type=kotlin.collections.Iterator origin=null + body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE VAR val s1: kotlin.String - CALL 'next(): String' type=kotlin.String operator=FOR_LOOP_NEXT - $this: GET_VAR 'tmp0_iterator: Iterator' type=kotlin.collections.Iterator operator=null - BLOCK type=kotlin.Nothing operator=null - BLOCK type=kotlin.Unit operator=FOR_LOOP + CALL 'next(): String' type=kotlin.String origin=FOR_LOOP_NEXT + $this: GET_VAR 'tmp0_iterator: Iterator' type=kotlin.collections.Iterator origin=null + BLOCK type=kotlin.Nothing origin=null + BLOCK type=kotlin.Unit origin=FOR_LOOP VAR IR_TEMPORARY_VARIABLE val tmp1_iterator: kotlin.collections.Iterator - CALL 'iterator(): Iterator' type=kotlin.collections.Iterator operator=FOR_LOOP_ITERATOR - $this: GET_VAR 'value-parameter ss: List' type=kotlin.collections.List operator=null - WHILE label=INNER operator=FOR_LOOP_INNER_WHILE - condition: CALL 'hasNext(): Boolean' type=kotlin.Boolean operator=FOR_LOOP_HAS_NEXT - $this: GET_VAR 'tmp1_iterator: Iterator' type=kotlin.collections.Iterator operator=null - body: BLOCK type=kotlin.Unit operator=FOR_LOOP_INNER_WHILE + CALL 'iterator(): Iterator' type=kotlin.collections.Iterator origin=FOR_LOOP_ITERATOR + $this: GET_VAR 'value-parameter ss: List' type=kotlin.collections.List origin=null + WHILE label=INNER origin=FOR_LOOP_INNER_WHILE + condition: CALL 'hasNext(): Boolean' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + $this: GET_VAR 'tmp1_iterator: Iterator' type=kotlin.collections.Iterator origin=null + body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE VAR val s2: kotlin.String - CALL 'next(): String' type=kotlin.String operator=FOR_LOOP_NEXT - $this: GET_VAR 'tmp1_iterator: Iterator' type=kotlin.collections.Iterator operator=null - BLOCK type=kotlin.Nothing operator=null + CALL 'next(): String' type=kotlin.String origin=FOR_LOOP_NEXT + $this: GET_VAR 'tmp1_iterator: Iterator' type=kotlin.collections.Iterator origin=null + BLOCK type=kotlin.Nothing origin=null CONTINUE label=OUTER loop.label=OUTER depth=1 CONTINUE label=INNER loop.label=INNER depth=0 CONTINUE label=null loop.label=INNER depth=0 diff --git a/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.txt b/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.txt index 87185883471..23a8a9a5bb6 100644 --- a/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.txt +++ b/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.txt @@ -12,62 +12,62 @@ FILE /forWithImplicitReceivers.kt PROPERTY public final var value: kotlin.Int FIELD PROPERTY_BACKING_FIELD public final var value: kotlin.Int EXPRESSION_BODY - GET_VAR 'value-parameter value: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER + GET_VAR 'value-parameter value: Int' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'value: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'value: Int' type=kotlin.Int origin=null receiver: THIS of 'IntCell' type=IntCell FUN DEFAULT_PROPERTY_ACCESSOR public final fun (: kotlin.Int): kotlin.Unit BLOCK_BODY - SET_BACKING_FIELD 'value: Int' type=kotlin.Unit operator=null + SET_BACKING_FIELD 'value: Int' type=kotlin.Unit origin=null receiver: THIS of 'IntCell' type=IntCell - value: GET_VAR 'value-parameter : Int' type=kotlin.Int operator=null + value: GET_VAR 'value-parameter : Int' type=kotlin.Int origin=null CLASS INTERFACE IReceiver FUN public open operator fun FiveTimes.iterator(): IntCell BLOCK_BODY RETURN type=kotlin.Nothing from='iterator() on FiveTimes: IntCell' - CALL 'constructor IntCell(Int)' type=IntCell operator=null + CALL 'constructor IntCell(Int)' type=IntCell origin=null value: CONST Int type=kotlin.Int value='5' FUN public open operator fun IntCell.hasNext(): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='hasNext() on IntCell: Boolean' - CALL 'GT0(Int): Boolean' type=kotlin.Boolean operator=GT - arg0: CALL 'compareTo(Int): Int' type=kotlin.Int operator=GT - $this: CALL '(): Int' type=kotlin.Int operator=GET_PROPERTY + CALL 'GT0(Int): Boolean' type=kotlin.Boolean origin=GT + arg0: CALL 'compareTo(Int): Int' type=kotlin.Int origin=GT + $this: CALL '(): Int' type=kotlin.Int origin=GET_PROPERTY $this: $RECEIVER of 'hasNext() on IntCell: Boolean' type=IntCell other: CONST Int type=kotlin.Int value='0' FUN public open operator fun IntCell.next(): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='next() on IntCell: Int' - BLOCK type=kotlin.Int operator=POSTFIX_DECR + BLOCK type=kotlin.Int origin=POSTFIX_DECR VAR IR_TEMPORARY_VARIABLE val tmp0_this: IntCell $RECEIVER of 'next() on IntCell: Int' type=IntCell - BLOCK type=kotlin.Int operator=POSTFIX_DECR + BLOCK type=kotlin.Int origin=POSTFIX_DECR VAR IR_TEMPORARY_VARIABLE val tmp1: kotlin.Int - CALL '(): Int' type=kotlin.Int operator=POSTFIX_DECR - $this: GET_VAR 'tmp0_this: IntCell' type=IntCell operator=null - CALL '(Int): Unit' type=kotlin.Unit operator=POSTFIX_DECR - $this: GET_VAR 'tmp0_this: IntCell' type=IntCell operator=null - : CALL 'dec(): Int' type=kotlin.Int operator=POSTFIX_DECR - $this: GET_VAR 'tmp1: Int' type=kotlin.Int operator=null - GET_VAR 'tmp1: Int' type=kotlin.Int operator=null + CALL '(): Int' type=kotlin.Int origin=POSTFIX_DECR + $this: GET_VAR 'tmp0_this: IntCell' type=IntCell origin=null + CALL '(Int): Unit' type=kotlin.Unit origin=POSTFIX_DECR + $this: GET_VAR 'tmp0_this: IntCell' type=IntCell origin=null + : CALL 'dec(): Int' type=kotlin.Int origin=POSTFIX_DECR + $this: GET_VAR 'tmp1: Int' type=kotlin.Int origin=null + GET_VAR 'tmp1: Int' type=kotlin.Int origin=null FUN public fun IReceiver.test(): kotlin.Unit BLOCK_BODY - BLOCK type=kotlin.Unit operator=FOR_LOOP + BLOCK type=kotlin.Unit origin=FOR_LOOP VAR IR_TEMPORARY_VARIABLE val tmp0_iterator: IntCell - CALL 'iterator() on FiveTimes: IntCell' type=IntCell operator=FOR_LOOP_ITERATOR + CALL 'iterator() on FiveTimes: IntCell' type=IntCell origin=FOR_LOOP_ITERATOR $this: $RECEIVER of 'test() on IReceiver: Unit' type=IReceiver $receiver: GET_OBJECT 'FiveTimes' type=FiveTimes - WHILE label=null operator=FOR_LOOP_INNER_WHILE - condition: CALL 'hasNext() on IntCell: Boolean' type=kotlin.Boolean operator=FOR_LOOP_HAS_NEXT + WHILE label=null origin=FOR_LOOP_INNER_WHILE + condition: CALL 'hasNext() on IntCell: Boolean' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT $this: $RECEIVER of 'test() on IReceiver: Unit' type=IReceiver - $receiver: GET_VAR 'tmp0_iterator: IntCell' type=IntCell operator=null - body: BLOCK type=kotlin.Unit operator=FOR_LOOP_INNER_WHILE + $receiver: GET_VAR 'tmp0_iterator: IntCell' type=IntCell origin=null + body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE VAR val i: kotlin.Int - CALL 'next() on IntCell: Int' type=kotlin.Int operator=FOR_LOOP_NEXT + CALL 'next() on IntCell: Int' type=kotlin.Int origin=FOR_LOOP_NEXT $this: $RECEIVER of 'test() on IReceiver: Unit' type=IReceiver - $receiver: GET_VAR 'tmp0_iterator: IntCell' type=IntCell operator=null - BLOCK type=kotlin.Unit operator=null - CALL 'println(Int): Unit' type=kotlin.Unit operator=null - message: GET_VAR 'i: Int' type=kotlin.Int operator=null + $receiver: GET_VAR 'tmp0_iterator: IntCell' type=IntCell origin=null + BLOCK type=kotlin.Unit origin=null + CALL 'println(Int): Unit' type=kotlin.Unit origin=null + message: GET_VAR 'i: Int' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/identity.txt b/compiler/testData/ir/irText/expressions/identity.txt index 01caf55a0f4..cd691db4138 100644 --- a/compiler/testData/ir/irText/expressions/identity.txt +++ b/compiler/testData/ir/irText/expressions/identity.txt @@ -2,19 +2,19 @@ FILE /identity.kt FUN public fun test1(a: kotlin.Int, b: kotlin.Int): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='test1(Int, Int): Boolean' - CALL 'EQEQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQEQ - arg0: GET_VAR 'value-parameter a: Int' type=kotlin.Int operator=null - arg1: GET_VAR 'value-parameter b: Int' type=kotlin.Int operator=null + CALL 'EQEQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQEQ + arg0: GET_VAR 'value-parameter a: Int' type=kotlin.Int origin=null + arg1: GET_VAR 'value-parameter b: Int' type=kotlin.Int origin=null FUN public fun test2(a: kotlin.Int, b: kotlin.Int): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='test2(Int, Int): Boolean' - CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean operator=EXCLEQEQ - arg0: CALL 'EQEQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EXCLEQEQ - arg0: GET_VAR 'value-parameter a: Int' type=kotlin.Int operator=null - arg1: GET_VAR 'value-parameter b: Int' type=kotlin.Int operator=null + CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQEQ + arg0: CALL 'EQEQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EXCLEQEQ + arg0: GET_VAR 'value-parameter a: Int' type=kotlin.Int origin=null + arg1: GET_VAR 'value-parameter b: Int' type=kotlin.Int origin=null FUN public fun test3(a: kotlin.Any?, b: kotlin.Any?): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='test3(Any?, Any?): Boolean' - CALL 'EQEQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQEQ - arg0: GET_VAR 'value-parameter a: Any?' type=kotlin.Any? operator=null - arg1: GET_VAR 'value-parameter b: Any?' type=kotlin.Any? operator=null + CALL 'EQEQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQEQ + arg0: GET_VAR 'value-parameter a: Any?' type=kotlin.Any? origin=null + arg1: GET_VAR 'value-parameter b: Any?' type=kotlin.Any? origin=null diff --git a/compiler/testData/ir/irText/expressions/ifElseIf.txt b/compiler/testData/ir/irText/expressions/ifElseIf.txt index a0f40e407c5..7016791e576 100644 --- a/compiler/testData/ir/irText/expressions/ifElseIf.txt +++ b/compiler/testData/ir/irText/expressions/ifElseIf.txt @@ -2,15 +2,15 @@ FILE /ifElseIf.kt FUN public fun test(i: kotlin.Int): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='test(Int): Int' - WHEN type=kotlin.Int operator=WHEN - if: CALL 'GT0(Int): Boolean' type=kotlin.Boolean operator=GT - arg0: CALL 'compareTo(Int): Int' type=kotlin.Int operator=GT - $this: GET_VAR 'value-parameter i: Int' type=kotlin.Int operator=null + WHEN type=kotlin.Int origin=WHEN + if: CALL 'GT0(Int): Boolean' type=kotlin.Boolean origin=GT + arg0: CALL 'compareTo(Int): Int' type=kotlin.Int origin=GT + $this: GET_VAR 'value-parameter i: Int' type=kotlin.Int origin=null other: CONST Int type=kotlin.Int value='0' then: CONST Int type=kotlin.Int value='1' - if: CALL 'LT0(Int): Boolean' type=kotlin.Boolean operator=LT - arg0: CALL 'compareTo(Int): Int' type=kotlin.Int operator=LT - $this: GET_VAR 'value-parameter i: Int' type=kotlin.Int operator=null + if: CALL 'LT0(Int): Boolean' type=kotlin.Boolean origin=LT + arg0: CALL 'compareTo(Int): Int' type=kotlin.Int origin=LT + $this: GET_VAR 'value-parameter i: Int' type=kotlin.Int origin=null other: CONST Int type=kotlin.Int value='0' then: CONST Int type=kotlin.Int value='-1' else: CONST Int type=kotlin.Int value='0' diff --git a/compiler/testData/ir/irText/expressions/implicitCastOnPlatformType.txt b/compiler/testData/ir/irText/expressions/implicitCastOnPlatformType.txt index 2fb6bc757d7..e9255759ec4 100644 --- a/compiler/testData/ir/irText/expressions/implicitCastOnPlatformType.txt +++ b/compiler/testData/ir/irText/expressions/implicitCastOnPlatformType.txt @@ -2,6 +2,6 @@ FILE /implicitCastOnPlatformType.kt FUN public fun test(): kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='test(): String' - TYPE_OP operator=IMPLICIT_NOTNULL typeOperand=kotlin.String - CALL 'getProperty(String!): String!' type=kotlin.String! operator=null + TYPE_OP origin=IMPLICIT_NOTNULL typeOperand=kotlin.String + CALL 'getProperty(String!): String!' type=kotlin.String! origin=null p0: CONST String type=kotlin.String value='test' diff --git a/compiler/testData/ir/irText/expressions/in.txt b/compiler/testData/ir/irText/expressions/in.txt index e9e1880a0c0..7df900e9e88 100644 --- a/compiler/testData/ir/irText/expressions/in.txt +++ b/compiler/testData/ir/irText/expressions/in.txt @@ -2,26 +2,26 @@ FILE /in.kt FUN public fun test1(a: kotlin.Any, x: kotlin.collections.Collection): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='test1(Any, Collection): Boolean' - CALL 'contains(Any): Boolean' type=kotlin.Boolean operator=IN - $this: GET_VAR 'value-parameter x: Collection' type=kotlin.collections.Collection operator=null - element: GET_VAR 'value-parameter a: Any' type=kotlin.Any operator=null + CALL 'contains(Any): Boolean' type=kotlin.Boolean origin=IN + $this: GET_VAR 'value-parameter x: Collection' type=kotlin.collections.Collection origin=null + element: GET_VAR 'value-parameter a: Any' type=kotlin.Any origin=null FUN public fun test2(a: kotlin.Any, x: kotlin.collections.Collection): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='test2(Any, Collection): Boolean' - CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean operator=NOT_IN - arg0: CALL 'contains(Any): Boolean' type=kotlin.Boolean operator=NOT_IN - $this: GET_VAR 'value-parameter x: Collection' type=kotlin.collections.Collection operator=null - element: GET_VAR 'value-parameter a: Any' type=kotlin.Any operator=null + CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=NOT_IN + arg0: CALL 'contains(Any): Boolean' type=kotlin.Boolean origin=NOT_IN + $this: GET_VAR 'value-parameter x: Collection' type=kotlin.collections.Collection origin=null + element: GET_VAR 'value-parameter a: Any' type=kotlin.Any origin=null FUN public fun test3(a: T, x: kotlin.collections.Collection): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='test3(T, Collection): Boolean' - CALL 'contains(T): Boolean' type=kotlin.Boolean operator=IN - $this: GET_VAR 'value-parameter x: Collection' type=kotlin.collections.Collection operator=null - element: GET_VAR 'value-parameter a: T' type=T operator=null + CALL 'contains(T): Boolean' type=kotlin.Boolean origin=IN + $this: GET_VAR 'value-parameter x: Collection' type=kotlin.collections.Collection origin=null + element: GET_VAR 'value-parameter a: T' type=T origin=null FUN public fun test4(a: T, x: kotlin.collections.Collection): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='test4(T, Collection): Boolean' - CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean operator=NOT_IN - arg0: CALL 'contains(T): Boolean' type=kotlin.Boolean operator=NOT_IN - $this: GET_VAR 'value-parameter x: Collection' type=kotlin.collections.Collection operator=null - element: GET_VAR 'value-parameter a: T' type=T operator=null + CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=NOT_IN + arg0: CALL 'contains(T): Boolean' type=kotlin.Boolean origin=NOT_IN + $this: GET_VAR 'value-parameter x: Collection' type=kotlin.collections.Collection origin=null + element: GET_VAR 'value-parameter a: T' type=T origin=null diff --git a/compiler/testData/ir/irText/expressions/incrementDecrement.txt b/compiler/testData/ir/irText/expressions/incrementDecrement.txt index 9de250f5d0a..395ef4cf5a6 100644 --- a/compiler/testData/ir/irText/expressions/incrementDecrement.txt +++ b/compiler/testData/ir/irText/expressions/incrementDecrement.txt @@ -6,15 +6,15 @@ FILE /incrementDecrement.kt FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'p: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'p: Int' type=kotlin.Int origin=null FUN DEFAULT_PROPERTY_ACCESSOR public fun (: kotlin.Int): kotlin.Unit BLOCK_BODY - SET_BACKING_FIELD 'p: Int' type=kotlin.Unit operator=null - value: GET_VAR 'value-parameter : Int' type=kotlin.Int operator=null + SET_BACKING_FIELD 'p: Int' type=kotlin.Unit origin=null + value: GET_VAR 'value-parameter : Int' type=kotlin.Int origin=null PROPERTY public val arr: kotlin.IntArray FIELD PROPERTY_BACKING_FIELD public val arr: kotlin.IntArray EXPRESSION_BODY - CALL 'intArrayOf(vararg Int): IntArray' type=kotlin.IntArray operator=null + CALL 'intArrayOf(vararg Int): IntArray' type=kotlin.IntArray origin=null elements: VARARG type=IntArray varargElementType=Int CONST Int type=kotlin.Int value='1' CONST Int type=kotlin.Int value='2' @@ -22,152 +22,152 @@ FILE /incrementDecrement.kt FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.IntArray BLOCK_BODY RETURN type=kotlin.Nothing from='(): IntArray' - GET_BACKING_FIELD 'arr: IntArray' type=kotlin.IntArray operator=null + GET_BACKING_FIELD 'arr: IntArray' type=kotlin.IntArray origin=null FUN public fun testVarPrefix(): kotlin.Unit BLOCK_BODY VAR var x: kotlin.Int CONST Int type=kotlin.Int value='0' VAR val x1: kotlin.Int - BLOCK type=kotlin.Int operator=PREFIX_INCR + BLOCK type=kotlin.Int origin=PREFIX_INCR VAR IR_TEMPORARY_VARIABLE val tmp0: kotlin.Int - CALL 'inc(): Int' type=kotlin.Int operator=PREFIX_INCR - $this: GET_VAR 'x: Int' type=kotlin.Int operator=PREFIX_INCR - SET_VAR 'x: Int' type=kotlin.Unit operator=PREFIX_INCR - GET_VAR 'tmp0: Int' type=kotlin.Int operator=null - GET_VAR 'tmp0: Int' type=kotlin.Int operator=null + CALL 'inc(): Int' type=kotlin.Int origin=PREFIX_INCR + $this: GET_VAR 'x: Int' type=kotlin.Int origin=PREFIX_INCR + SET_VAR 'x: Int' type=kotlin.Unit origin=PREFIX_INCR + GET_VAR 'tmp0: Int' type=kotlin.Int origin=null + GET_VAR 'tmp0: Int' type=kotlin.Int origin=null VAR val x2: kotlin.Int - BLOCK type=kotlin.Int operator=PREFIX_DECR + BLOCK type=kotlin.Int origin=PREFIX_DECR VAR IR_TEMPORARY_VARIABLE val tmp1: kotlin.Int - CALL 'dec(): Int' type=kotlin.Int operator=PREFIX_DECR - $this: GET_VAR 'x: Int' type=kotlin.Int operator=PREFIX_DECR - SET_VAR 'x: Int' type=kotlin.Unit operator=PREFIX_DECR - GET_VAR 'tmp1: Int' type=kotlin.Int operator=null - GET_VAR 'tmp1: Int' type=kotlin.Int operator=null + CALL 'dec(): Int' type=kotlin.Int origin=PREFIX_DECR + $this: GET_VAR 'x: Int' type=kotlin.Int origin=PREFIX_DECR + SET_VAR 'x: Int' type=kotlin.Unit origin=PREFIX_DECR + GET_VAR 'tmp1: Int' type=kotlin.Int origin=null + GET_VAR 'tmp1: Int' type=kotlin.Int origin=null FUN public fun testVarPostfix(): kotlin.Unit BLOCK_BODY VAR var x: kotlin.Int CONST Int type=kotlin.Int value='0' VAR val x1: kotlin.Int - BLOCK type=kotlin.Int operator=POSTFIX_INCR + BLOCK type=kotlin.Int origin=POSTFIX_INCR VAR IR_TEMPORARY_VARIABLE val tmp0: kotlin.Int - GET_VAR 'x: Int' type=kotlin.Int operator=POSTFIX_INCR - SET_VAR 'x: Int' type=kotlin.Unit operator=POSTFIX_INCR - CALL 'inc(): Int' type=kotlin.Int operator=POSTFIX_INCR - $this: GET_VAR 'tmp0: Int' type=kotlin.Int operator=null - GET_VAR 'tmp0: Int' type=kotlin.Int operator=null + GET_VAR 'x: Int' type=kotlin.Int origin=POSTFIX_INCR + SET_VAR 'x: Int' type=kotlin.Unit origin=POSTFIX_INCR + CALL 'inc(): Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'tmp0: Int' type=kotlin.Int origin=null + GET_VAR 'tmp0: Int' type=kotlin.Int origin=null VAR val x2: kotlin.Int - BLOCK type=kotlin.Int operator=POSTFIX_DECR + BLOCK type=kotlin.Int origin=POSTFIX_DECR VAR IR_TEMPORARY_VARIABLE val tmp1: kotlin.Int - GET_VAR 'x: Int' type=kotlin.Int operator=POSTFIX_DECR - SET_VAR 'x: Int' type=kotlin.Unit operator=POSTFIX_DECR - CALL 'dec(): Int' type=kotlin.Int operator=POSTFIX_DECR - $this: GET_VAR 'tmp1: Int' type=kotlin.Int operator=null - GET_VAR 'tmp1: Int' type=kotlin.Int operator=null + GET_VAR 'x: Int' type=kotlin.Int origin=POSTFIX_DECR + SET_VAR 'x: Int' type=kotlin.Unit origin=POSTFIX_DECR + CALL 'dec(): Int' type=kotlin.Int origin=POSTFIX_DECR + $this: GET_VAR 'tmp1: Int' type=kotlin.Int origin=null + GET_VAR 'tmp1: Int' type=kotlin.Int origin=null FUN public fun testPropPrefix(): kotlin.Unit BLOCK_BODY VAR val p1: kotlin.Int - BLOCK type=kotlin.Int operator=PREFIX_INCR - BLOCK type=kotlin.Int operator=PREFIX_INCR + BLOCK type=kotlin.Int origin=PREFIX_INCR + BLOCK type=kotlin.Int origin=PREFIX_INCR VAR IR_TEMPORARY_VARIABLE val tmp0: kotlin.Int - CALL 'inc(): Int' type=kotlin.Int operator=PREFIX_INCR - $this: CALL '(): Int' type=kotlin.Int operator=PREFIX_INCR - CALL '(Int): Unit' type=kotlin.Unit operator=PREFIX_INCR - : GET_VAR 'tmp0: Int' type=kotlin.Int operator=null - GET_VAR 'tmp0: Int' type=kotlin.Int operator=null + CALL 'inc(): Int' type=kotlin.Int origin=PREFIX_INCR + $this: CALL '(): Int' type=kotlin.Int origin=PREFIX_INCR + CALL '(Int): Unit' type=kotlin.Unit origin=PREFIX_INCR + : GET_VAR 'tmp0: Int' type=kotlin.Int origin=null + GET_VAR 'tmp0: Int' type=kotlin.Int origin=null VAR val p2: kotlin.Int - BLOCK type=kotlin.Int operator=PREFIX_DECR - BLOCK type=kotlin.Int operator=PREFIX_DECR + BLOCK type=kotlin.Int origin=PREFIX_DECR + BLOCK type=kotlin.Int origin=PREFIX_DECR VAR IR_TEMPORARY_VARIABLE val tmp1: kotlin.Int - CALL 'dec(): Int' type=kotlin.Int operator=PREFIX_DECR - $this: CALL '(): Int' type=kotlin.Int operator=PREFIX_DECR - CALL '(Int): Unit' type=kotlin.Unit operator=PREFIX_DECR - : GET_VAR 'tmp1: Int' type=kotlin.Int operator=null - GET_VAR 'tmp1: Int' type=kotlin.Int operator=null + CALL 'dec(): Int' type=kotlin.Int origin=PREFIX_DECR + $this: CALL '(): Int' type=kotlin.Int origin=PREFIX_DECR + CALL '(Int): Unit' type=kotlin.Unit origin=PREFIX_DECR + : GET_VAR 'tmp1: Int' type=kotlin.Int origin=null + GET_VAR 'tmp1: Int' type=kotlin.Int origin=null FUN public fun testPropPostfix(): kotlin.Unit BLOCK_BODY VAR val p1: kotlin.Int - BLOCK type=kotlin.Int operator=POSTFIX_INCR - BLOCK type=kotlin.Int operator=POSTFIX_INCR + BLOCK type=kotlin.Int origin=POSTFIX_INCR + BLOCK type=kotlin.Int origin=POSTFIX_INCR VAR IR_TEMPORARY_VARIABLE val tmp0: kotlin.Int - CALL '(): Int' type=kotlin.Int operator=POSTFIX_INCR - CALL '(Int): Unit' type=kotlin.Unit operator=POSTFIX_INCR - : CALL 'inc(): Int' type=kotlin.Int operator=POSTFIX_INCR - $this: GET_VAR 'tmp0: Int' type=kotlin.Int operator=null - GET_VAR 'tmp0: Int' type=kotlin.Int operator=null + CALL '(): Int' type=kotlin.Int origin=POSTFIX_INCR + CALL '(Int): Unit' type=kotlin.Unit origin=POSTFIX_INCR + : CALL 'inc(): Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'tmp0: Int' type=kotlin.Int origin=null + GET_VAR 'tmp0: Int' type=kotlin.Int origin=null VAR val p2: kotlin.Int - BLOCK type=kotlin.Int operator=PREFIX_DECR - BLOCK type=kotlin.Int operator=PREFIX_DECR + BLOCK type=kotlin.Int origin=PREFIX_DECR + BLOCK type=kotlin.Int origin=PREFIX_DECR VAR IR_TEMPORARY_VARIABLE val tmp1: kotlin.Int - CALL 'dec(): Int' type=kotlin.Int operator=PREFIX_DECR - $this: CALL '(): Int' type=kotlin.Int operator=PREFIX_DECR - CALL '(Int): Unit' type=kotlin.Unit operator=PREFIX_DECR - : GET_VAR 'tmp1: Int' type=kotlin.Int operator=null - GET_VAR 'tmp1: Int' type=kotlin.Int operator=null + CALL 'dec(): Int' type=kotlin.Int origin=PREFIX_DECR + $this: CALL '(): Int' type=kotlin.Int origin=PREFIX_DECR + CALL '(Int): Unit' type=kotlin.Unit origin=PREFIX_DECR + : GET_VAR 'tmp1: Int' type=kotlin.Int origin=null + GET_VAR 'tmp1: Int' type=kotlin.Int origin=null FUN public fun testArrayPrefix(): kotlin.Unit BLOCK_BODY VAR val a1: kotlin.Int - BLOCK type=kotlin.Int operator=PREFIX_INCR + BLOCK type=kotlin.Int origin=PREFIX_INCR VAR IR_TEMPORARY_VARIABLE val tmp0_array: kotlin.IntArray - CALL '(): IntArray' type=kotlin.IntArray operator=GET_PROPERTY + CALL '(): IntArray' type=kotlin.IntArray origin=GET_PROPERTY VAR IR_TEMPORARY_VARIABLE val tmp1_index0: kotlin.Int CONST Int type=kotlin.Int value='0' VAR IR_TEMPORARY_VARIABLE val tmp2: kotlin.Int - CALL 'inc(): Int' type=kotlin.Int operator=PREFIX_INCR - $this: CALL 'get(Int): Int' type=kotlin.Int operator=PREFIX_INCR - $this: GET_VAR 'tmp0_array: IntArray' type=kotlin.IntArray operator=null - index: GET_VAR 'tmp1_index0: Int' type=kotlin.Int operator=null - CALL 'set(Int, Int): Unit' type=kotlin.Unit operator=PREFIX_INCR - $this: GET_VAR 'tmp0_array: IntArray' type=kotlin.IntArray operator=null - index: GET_VAR 'tmp1_index0: Int' type=kotlin.Int operator=null - value: GET_VAR 'tmp2: Int' type=kotlin.Int operator=null - GET_VAR 'tmp2: Int' type=kotlin.Int operator=null + CALL 'inc(): Int' type=kotlin.Int origin=PREFIX_INCR + $this: CALL 'get(Int): Int' type=kotlin.Int origin=PREFIX_INCR + $this: GET_VAR 'tmp0_array: IntArray' type=kotlin.IntArray origin=null + index: GET_VAR 'tmp1_index0: Int' type=kotlin.Int origin=null + CALL 'set(Int, Int): Unit' type=kotlin.Unit origin=PREFIX_INCR + $this: GET_VAR 'tmp0_array: IntArray' type=kotlin.IntArray origin=null + index: GET_VAR 'tmp1_index0: Int' type=kotlin.Int origin=null + value: GET_VAR 'tmp2: Int' type=kotlin.Int origin=null + GET_VAR 'tmp2: Int' type=kotlin.Int origin=null VAR val a2: kotlin.Int - BLOCK type=kotlin.Int operator=PREFIX_DECR + BLOCK type=kotlin.Int origin=PREFIX_DECR VAR IR_TEMPORARY_VARIABLE val tmp3_array: kotlin.IntArray - CALL '(): IntArray' type=kotlin.IntArray operator=GET_PROPERTY + CALL '(): IntArray' type=kotlin.IntArray origin=GET_PROPERTY VAR IR_TEMPORARY_VARIABLE val tmp4_index0: kotlin.Int CONST Int type=kotlin.Int value='0' VAR IR_TEMPORARY_VARIABLE val tmp5: kotlin.Int - CALL 'dec(): Int' type=kotlin.Int operator=PREFIX_DECR - $this: CALL 'get(Int): Int' type=kotlin.Int operator=PREFIX_DECR - $this: GET_VAR 'tmp3_array: IntArray' type=kotlin.IntArray operator=null - index: GET_VAR 'tmp4_index0: Int' type=kotlin.Int operator=null - CALL 'set(Int, Int): Unit' type=kotlin.Unit operator=PREFIX_DECR - $this: GET_VAR 'tmp3_array: IntArray' type=kotlin.IntArray operator=null - index: GET_VAR 'tmp4_index0: Int' type=kotlin.Int operator=null - value: GET_VAR 'tmp5: Int' type=kotlin.Int operator=null - GET_VAR 'tmp5: Int' type=kotlin.Int operator=null + CALL 'dec(): Int' type=kotlin.Int origin=PREFIX_DECR + $this: CALL 'get(Int): Int' type=kotlin.Int origin=PREFIX_DECR + $this: GET_VAR 'tmp3_array: IntArray' type=kotlin.IntArray origin=null + index: GET_VAR 'tmp4_index0: Int' type=kotlin.Int origin=null + CALL 'set(Int, Int): Unit' type=kotlin.Unit origin=PREFIX_DECR + $this: GET_VAR 'tmp3_array: IntArray' type=kotlin.IntArray origin=null + index: GET_VAR 'tmp4_index0: Int' type=kotlin.Int origin=null + value: GET_VAR 'tmp5: Int' type=kotlin.Int origin=null + GET_VAR 'tmp5: Int' type=kotlin.Int origin=null FUN public fun testArrayPostfix(): kotlin.Unit BLOCK_BODY VAR val a1: kotlin.Int - BLOCK type=kotlin.Int operator=POSTFIX_INCR + BLOCK type=kotlin.Int origin=POSTFIX_INCR VAR IR_TEMPORARY_VARIABLE val tmp0_array: kotlin.IntArray - CALL '(): IntArray' type=kotlin.IntArray operator=GET_PROPERTY + CALL '(): IntArray' type=kotlin.IntArray origin=GET_PROPERTY VAR IR_TEMPORARY_VARIABLE val tmp1_index0: kotlin.Int CONST Int type=kotlin.Int value='0' VAR IR_TEMPORARY_VARIABLE val tmp2: kotlin.Int - CALL 'get(Int): Int' type=kotlin.Int operator=POSTFIX_INCR - $this: GET_VAR 'tmp0_array: IntArray' type=kotlin.IntArray operator=null - index: GET_VAR 'tmp1_index0: Int' type=kotlin.Int operator=null - CALL 'set(Int, Int): Unit' type=kotlin.Unit operator=POSTFIX_INCR - $this: GET_VAR 'tmp0_array: IntArray' type=kotlin.IntArray operator=null - index: GET_VAR 'tmp1_index0: Int' type=kotlin.Int operator=null - value: CALL 'inc(): Int' type=kotlin.Int operator=POSTFIX_INCR - $this: GET_VAR 'tmp2: Int' type=kotlin.Int operator=null - GET_VAR 'tmp2: Int' type=kotlin.Int operator=null + CALL 'get(Int): Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'tmp0_array: IntArray' type=kotlin.IntArray origin=null + index: GET_VAR 'tmp1_index0: Int' type=kotlin.Int origin=null + CALL 'set(Int, Int): Unit' type=kotlin.Unit origin=POSTFIX_INCR + $this: GET_VAR 'tmp0_array: IntArray' type=kotlin.IntArray origin=null + index: GET_VAR 'tmp1_index0: Int' type=kotlin.Int origin=null + value: CALL 'inc(): Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'tmp2: Int' type=kotlin.Int origin=null + GET_VAR 'tmp2: Int' type=kotlin.Int origin=null VAR val a2: kotlin.Int - BLOCK type=kotlin.Int operator=POSTFIX_DECR + BLOCK type=kotlin.Int origin=POSTFIX_DECR VAR IR_TEMPORARY_VARIABLE val tmp3_array: kotlin.IntArray - CALL '(): IntArray' type=kotlin.IntArray operator=GET_PROPERTY + CALL '(): IntArray' type=kotlin.IntArray origin=GET_PROPERTY VAR IR_TEMPORARY_VARIABLE val tmp4_index0: kotlin.Int CONST Int type=kotlin.Int value='0' VAR IR_TEMPORARY_VARIABLE val tmp5: kotlin.Int - CALL 'get(Int): Int' type=kotlin.Int operator=POSTFIX_DECR - $this: GET_VAR 'tmp3_array: IntArray' type=kotlin.IntArray operator=null - index: GET_VAR 'tmp4_index0: Int' type=kotlin.Int operator=null - CALL 'set(Int, Int): Unit' type=kotlin.Unit operator=POSTFIX_DECR - $this: GET_VAR 'tmp3_array: IntArray' type=kotlin.IntArray operator=null - index: GET_VAR 'tmp4_index0: Int' type=kotlin.Int operator=null - value: CALL 'dec(): Int' type=kotlin.Int operator=POSTFIX_DECR - $this: GET_VAR 'tmp5: Int' type=kotlin.Int operator=null - GET_VAR 'tmp5: Int' type=kotlin.Int operator=null + CALL 'get(Int): Int' type=kotlin.Int origin=POSTFIX_DECR + $this: GET_VAR 'tmp3_array: IntArray' type=kotlin.IntArray origin=null + index: GET_VAR 'tmp4_index0: Int' type=kotlin.Int origin=null + CALL 'set(Int, Int): Unit' type=kotlin.Unit origin=POSTFIX_DECR + $this: GET_VAR 'tmp3_array: IntArray' type=kotlin.IntArray origin=null + index: GET_VAR 'tmp4_index0: Int' type=kotlin.Int origin=null + value: CALL 'dec(): Int' type=kotlin.Int origin=POSTFIX_DECR + $this: GET_VAR 'tmp5: Int' type=kotlin.Int origin=null + GET_VAR 'tmp5: Int' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/jvmInstanceFieldReference.txt b/compiler/testData/ir/irText/expressions/jvmInstanceFieldReference.txt index 6324e03c5df..a0bc92c5f7c 100644 --- a/compiler/testData/ir/irText/expressions/jvmInstanceFieldReference.txt +++ b/compiler/testData/ir/irText/expressions/jvmInstanceFieldReference.txt @@ -6,16 +6,16 @@ FILE /Derived.kt INSTANCE_INITIALIZER_CALL classDescriptor='Derived' ANONYMOUS_INITIALIZER Derived BLOCK_BODY - SET_BACKING_FIELD 'value: Int' type=kotlin.Unit operator=EQ + SET_BACKING_FIELD 'value: Int' type=kotlin.Unit origin=EQ receiver: THIS of 'Derived' type=Derived value: CONST Int type=kotlin.Int value='0' FUN public final fun getValue(): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='getValue(): Int' - GET_BACKING_FIELD 'value: Int' type=kotlin.Int operator=GET_PROPERTY + GET_BACKING_FIELD 'value: Int' type=kotlin.Int origin=GET_PROPERTY receiver: THIS of 'Derived' type=Derived FUN public final fun setValue(value: kotlin.Int): kotlin.Unit BLOCK_BODY - SET_BACKING_FIELD 'value: Int' type=kotlin.Unit operator=EQ + SET_BACKING_FIELD 'value: Int' type=kotlin.Unit origin=EQ receiver: THIS of 'Derived' type=Derived - value: GET_VAR 'value-parameter value: Int' type=kotlin.Int operator=null + value: GET_VAR 'value-parameter value: Int' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/jvmStaticFieldReference.txt b/compiler/testData/ir/irText/expressions/jvmStaticFieldReference.txt index aed71bcf410..a6603a47d72 100644 --- a/compiler/testData/ir/irText/expressions/jvmStaticFieldReference.txt +++ b/compiler/testData/ir/irText/expressions/jvmStaticFieldReference.txt @@ -1,24 +1,24 @@ FILE /jvmStaticFieldReference.kt FUN public fun testFun(): kotlin.Unit BLOCK_BODY - CALL 'println(String!): Unit' type=kotlin.Unit operator=null - $this: TYPE_OP operator=IMPLICIT_NOTNULL typeOperand=java.io.PrintStream - GET_BACKING_FIELD 'out: PrintStream!' type=java.io.PrintStream! operator=GET_PROPERTY + CALL 'println(String!): Unit' type=kotlin.Unit origin=null + $this: TYPE_OP origin=IMPLICIT_NOTNULL typeOperand=java.io.PrintStream + GET_BACKING_FIELD 'out: PrintStream!' type=java.io.PrintStream! origin=GET_PROPERTY p0: CONST String type=kotlin.String value='testFun' PROPERTY public var testProp: kotlin.Any FUN public fun (): kotlin.Any BLOCK_BODY - CALL 'println(String!): Unit' type=kotlin.Unit operator=null - $this: TYPE_OP operator=IMPLICIT_NOTNULL typeOperand=java.io.PrintStream - GET_BACKING_FIELD 'out: PrintStream!' type=java.io.PrintStream! operator=GET_PROPERTY + CALL 'println(String!): Unit' type=kotlin.Unit origin=null + $this: TYPE_OP origin=IMPLICIT_NOTNULL typeOperand=java.io.PrintStream + GET_BACKING_FIELD 'out: PrintStream!' type=java.io.PrintStream! origin=GET_PROPERTY p0: CONST String type=kotlin.String value='testProp/get' RETURN type=kotlin.Nothing from='(): Any' CONST Int type=kotlin.Int value='42' FUN public fun (value: kotlin.Any): kotlin.Unit BLOCK_BODY - CALL 'println(String!): Unit' type=kotlin.Unit operator=null - $this: TYPE_OP operator=IMPLICIT_NOTNULL typeOperand=java.io.PrintStream - GET_BACKING_FIELD 'out: PrintStream!' type=java.io.PrintStream! operator=GET_PROPERTY + CALL 'println(String!): Unit' type=kotlin.Unit origin=null + $this: TYPE_OP origin=IMPLICIT_NOTNULL typeOperand=java.io.PrintStream + GET_BACKING_FIELD 'out: PrintStream!' type=java.io.PrintStream! origin=GET_PROPERTY p0: CONST String type=kotlin.String value='testProp/set' CLASS CLASS TestClass CONSTRUCTOR public constructor TestClass() @@ -28,21 +28,21 @@ FILE /jvmStaticFieldReference.kt PROPERTY public final val test: kotlin.Int FIELD PROPERTY_BACKING_FIELD public final val test: kotlin.Int EXPRESSION_BODY - WHEN type=kotlin.Int operator=WHEN - else: BLOCK type=kotlin.Int operator=null - CALL 'println(String!): Unit' type=kotlin.Unit operator=null - $this: TYPE_OP operator=IMPLICIT_NOTNULL typeOperand=java.io.PrintStream - GET_BACKING_FIELD 'out: PrintStream!' type=java.io.PrintStream! operator=GET_PROPERTY + WHEN type=kotlin.Int origin=WHEN + else: BLOCK type=kotlin.Int origin=null + CALL 'println(String!): Unit' type=kotlin.Unit origin=null + $this: TYPE_OP origin=IMPLICIT_NOTNULL typeOperand=java.io.PrintStream + GET_BACKING_FIELD 'out: PrintStream!' type=java.io.PrintStream! origin=GET_PROPERTY p0: CONST String type=kotlin.String value='TestClass/test' CONST Int type=kotlin.Int value='42' FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'test: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'test: Int' type=kotlin.Int origin=null receiver: THIS of 'TestClass' type=TestClass ANONYMOUS_INITIALIZER TestClass BLOCK_BODY - CALL 'println(String!): Unit' type=kotlin.Unit operator=null - $this: TYPE_OP operator=IMPLICIT_NOTNULL typeOperand=java.io.PrintStream - GET_BACKING_FIELD 'out: PrintStream!' type=java.io.PrintStream! operator=GET_PROPERTY + CALL 'println(String!): Unit' type=kotlin.Unit origin=null + $this: TYPE_OP origin=IMPLICIT_NOTNULL typeOperand=java.io.PrintStream + GET_BACKING_FIELD 'out: PrintStream!' type=java.io.PrintStream! origin=GET_PROPERTY p0: CONST String type=kotlin.String value='TestClass/init' diff --git a/compiler/testData/ir/irText/expressions/literals.txt b/compiler/testData/ir/irText/expressions/literals.txt index 029b9d38675..e24a3495396 100644 --- a/compiler/testData/ir/irText/expressions/literals.txt +++ b/compiler/testData/ir/irText/expressions/literals.txt @@ -6,7 +6,7 @@ FILE /literals.kt FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'test1: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'test1: Int' type=kotlin.Int origin=null PROPERTY public val test2: kotlin.Int = -1 FIELD PROPERTY_BACKING_FIELD public val test2: kotlin.Int = -1 EXPRESSION_BODY @@ -14,7 +14,7 @@ FILE /literals.kt FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'test2: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'test2: Int' type=kotlin.Int origin=null PROPERTY public val test3: kotlin.Boolean = true FIELD PROPERTY_BACKING_FIELD public val test3: kotlin.Boolean = true EXPRESSION_BODY @@ -22,7 +22,7 @@ FILE /literals.kt FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='(): Boolean' - GET_BACKING_FIELD 'test3: Boolean' type=kotlin.Boolean operator=null + GET_BACKING_FIELD 'test3: Boolean' type=kotlin.Boolean origin=null PROPERTY public val test4: kotlin.Boolean = false FIELD PROPERTY_BACKING_FIELD public val test4: kotlin.Boolean = false EXPRESSION_BODY @@ -30,7 +30,7 @@ FILE /literals.kt FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='(): Boolean' - GET_BACKING_FIELD 'test4: Boolean' type=kotlin.Boolean operator=null + GET_BACKING_FIELD 'test4: Boolean' type=kotlin.Boolean origin=null PROPERTY public val test5: kotlin.String = "abc" FIELD PROPERTY_BACKING_FIELD public val test5: kotlin.String = "abc" EXPRESSION_BODY @@ -38,7 +38,7 @@ FILE /literals.kt FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='(): String' - GET_BACKING_FIELD 'test5: String' type=kotlin.String operator=null + GET_BACKING_FIELD 'test5: String' type=kotlin.String origin=null PROPERTY public val test6: kotlin.Nothing? = null FIELD PROPERTY_BACKING_FIELD public val test6: kotlin.Nothing? = null EXPRESSION_BODY @@ -46,7 +46,7 @@ FILE /literals.kt FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.Nothing? BLOCK_BODY RETURN type=kotlin.Nothing from='(): Nothing?' - GET_BACKING_FIELD 'test6: Nothing?' type=kotlin.Nothing? operator=null + GET_BACKING_FIELD 'test6: Nothing?' type=kotlin.Nothing? origin=null PROPERTY public val test7: kotlin.Long = 1.toLong() FIELD PROPERTY_BACKING_FIELD public val test7: kotlin.Long = 1.toLong() EXPRESSION_BODY @@ -54,7 +54,7 @@ FILE /literals.kt FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.Long BLOCK_BODY RETURN type=kotlin.Nothing from='(): Long' - GET_BACKING_FIELD 'test7: Long' type=kotlin.Long operator=null + GET_BACKING_FIELD 'test7: Long' type=kotlin.Long origin=null PROPERTY public val test8: kotlin.Long = -1.toLong() FIELD PROPERTY_BACKING_FIELD public val test8: kotlin.Long = -1.toLong() EXPRESSION_BODY @@ -62,7 +62,7 @@ FILE /literals.kt FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.Long BLOCK_BODY RETURN type=kotlin.Nothing from='(): Long' - GET_BACKING_FIELD 'test8: Long' type=kotlin.Long operator=null + GET_BACKING_FIELD 'test8: Long' type=kotlin.Long origin=null PROPERTY public val test9: kotlin.Double = 1.0.toDouble() FIELD PROPERTY_BACKING_FIELD public val test9: kotlin.Double = 1.0.toDouble() EXPRESSION_BODY @@ -70,7 +70,7 @@ FILE /literals.kt FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.Double BLOCK_BODY RETURN type=kotlin.Nothing from='(): Double' - GET_BACKING_FIELD 'test9: Double' type=kotlin.Double operator=null + GET_BACKING_FIELD 'test9: Double' type=kotlin.Double origin=null PROPERTY public val test10: kotlin.Double = -1.0.toDouble() FIELD PROPERTY_BACKING_FIELD public val test10: kotlin.Double = -1.0.toDouble() EXPRESSION_BODY @@ -78,7 +78,7 @@ FILE /literals.kt FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.Double BLOCK_BODY RETURN type=kotlin.Nothing from='(): Double' - GET_BACKING_FIELD 'test10: Double' type=kotlin.Double operator=null + GET_BACKING_FIELD 'test10: Double' type=kotlin.Double origin=null PROPERTY public val test11: kotlin.Float = 1.0.toFloat() FIELD PROPERTY_BACKING_FIELD public val test11: kotlin.Float = 1.0.toFloat() EXPRESSION_BODY @@ -86,7 +86,7 @@ FILE /literals.kt FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.Float BLOCK_BODY RETURN type=kotlin.Nothing from='(): Float' - GET_BACKING_FIELD 'test11: Float' type=kotlin.Float operator=null + GET_BACKING_FIELD 'test11: Float' type=kotlin.Float origin=null PROPERTY public val test12: kotlin.Float = -1.0.toFloat() FIELD PROPERTY_BACKING_FIELD public val test12: kotlin.Float = -1.0.toFloat() EXPRESSION_BODY @@ -94,7 +94,7 @@ FILE /literals.kt FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.Float BLOCK_BODY RETURN type=kotlin.Nothing from='(): Float' - GET_BACKING_FIELD 'test12: Float' type=kotlin.Float operator=null + GET_BACKING_FIELD 'test12: Float' type=kotlin.Float origin=null PROPERTY public val test13: kotlin.Char = \u0061 ('a') FIELD PROPERTY_BACKING_FIELD public val test13: kotlin.Char = \u0061 ('a') EXPRESSION_BODY @@ -102,7 +102,7 @@ FILE /literals.kt FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.Char BLOCK_BODY RETURN type=kotlin.Nothing from='(): Char' - GET_BACKING_FIELD 'test13: Char' type=kotlin.Char operator=null + GET_BACKING_FIELD 'test13: Char' type=kotlin.Char origin=null PROPERTY public val testB: kotlin.Byte = 1.toByte() FIELD PROPERTY_BACKING_FIELD public val testB: kotlin.Byte = 1.toByte() EXPRESSION_BODY @@ -110,7 +110,7 @@ FILE /literals.kt FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.Byte BLOCK_BODY RETURN type=kotlin.Nothing from='(): Byte' - GET_BACKING_FIELD 'testB: Byte' type=kotlin.Byte operator=null + GET_BACKING_FIELD 'testB: Byte' type=kotlin.Byte origin=null PROPERTY public val testS: kotlin.Short = 1.toShort() FIELD PROPERTY_BACKING_FIELD public val testS: kotlin.Short = 1.toShort() EXPRESSION_BODY @@ -118,7 +118,7 @@ FILE /literals.kt FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.Short BLOCK_BODY RETURN type=kotlin.Nothing from='(): Short' - GET_BACKING_FIELD 'testS: Short' type=kotlin.Short operator=null + GET_BACKING_FIELD 'testS: Short' type=kotlin.Short origin=null PROPERTY public val testI: kotlin.Int = 1 FIELD PROPERTY_BACKING_FIELD public val testI: kotlin.Int = 1 EXPRESSION_BODY @@ -126,7 +126,7 @@ FILE /literals.kt FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'testI: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'testI: Int' type=kotlin.Int origin=null PROPERTY public val testL: kotlin.Long = 1.toLong() FIELD PROPERTY_BACKING_FIELD public val testL: kotlin.Long = 1.toLong() EXPRESSION_BODY @@ -134,4 +134,4 @@ FILE /literals.kt FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.Long BLOCK_BODY RETURN type=kotlin.Nothing from='(): Long' - GET_BACKING_FIELD 'testL: Long' type=kotlin.Long operator=null + GET_BACKING_FIELD 'testL: Long' type=kotlin.Long origin=null diff --git a/compiler/testData/ir/irText/expressions/primitiveComparisons.txt b/compiler/testData/ir/irText/expressions/primitiveComparisons.txt index 62749af535d..c4234cd0fd6 100644 --- a/compiler/testData/ir/irText/expressions/primitiveComparisons.txt +++ b/compiler/testData/ir/irText/expressions/primitiveComparisons.txt @@ -2,168 +2,168 @@ FILE /primitiveComparisons.kt FUN public fun btest1(a: kotlin.Byte, b: kotlin.Byte): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='btest1(Byte, Byte): Boolean' - CALL 'GT0(Int): Boolean' type=kotlin.Boolean operator=GT - arg0: CALL 'compareTo(Byte): Int' type=kotlin.Int operator=GT - $this: GET_VAR 'value-parameter a: Byte' type=kotlin.Byte operator=null - other: GET_VAR 'value-parameter b: Byte' type=kotlin.Byte operator=null + CALL 'GT0(Int): Boolean' type=kotlin.Boolean origin=GT + arg0: CALL 'compareTo(Byte): Int' type=kotlin.Int origin=GT + $this: GET_VAR 'value-parameter a: Byte' type=kotlin.Byte origin=null + other: GET_VAR 'value-parameter b: Byte' type=kotlin.Byte origin=null FUN public fun btest2(a: kotlin.Byte, b: kotlin.Byte): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='btest2(Byte, Byte): Boolean' - CALL 'LT0(Int): Boolean' type=kotlin.Boolean operator=LT - arg0: CALL 'compareTo(Byte): Int' type=kotlin.Int operator=LT - $this: GET_VAR 'value-parameter a: Byte' type=kotlin.Byte operator=null - other: GET_VAR 'value-parameter b: Byte' type=kotlin.Byte operator=null + CALL 'LT0(Int): Boolean' type=kotlin.Boolean origin=LT + arg0: CALL 'compareTo(Byte): Int' type=kotlin.Int origin=LT + $this: GET_VAR 'value-parameter a: Byte' type=kotlin.Byte origin=null + other: GET_VAR 'value-parameter b: Byte' type=kotlin.Byte origin=null FUN public fun btest3(a: kotlin.Byte, b: kotlin.Byte): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='btest3(Byte, Byte): Boolean' - CALL 'GTEQ0(Int): Boolean' type=kotlin.Boolean operator=GTEQ - arg0: CALL 'compareTo(Byte): Int' type=kotlin.Int operator=GTEQ - $this: GET_VAR 'value-parameter a: Byte' type=kotlin.Byte operator=null - other: GET_VAR 'value-parameter b: Byte' type=kotlin.Byte operator=null + CALL 'GTEQ0(Int): Boolean' type=kotlin.Boolean origin=GTEQ + arg0: CALL 'compareTo(Byte): Int' type=kotlin.Int origin=GTEQ + $this: GET_VAR 'value-parameter a: Byte' type=kotlin.Byte origin=null + other: GET_VAR 'value-parameter b: Byte' type=kotlin.Byte origin=null FUN public fun btest4(a: kotlin.Byte, b: kotlin.Byte): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='btest4(Byte, Byte): Boolean' - CALL 'LTEQ0(Int): Boolean' type=kotlin.Boolean operator=LTEQ - arg0: CALL 'compareTo(Byte): Int' type=kotlin.Int operator=LTEQ - $this: GET_VAR 'value-parameter a: Byte' type=kotlin.Byte operator=null - other: GET_VAR 'value-parameter b: Byte' type=kotlin.Byte operator=null + CALL 'LTEQ0(Int): Boolean' type=kotlin.Boolean origin=LTEQ + arg0: CALL 'compareTo(Byte): Int' type=kotlin.Int origin=LTEQ + $this: GET_VAR 'value-parameter a: Byte' type=kotlin.Byte origin=null + other: GET_VAR 'value-parameter b: Byte' type=kotlin.Byte origin=null FUN public fun stest1(a: kotlin.Short, b: kotlin.Short): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='stest1(Short, Short): Boolean' - CALL 'GT0(Int): Boolean' type=kotlin.Boolean operator=GT - arg0: CALL 'compareTo(Short): Int' type=kotlin.Int operator=GT - $this: GET_VAR 'value-parameter a: Short' type=kotlin.Short operator=null - other: GET_VAR 'value-parameter b: Short' type=kotlin.Short operator=null + CALL 'GT0(Int): Boolean' type=kotlin.Boolean origin=GT + arg0: CALL 'compareTo(Short): Int' type=kotlin.Int origin=GT + $this: GET_VAR 'value-parameter a: Short' type=kotlin.Short origin=null + other: GET_VAR 'value-parameter b: Short' type=kotlin.Short origin=null FUN public fun stest2(a: kotlin.Short, b: kotlin.Short): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='stest2(Short, Short): Boolean' - CALL 'LT0(Int): Boolean' type=kotlin.Boolean operator=LT - arg0: CALL 'compareTo(Short): Int' type=kotlin.Int operator=LT - $this: GET_VAR 'value-parameter a: Short' type=kotlin.Short operator=null - other: GET_VAR 'value-parameter b: Short' type=kotlin.Short operator=null + CALL 'LT0(Int): Boolean' type=kotlin.Boolean origin=LT + arg0: CALL 'compareTo(Short): Int' type=kotlin.Int origin=LT + $this: GET_VAR 'value-parameter a: Short' type=kotlin.Short origin=null + other: GET_VAR 'value-parameter b: Short' type=kotlin.Short origin=null FUN public fun stest3(a: kotlin.Short, b: kotlin.Short): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='stest3(Short, Short): Boolean' - CALL 'GTEQ0(Int): Boolean' type=kotlin.Boolean operator=GTEQ - arg0: CALL 'compareTo(Short): Int' type=kotlin.Int operator=GTEQ - $this: GET_VAR 'value-parameter a: Short' type=kotlin.Short operator=null - other: GET_VAR 'value-parameter b: Short' type=kotlin.Short operator=null + CALL 'GTEQ0(Int): Boolean' type=kotlin.Boolean origin=GTEQ + arg0: CALL 'compareTo(Short): Int' type=kotlin.Int origin=GTEQ + $this: GET_VAR 'value-parameter a: Short' type=kotlin.Short origin=null + other: GET_VAR 'value-parameter b: Short' type=kotlin.Short origin=null FUN public fun stest4(a: kotlin.Short, b: kotlin.Short): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='stest4(Short, Short): Boolean' - CALL 'LTEQ0(Int): Boolean' type=kotlin.Boolean operator=LTEQ - arg0: CALL 'compareTo(Short): Int' type=kotlin.Int operator=LTEQ - $this: GET_VAR 'value-parameter a: Short' type=kotlin.Short operator=null - other: GET_VAR 'value-parameter b: Short' type=kotlin.Short operator=null + CALL 'LTEQ0(Int): Boolean' type=kotlin.Boolean origin=LTEQ + arg0: CALL 'compareTo(Short): Int' type=kotlin.Int origin=LTEQ + $this: GET_VAR 'value-parameter a: Short' type=kotlin.Short origin=null + other: GET_VAR 'value-parameter b: Short' type=kotlin.Short origin=null FUN public fun itest1(a: kotlin.Int, b: kotlin.Int): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='itest1(Int, Int): Boolean' - CALL 'GT0(Int): Boolean' type=kotlin.Boolean operator=GT - arg0: CALL 'compareTo(Int): Int' type=kotlin.Int operator=GT - $this: GET_VAR 'value-parameter a: Int' type=kotlin.Int operator=null - other: GET_VAR 'value-parameter b: Int' type=kotlin.Int operator=null + CALL 'GT0(Int): Boolean' type=kotlin.Boolean origin=GT + arg0: CALL 'compareTo(Int): Int' type=kotlin.Int origin=GT + $this: GET_VAR 'value-parameter a: Int' type=kotlin.Int origin=null + other: GET_VAR 'value-parameter b: Int' type=kotlin.Int origin=null FUN public fun itest2(a: kotlin.Int, b: kotlin.Int): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='itest2(Int, Int): Boolean' - CALL 'LT0(Int): Boolean' type=kotlin.Boolean operator=LT - arg0: CALL 'compareTo(Int): Int' type=kotlin.Int operator=LT - $this: GET_VAR 'value-parameter a: Int' type=kotlin.Int operator=null - other: GET_VAR 'value-parameter b: Int' type=kotlin.Int operator=null + CALL 'LT0(Int): Boolean' type=kotlin.Boolean origin=LT + arg0: CALL 'compareTo(Int): Int' type=kotlin.Int origin=LT + $this: GET_VAR 'value-parameter a: Int' type=kotlin.Int origin=null + other: GET_VAR 'value-parameter b: Int' type=kotlin.Int origin=null FUN public fun itest3(a: kotlin.Int, b: kotlin.Int): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='itest3(Int, Int): Boolean' - CALL 'GTEQ0(Int): Boolean' type=kotlin.Boolean operator=GTEQ - arg0: CALL 'compareTo(Int): Int' type=kotlin.Int operator=GTEQ - $this: GET_VAR 'value-parameter a: Int' type=kotlin.Int operator=null - other: GET_VAR 'value-parameter b: Int' type=kotlin.Int operator=null + CALL 'GTEQ0(Int): Boolean' type=kotlin.Boolean origin=GTEQ + arg0: CALL 'compareTo(Int): Int' type=kotlin.Int origin=GTEQ + $this: GET_VAR 'value-parameter a: Int' type=kotlin.Int origin=null + other: GET_VAR 'value-parameter b: Int' type=kotlin.Int origin=null FUN public fun itest4(a: kotlin.Int, b: kotlin.Int): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='itest4(Int, Int): Boolean' - CALL 'LTEQ0(Int): Boolean' type=kotlin.Boolean operator=LTEQ - arg0: CALL 'compareTo(Int): Int' type=kotlin.Int operator=LTEQ - $this: GET_VAR 'value-parameter a: Int' type=kotlin.Int operator=null - other: GET_VAR 'value-parameter b: Int' type=kotlin.Int operator=null + CALL 'LTEQ0(Int): Boolean' type=kotlin.Boolean origin=LTEQ + arg0: CALL 'compareTo(Int): Int' type=kotlin.Int origin=LTEQ + $this: GET_VAR 'value-parameter a: Int' type=kotlin.Int origin=null + other: GET_VAR 'value-parameter b: Int' type=kotlin.Int origin=null FUN public fun ltest1(a: kotlin.Long, b: kotlin.Long): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='ltest1(Long, Long): Boolean' - CALL 'GT0(Int): Boolean' type=kotlin.Boolean operator=GT - arg0: CALL 'compareTo(Long): Int' type=kotlin.Int operator=GT - $this: GET_VAR 'value-parameter a: Long' type=kotlin.Long operator=null - other: GET_VAR 'value-parameter b: Long' type=kotlin.Long operator=null + CALL 'GT0(Int): Boolean' type=kotlin.Boolean origin=GT + arg0: CALL 'compareTo(Long): Int' type=kotlin.Int origin=GT + $this: GET_VAR 'value-parameter a: Long' type=kotlin.Long origin=null + other: GET_VAR 'value-parameter b: Long' type=kotlin.Long origin=null FUN public fun ltest2(a: kotlin.Long, b: kotlin.Long): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='ltest2(Long, Long): Boolean' - CALL 'LT0(Int): Boolean' type=kotlin.Boolean operator=LT - arg0: CALL 'compareTo(Long): Int' type=kotlin.Int operator=LT - $this: GET_VAR 'value-parameter a: Long' type=kotlin.Long operator=null - other: GET_VAR 'value-parameter b: Long' type=kotlin.Long operator=null + CALL 'LT0(Int): Boolean' type=kotlin.Boolean origin=LT + arg0: CALL 'compareTo(Long): Int' type=kotlin.Int origin=LT + $this: GET_VAR 'value-parameter a: Long' type=kotlin.Long origin=null + other: GET_VAR 'value-parameter b: Long' type=kotlin.Long origin=null FUN public fun ltest3(a: kotlin.Long, b: kotlin.Long): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='ltest3(Long, Long): Boolean' - CALL 'GTEQ0(Int): Boolean' type=kotlin.Boolean operator=GTEQ - arg0: CALL 'compareTo(Long): Int' type=kotlin.Int operator=GTEQ - $this: GET_VAR 'value-parameter a: Long' type=kotlin.Long operator=null - other: GET_VAR 'value-parameter b: Long' type=kotlin.Long operator=null + CALL 'GTEQ0(Int): Boolean' type=kotlin.Boolean origin=GTEQ + arg0: CALL 'compareTo(Long): Int' type=kotlin.Int origin=GTEQ + $this: GET_VAR 'value-parameter a: Long' type=kotlin.Long origin=null + other: GET_VAR 'value-parameter b: Long' type=kotlin.Long origin=null FUN public fun ltest4(a: kotlin.Long, b: kotlin.Long): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='ltest4(Long, Long): Boolean' - CALL 'LTEQ0(Int): Boolean' type=kotlin.Boolean operator=LTEQ - arg0: CALL 'compareTo(Long): Int' type=kotlin.Int operator=LTEQ - $this: GET_VAR 'value-parameter a: Long' type=kotlin.Long operator=null - other: GET_VAR 'value-parameter b: Long' type=kotlin.Long operator=null + CALL 'LTEQ0(Int): Boolean' type=kotlin.Boolean origin=LTEQ + arg0: CALL 'compareTo(Long): Int' type=kotlin.Int origin=LTEQ + $this: GET_VAR 'value-parameter a: Long' type=kotlin.Long origin=null + other: GET_VAR 'value-parameter b: Long' type=kotlin.Long origin=null FUN public fun ftest1(a: kotlin.Float, b: kotlin.Float): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='ftest1(Float, Float): Boolean' - CALL 'GT0(Int): Boolean' type=kotlin.Boolean operator=GT - arg0: CALL 'compareTo(Float): Int' type=kotlin.Int operator=GT - $this: GET_VAR 'value-parameter a: Float' type=kotlin.Float operator=null - other: GET_VAR 'value-parameter b: Float' type=kotlin.Float operator=null + CALL 'GT0(Int): Boolean' type=kotlin.Boolean origin=GT + arg0: CALL 'compareTo(Float): Int' type=kotlin.Int origin=GT + $this: GET_VAR 'value-parameter a: Float' type=kotlin.Float origin=null + other: GET_VAR 'value-parameter b: Float' type=kotlin.Float origin=null FUN public fun ftest2(a: kotlin.Float, b: kotlin.Float): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='ftest2(Float, Float): Boolean' - CALL 'LT0(Int): Boolean' type=kotlin.Boolean operator=LT - arg0: CALL 'compareTo(Float): Int' type=kotlin.Int operator=LT - $this: GET_VAR 'value-parameter a: Float' type=kotlin.Float operator=null - other: GET_VAR 'value-parameter b: Float' type=kotlin.Float operator=null + CALL 'LT0(Int): Boolean' type=kotlin.Boolean origin=LT + arg0: CALL 'compareTo(Float): Int' type=kotlin.Int origin=LT + $this: GET_VAR 'value-parameter a: Float' type=kotlin.Float origin=null + other: GET_VAR 'value-parameter b: Float' type=kotlin.Float origin=null FUN public fun ftest3(a: kotlin.Float, b: kotlin.Float): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='ftest3(Float, Float): Boolean' - CALL 'GTEQ0(Int): Boolean' type=kotlin.Boolean operator=GTEQ - arg0: CALL 'compareTo(Float): Int' type=kotlin.Int operator=GTEQ - $this: GET_VAR 'value-parameter a: Float' type=kotlin.Float operator=null - other: GET_VAR 'value-parameter b: Float' type=kotlin.Float operator=null + CALL 'GTEQ0(Int): Boolean' type=kotlin.Boolean origin=GTEQ + arg0: CALL 'compareTo(Float): Int' type=kotlin.Int origin=GTEQ + $this: GET_VAR 'value-parameter a: Float' type=kotlin.Float origin=null + other: GET_VAR 'value-parameter b: Float' type=kotlin.Float origin=null FUN public fun ftest4(a: kotlin.Float, b: kotlin.Float): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='ftest4(Float, Float): Boolean' - CALL 'LTEQ0(Int): Boolean' type=kotlin.Boolean operator=LTEQ - arg0: CALL 'compareTo(Float): Int' type=kotlin.Int operator=LTEQ - $this: GET_VAR 'value-parameter a: Float' type=kotlin.Float operator=null - other: GET_VAR 'value-parameter b: Float' type=kotlin.Float operator=null + CALL 'LTEQ0(Int): Boolean' type=kotlin.Boolean origin=LTEQ + arg0: CALL 'compareTo(Float): Int' type=kotlin.Int origin=LTEQ + $this: GET_VAR 'value-parameter a: Float' type=kotlin.Float origin=null + other: GET_VAR 'value-parameter b: Float' type=kotlin.Float origin=null FUN public fun dtest1(a: kotlin.Double, b: kotlin.Double): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='dtest1(Double, Double): Boolean' - CALL 'GT0(Int): Boolean' type=kotlin.Boolean operator=GT - arg0: CALL 'compareTo(Double): Int' type=kotlin.Int operator=GT - $this: GET_VAR 'value-parameter a: Double' type=kotlin.Double operator=null - other: GET_VAR 'value-parameter b: Double' type=kotlin.Double operator=null + CALL 'GT0(Int): Boolean' type=kotlin.Boolean origin=GT + arg0: CALL 'compareTo(Double): Int' type=kotlin.Int origin=GT + $this: GET_VAR 'value-parameter a: Double' type=kotlin.Double origin=null + other: GET_VAR 'value-parameter b: Double' type=kotlin.Double origin=null FUN public fun dtest2(a: kotlin.Double, b: kotlin.Double): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='dtest2(Double, Double): Boolean' - CALL 'LT0(Int): Boolean' type=kotlin.Boolean operator=LT - arg0: CALL 'compareTo(Double): Int' type=kotlin.Int operator=LT - $this: GET_VAR 'value-parameter a: Double' type=kotlin.Double operator=null - other: GET_VAR 'value-parameter b: Double' type=kotlin.Double operator=null + CALL 'LT0(Int): Boolean' type=kotlin.Boolean origin=LT + arg0: CALL 'compareTo(Double): Int' type=kotlin.Int origin=LT + $this: GET_VAR 'value-parameter a: Double' type=kotlin.Double origin=null + other: GET_VAR 'value-parameter b: Double' type=kotlin.Double origin=null FUN public fun dtest3(a: kotlin.Double, b: kotlin.Double): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='dtest3(Double, Double): Boolean' - CALL 'GTEQ0(Int): Boolean' type=kotlin.Boolean operator=GTEQ - arg0: CALL 'compareTo(Double): Int' type=kotlin.Int operator=GTEQ - $this: GET_VAR 'value-parameter a: Double' type=kotlin.Double operator=null - other: GET_VAR 'value-parameter b: Double' type=kotlin.Double operator=null + CALL 'GTEQ0(Int): Boolean' type=kotlin.Boolean origin=GTEQ + arg0: CALL 'compareTo(Double): Int' type=kotlin.Int origin=GTEQ + $this: GET_VAR 'value-parameter a: Double' type=kotlin.Double origin=null + other: GET_VAR 'value-parameter b: Double' type=kotlin.Double origin=null FUN public fun dtest4(a: kotlin.Double, b: kotlin.Double): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='dtest4(Double, Double): Boolean' - CALL 'LTEQ0(Int): Boolean' type=kotlin.Boolean operator=LTEQ - arg0: CALL 'compareTo(Double): Int' type=kotlin.Int operator=LTEQ - $this: GET_VAR 'value-parameter a: Double' type=kotlin.Double operator=null - other: GET_VAR 'value-parameter b: Double' type=kotlin.Double operator=null + CALL 'LTEQ0(Int): Boolean' type=kotlin.Boolean origin=LTEQ + arg0: CALL 'compareTo(Double): Int' type=kotlin.Int origin=LTEQ + $this: GET_VAR 'value-parameter a: Double' type=kotlin.Double origin=null + other: GET_VAR 'value-parameter b: Double' type=kotlin.Double origin=null diff --git a/compiler/testData/ir/irText/expressions/references.txt b/compiler/testData/ir/irText/expressions/references.txt index 006f797b59c..a92ebe87ca6 100644 --- a/compiler/testData/ir/irText/expressions/references.txt +++ b/compiler/testData/ir/irText/expressions/references.txt @@ -6,15 +6,15 @@ FILE /references.kt FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='(): String' - GET_BACKING_FIELD 'ok: String' type=kotlin.String operator=null + GET_BACKING_FIELD 'ok: String' type=kotlin.String origin=null PROPERTY public val ok2: kotlin.String = "OK" FIELD PROPERTY_BACKING_FIELD public val ok2: kotlin.String = "OK" EXPRESSION_BODY - CALL '(): String' type=kotlin.String operator=GET_PROPERTY + CALL '(): String' type=kotlin.String origin=GET_PROPERTY FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='(): String' - GET_BACKING_FIELD 'ok2: String' type=kotlin.String operator=null + GET_BACKING_FIELD 'ok2: String' type=kotlin.String origin=null PROPERTY public val ok3: kotlin.String FUN public fun (): kotlin.String BLOCK_BODY @@ -23,21 +23,21 @@ FILE /references.kt FUN public fun test1(): kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='test1(): String' - CALL '(): String' type=kotlin.String operator=GET_PROPERTY + CALL '(): String' type=kotlin.String origin=GET_PROPERTY FUN public fun test2(x: kotlin.String): kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='test2(String): String' - GET_VAR 'value-parameter x: String' type=kotlin.String operator=null + GET_VAR 'value-parameter x: String' type=kotlin.String origin=null FUN public fun test3(): kotlin.String BLOCK_BODY VAR val x: kotlin.String = "OK" CONST String type=kotlin.String value='OK' RETURN type=kotlin.Nothing from='test3(): String' - GET_VAR 'x: String' type=kotlin.String operator=null + GET_VAR 'x: String' type=kotlin.String origin=null FUN public fun test4(): kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='test4(): String' - CALL '(): String' type=kotlin.String operator=GET_PROPERTY + CALL '(): String' type=kotlin.String origin=GET_PROPERTY PROPERTY public val kotlin.String.okext: kotlin.String FUN public fun kotlin.String.(): kotlin.String BLOCK_BODY @@ -46,5 +46,5 @@ FILE /references.kt FUN public fun kotlin.String.test5(): kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='test5() on String: String' - CALL '() on String: String' type=kotlin.String operator=GET_PROPERTY + CALL '() on String: String' type=kotlin.String origin=GET_PROPERTY $receiver: $RECEIVER of 'test5() on String: String' type=kotlin.String diff --git a/compiler/testData/ir/irText/expressions/reflectionLiterals.txt b/compiler/testData/ir/irText/expressions/reflectionLiterals.txt index 9259260cce6..58a5a63ec6f 100644 --- a/compiler/testData/ir/irText/expressions/reflectionLiterals.txt +++ b/compiler/testData/ir/irText/expressions/reflectionLiterals.txt @@ -15,7 +15,7 @@ FILE /reflectionLiterals.kt FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'qux: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'qux: Int' type=kotlin.Int origin=null PROPERTY public val test1: kotlin.reflect.KClass FIELD PROPERTY_BACKING_FIELD public val test1: kotlin.reflect.KClass EXPRESSION_BODY @@ -23,54 +23,54 @@ FILE /reflectionLiterals.kt FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.reflect.KClass BLOCK_BODY RETURN type=kotlin.Nothing from='(): KClass' - GET_BACKING_FIELD 'test1: KClass' type=kotlin.reflect.KClass operator=null + GET_BACKING_FIELD 'test1: KClass' type=kotlin.reflect.KClass origin=null PROPERTY public val test2: kotlin.reflect.KClass FIELD PROPERTY_BACKING_FIELD public val test2: kotlin.reflect.KClass EXPRESSION_BODY GET_CLASS type=kotlin.reflect.KClass - CALL '(): Int' type=kotlin.Int operator=GET_PROPERTY + CALL '(): Int' type=kotlin.Int origin=GET_PROPERTY FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.reflect.KClass BLOCK_BODY RETURN type=kotlin.Nothing from='(): KClass' - GET_BACKING_FIELD 'test2: KClass' type=kotlin.reflect.KClass operator=null + GET_BACKING_FIELD 'test2: KClass' type=kotlin.reflect.KClass origin=null PROPERTY public val test3: kotlin.reflect.KFunction1 FIELD PROPERTY_BACKING_FIELD public val test3: kotlin.reflect.KFunction1 EXPRESSION_BODY - CALLABLE_REFERENCE 'foo(): Unit' type=kotlin.reflect.KFunction1 operator=null + CALLABLE_REFERENCE 'foo(): Unit' type=kotlin.reflect.KFunction1 origin=null FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.reflect.KFunction1 BLOCK_BODY RETURN type=kotlin.Nothing from='(): KFunction1' - GET_BACKING_FIELD 'test3: KFunction1' type=kotlin.reflect.KFunction1 operator=null + GET_BACKING_FIELD 'test3: KFunction1' type=kotlin.reflect.KFunction1 origin=null PROPERTY public val test4: kotlin.reflect.KFunction0 FIELD PROPERTY_BACKING_FIELD public val test4: kotlin.reflect.KFunction0 EXPRESSION_BODY - CALLABLE_REFERENCE 'constructor A()' type=kotlin.reflect.KFunction0 operator=null + CALLABLE_REFERENCE 'constructor A()' type=kotlin.reflect.KFunction0 origin=null FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.reflect.KFunction0 BLOCK_BODY RETURN type=kotlin.Nothing from='(): KFunction0' - GET_BACKING_FIELD 'test4: KFunction0' type=kotlin.reflect.KFunction0 operator=null + GET_BACKING_FIELD 'test4: KFunction0' type=kotlin.reflect.KFunction0 origin=null PROPERTY public val test5: kotlin.reflect.KFunction0 FIELD PROPERTY_BACKING_FIELD public val test5: kotlin.reflect.KFunction0 EXPRESSION_BODY - CALLABLE_REFERENCE 'foo(): Unit' type=kotlin.reflect.KFunction0 operator=null - $this: CALL 'constructor A()' type=A operator=null + CALLABLE_REFERENCE 'foo(): Unit' type=kotlin.reflect.KFunction0 origin=null + $this: CALL 'constructor A()' type=A origin=null FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.reflect.KFunction0 BLOCK_BODY RETURN type=kotlin.Nothing from='(): KFunction0' - GET_BACKING_FIELD 'test5: KFunction0' type=kotlin.reflect.KFunction0 operator=null + GET_BACKING_FIELD 'test5: KFunction0' type=kotlin.reflect.KFunction0 origin=null PROPERTY public val test6: kotlin.reflect.KFunction0 FIELD PROPERTY_BACKING_FIELD public val test6: kotlin.reflect.KFunction0 EXPRESSION_BODY - CALLABLE_REFERENCE 'bar(): Unit' type=kotlin.reflect.KFunction0 operator=null + CALLABLE_REFERENCE 'bar(): Unit' type=kotlin.reflect.KFunction0 origin=null FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.reflect.KFunction0 BLOCK_BODY RETURN type=kotlin.Nothing from='(): KFunction0' - GET_BACKING_FIELD 'test6: KFunction0' type=kotlin.reflect.KFunction0 operator=null + GET_BACKING_FIELD 'test6: KFunction0' type=kotlin.reflect.KFunction0 origin=null PROPERTY public val test7: kotlin.reflect.KProperty0 FIELD PROPERTY_BACKING_FIELD public val test7: kotlin.reflect.KProperty0 EXPRESSION_BODY - CALLABLE_REFERENCE 'qux: Int' type=kotlin.reflect.KProperty0 operator=null + CALLABLE_REFERENCE 'qux: Int' type=kotlin.reflect.KProperty0 origin=null FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.reflect.KProperty0 BLOCK_BODY RETURN type=kotlin.Nothing from='(): KProperty0' - GET_BACKING_FIELD 'test7: KProperty0' type=kotlin.reflect.KProperty0 operator=null + GET_BACKING_FIELD 'test7: KProperty0' type=kotlin.reflect.KProperty0 origin=null diff --git a/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.txt b/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.txt index 4e7e01651da..c6d6c5c3d34 100644 --- a/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.txt +++ b/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.txt @@ -14,16 +14,16 @@ FILE /safeCallWithIncrementDecrement.kt FUN public operator fun kotlin.Int?.inc(): kotlin.Int? BLOCK_BODY RETURN type=kotlin.Nothing from='inc() on Int?: Int?' - BLOCK type=kotlin.Int? operator=SAFE_CALL + BLOCK type=kotlin.Int? origin=SAFE_CALL VAR IR_TEMPORARY_VARIABLE val tmp0_safe_receiver: kotlin.Int? $RECEIVER of 'inc() on Int?: Int?' type=kotlin.Int? - WHEN type=kotlin.Int? operator=SAFE_CALL - if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQ - arg0: GET_VAR 'tmp0_safe_receiver: Int?' type=kotlin.Int? operator=null + WHEN type=kotlin.Int? origin=SAFE_CALL + if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'tmp0_safe_receiver: Int?' type=kotlin.Int? origin=null arg1: CONST Null type=kotlin.Nothing? value='null' then: CONST Null type=kotlin.Nothing? value='null' - else: CALL 'inc(): Int' type=kotlin.Int operator=null - $this: GET_VAR 'tmp0_safe_receiver: Int?' type=kotlin.Int? operator=null + else: CALL 'inc(): Int' type=kotlin.Int origin=null + $this: GET_VAR 'tmp0_safe_receiver: Int?' type=kotlin.Int? origin=null FUN public operator fun kotlin.Int?.get(index: kotlin.Int): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='get(Int) on Int?: Int' @@ -32,49 +32,49 @@ FILE /safeCallWithIncrementDecrement.kt BLOCK_BODY FUN public fun testProperty(nc: test.C?): kotlin.Unit BLOCK_BODY - BLOCK type=kotlin.Int? operator=SAFE_CALL + BLOCK type=kotlin.Int? origin=SAFE_CALL VAR IR_TEMPORARY_VARIABLE val tmp0_safe_receiver: test.C? - GET_VAR 'value-parameter nc: C?' type=test.C? operator=null - WHEN type=kotlin.Int? operator=SAFE_CALL - if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQ - arg0: GET_VAR 'tmp0_safe_receiver: C?' type=test.C? operator=null + GET_VAR 'value-parameter nc: C?' type=test.C? origin=null + WHEN type=kotlin.Int? origin=SAFE_CALL + if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'tmp0_safe_receiver: C?' type=test.C? origin=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 + else: BLOCK type=kotlin.Int origin=POSTFIX_INCR VAR IR_TEMPORARY_VARIABLE val tmp1_this: test.C? - GET_VAR 'tmp0_safe_receiver: C?' type=test.C? operator=null - BLOCK type=kotlin.Int operator=POSTFIX_INCR + GET_VAR 'tmp0_safe_receiver: C?' type=test.C? origin=null + BLOCK type=kotlin.Int origin=POSTFIX_INCR VAR IR_TEMPORARY_VARIABLE val tmp2: kotlin.Int - CALL '() on C?: Int' type=kotlin.Int operator=POSTFIX_INCR - $this: GET_VAR 'tmp1_this: C?' type=test.C? operator=null - CALL '(Int) on C?: Unit' type=kotlin.Unit operator=POSTFIX_INCR - $this: GET_VAR 'tmp1_this: C?' type=test.C? operator=null - value: CALL 'inc() on Int?: Int?' type=kotlin.Int? operator=POSTFIX_INCR - $receiver: GET_VAR 'tmp2: Int' type=kotlin.Int operator=null - GET_VAR 'tmp2: Int' type=kotlin.Int operator=null + CALL '() on C?: Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'tmp1_this: C?' type=test.C? origin=null + CALL '(Int) on C?: Unit' type=kotlin.Unit origin=POSTFIX_INCR + $this: GET_VAR 'tmp1_this: C?' type=test.C? origin=null + value: CALL 'inc() on Int?: Int?' type=kotlin.Int? origin=POSTFIX_INCR + $receiver: GET_VAR 'tmp2: Int' type=kotlin.Int origin=null + GET_VAR 'tmp2: Int' type=kotlin.Int origin=null FUN public fun testArrayAccess(nc: test.C?): kotlin.Unit BLOCK_BODY - BLOCK type=kotlin.Int operator=POSTFIX_INCR + BLOCK type=kotlin.Int origin=POSTFIX_INCR VAR IR_TEMPORARY_VARIABLE val tmp3_array: kotlin.Int? - BLOCK type=kotlin.Int? operator=SAFE_CALL + BLOCK type=kotlin.Int? origin=SAFE_CALL VAR IR_TEMPORARY_VARIABLE val tmp0_safe_receiver: test.C? - GET_VAR 'value-parameter nc: C?' type=test.C? operator=null - WHEN type=kotlin.Int? operator=SAFE_CALL - if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQ - arg0: GET_VAR 'tmp0_safe_receiver: C?' type=test.C? operator=null + GET_VAR 'value-parameter nc: C?' type=test.C? origin=null + WHEN type=kotlin.Int? origin=SAFE_CALL + if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'tmp0_safe_receiver: C?' type=test.C? origin=null arg1: CONST Null type=kotlin.Nothing? value='null' then: CONST Null type=kotlin.Nothing? value='null' - else: CALL '() on C?: Int' type=kotlin.Int operator=GET_PROPERTY - $this: GET_VAR 'tmp0_safe_receiver: C?' type=test.C? operator=null + else: CALL '() on C?: Int' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR 'tmp0_safe_receiver: C?' type=test.C? origin=null VAR IR_TEMPORARY_VARIABLE val tmp4_index0: kotlin.Int CONST Int type=kotlin.Int value='0' VAR IR_TEMPORARY_VARIABLE val tmp5: kotlin.Int - CALL 'get(Int) on Int?: Int' type=kotlin.Int operator=POSTFIX_INCR - $receiver: GET_VAR 'tmp3_array: Int?' type=kotlin.Int? operator=null - index: GET_VAR 'tmp4_index0: Int' type=kotlin.Int operator=null - CALL 'set(Int, Int) on Int?: Unit' type=kotlin.Unit operator=POSTFIX_INCR - $receiver: GET_VAR 'tmp3_array: Int?' type=kotlin.Int? operator=null - index: GET_VAR 'tmp4_index0: Int' type=kotlin.Int operator=null - value: CALL 'inc(): Int' type=kotlin.Int operator=POSTFIX_INCR - $this: GET_VAR 'tmp5: Int' type=kotlin.Int operator=null - GET_VAR 'tmp5: Int' type=kotlin.Int operator=null + CALL 'get(Int) on Int?: Int' type=kotlin.Int origin=POSTFIX_INCR + $receiver: GET_VAR 'tmp3_array: Int?' type=kotlin.Int? origin=null + index: GET_VAR 'tmp4_index0: Int' type=kotlin.Int origin=null + CALL 'set(Int, Int) on Int?: Unit' type=kotlin.Unit origin=POSTFIX_INCR + $receiver: GET_VAR 'tmp3_array: Int?' type=kotlin.Int? origin=null + index: GET_VAR 'tmp4_index0: Int' type=kotlin.Int origin=null + value: CALL 'inc(): Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'tmp5: Int' type=kotlin.Int origin=null + GET_VAR 'tmp5: Int' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/safeCalls.txt b/compiler/testData/ir/irText/expressions/safeCalls.txt index b2318616844..4185c64d210 100644 --- a/compiler/testData/ir/irText/expressions/safeCalls.txt +++ b/compiler/testData/ir/irText/expressions/safeCalls.txt @@ -7,87 +7,87 @@ FILE /safeCalls.kt PROPERTY public final var value: kotlin.Int FIELD PROPERTY_BACKING_FIELD public final var value: kotlin.Int EXPRESSION_BODY - GET_VAR 'value-parameter value: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER + GET_VAR 'value-parameter value: Int' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER FUN DEFAULT_PROPERTY_ACCESSOR public final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'value: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'value: Int' type=kotlin.Int origin=null receiver: THIS of 'Ref' type=Ref FUN DEFAULT_PROPERTY_ACCESSOR public final fun (: kotlin.Int): kotlin.Unit BLOCK_BODY - SET_BACKING_FIELD 'value: Int' type=kotlin.Unit operator=null + SET_BACKING_FIELD 'value: Int' type=kotlin.Unit origin=null receiver: THIS of 'Ref' type=Ref - value: GET_VAR 'value-parameter : Int' type=kotlin.Int operator=null + value: GET_VAR 'value-parameter : Int' type=kotlin.Int origin=null CLASS INTERFACE IHost FUN public open fun kotlin.String.extLength(): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='extLength() on String: Int' - CALL '(): Int' type=kotlin.Int operator=GET_PROPERTY + CALL '(): Int' type=kotlin.Int origin=GET_PROPERTY $this: $RECEIVER of 'extLength() on String: Int' type=kotlin.String FUN public fun test1(x: kotlin.String?): kotlin.Int? BLOCK_BODY RETURN type=kotlin.Nothing from='test1(String?): Int?' - BLOCK type=kotlin.Int? operator=SAFE_CALL + BLOCK type=kotlin.Int? origin=SAFE_CALL VAR IR_TEMPORARY_VARIABLE val tmp0_safe_receiver: kotlin.String? - GET_VAR 'value-parameter x: String?' type=kotlin.String? operator=null - WHEN type=kotlin.Int? operator=SAFE_CALL - if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQ - arg0: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? operator=null + GET_VAR 'value-parameter x: String?' type=kotlin.String? origin=null + WHEN type=kotlin.Int? origin=SAFE_CALL + if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null arg1: CONST Null type=kotlin.Nothing? value='null' then: CONST Null type=kotlin.Nothing? value='null' - else: CALL '(): Int' type=kotlin.Int operator=GET_PROPERTY - $this: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? operator=null + else: CALL '(): Int' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null FUN public fun test2(x: kotlin.String?): kotlin.Int? BLOCK_BODY RETURN type=kotlin.Nothing from='test2(String?): Int?' - BLOCK type=kotlin.Int? operator=SAFE_CALL + BLOCK type=kotlin.Int? origin=SAFE_CALL VAR IR_TEMPORARY_VARIABLE val tmp0_safe_receiver: kotlin.String? - GET_VAR 'value-parameter x: String?' type=kotlin.String? operator=null - WHEN type=kotlin.Int? operator=SAFE_CALL - if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQ - arg0: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? operator=null + GET_VAR 'value-parameter x: String?' type=kotlin.String? origin=null + WHEN type=kotlin.Int? origin=SAFE_CALL + if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null arg1: CONST Null type=kotlin.Nothing? value='null' then: CONST Null type=kotlin.Nothing? value='null' - else: CALL 'hashCode(): Int' type=kotlin.Int operator=null - $this: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? operator=null + else: CALL 'hashCode(): Int' type=kotlin.Int origin=null + $this: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null FUN public fun test3(x: kotlin.String?, y: kotlin.Any?): kotlin.Boolean? BLOCK_BODY RETURN type=kotlin.Nothing from='test3(String?, Any?): Boolean?' - BLOCK type=kotlin.Boolean? operator=SAFE_CALL + BLOCK type=kotlin.Boolean? origin=SAFE_CALL VAR IR_TEMPORARY_VARIABLE val tmp0_safe_receiver: kotlin.String? - GET_VAR 'value-parameter x: String?' type=kotlin.String? operator=null - WHEN type=kotlin.Boolean? operator=SAFE_CALL - if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQ - arg0: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? operator=null + GET_VAR 'value-parameter x: String?' type=kotlin.String? origin=null + WHEN type=kotlin.Boolean? origin=SAFE_CALL + if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null arg1: CONST Null type=kotlin.Nothing? value='null' then: CONST Null type=kotlin.Nothing? value='null' - else: CALL 'equals(Any?): Boolean' type=kotlin.Boolean operator=null - $this: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? operator=null - other: GET_VAR 'value-parameter y: Any?' type=kotlin.Any? operator=null + else: CALL 'equals(Any?): Boolean' type=kotlin.Boolean origin=null + $this: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null + other: GET_VAR 'value-parameter y: Any?' type=kotlin.Any? origin=null FUN public fun test4(x: Ref?): kotlin.Unit BLOCK_BODY - BLOCK type=kotlin.Unit? operator=SAFE_CALL + BLOCK type=kotlin.Unit? origin=SAFE_CALL VAR IR_TEMPORARY_VARIABLE val tmp0_safe_receiver: Ref? - GET_VAR 'value-parameter x: Ref?' type=Ref? operator=null - WHEN type=kotlin.Unit? operator=SAFE_CALL - if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQ - arg0: GET_VAR 'tmp0_safe_receiver: Ref?' type=Ref? operator=null + GET_VAR 'value-parameter x: Ref?' type=Ref? origin=null + WHEN type=kotlin.Unit? origin=SAFE_CALL + if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'tmp0_safe_receiver: Ref?' type=Ref? origin=null arg1: CONST Null type=kotlin.Nothing? value='null' then: CONST Null type=kotlin.Nothing? value='null' - else: CALL '(Int): Unit' type=kotlin.Unit operator=EQ - $this: GET_VAR 'tmp0_safe_receiver: Ref?' type=Ref? operator=null + else: CALL '(Int): Unit' type=kotlin.Unit origin=EQ + $this: GET_VAR 'tmp0_safe_receiver: Ref?' type=Ref? origin=null : CONST Int type=kotlin.Int value='0' FUN public fun IHost.test5(s: kotlin.String?): kotlin.Int? BLOCK_BODY RETURN type=kotlin.Nothing from='test5(String?) on IHost: Int?' - BLOCK type=kotlin.Int? operator=SAFE_CALL + BLOCK type=kotlin.Int? origin=SAFE_CALL VAR IR_TEMPORARY_VARIABLE val tmp0_safe_receiver: kotlin.String? - GET_VAR 'value-parameter s: String?' type=kotlin.String? operator=null - WHEN type=kotlin.Int? operator=SAFE_CALL - if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQ - arg0: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? operator=null + GET_VAR 'value-parameter s: String?' type=kotlin.String? origin=null + WHEN type=kotlin.Int? origin=SAFE_CALL + if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null arg1: CONST Null type=kotlin.Nothing? value='null' then: CONST Null type=kotlin.Nothing? value='null' - else: CALL 'extLength() on String: Int' type=kotlin.Int operator=null + else: CALL 'extLength() on String: Int' type=kotlin.Int origin=null $this: $RECEIVER of 'test5(String?) on IHost: Int?' type=IHost - $receiver: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? operator=null + $receiver: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null diff --git a/compiler/testData/ir/irText/expressions/setFieldWithImplicitCast.txt b/compiler/testData/ir/irText/expressions/setFieldWithImplicitCast.txt index 34e0a9fcb95..689e7e374e3 100644 --- a/compiler/testData/ir/irText/expressions/setFieldWithImplicitCast.txt +++ b/compiler/testData/ir/irText/expressions/setFieldWithImplicitCast.txt @@ -6,11 +6,11 @@ FILE /Derived.kt INSTANCE_INITIALIZER_CALL classDescriptor='Derived' FUN public final fun setValue(v: kotlin.Any): kotlin.Unit BLOCK_BODY - WHEN type=kotlin.Unit operator=IF - if: TYPE_OP operator=INSTANCEOF typeOperand=kotlin.String - GET_VAR 'value-parameter v: Any' type=kotlin.Any operator=null - then: BLOCK type=kotlin.Unit operator=null - SET_BACKING_FIELD 'value: String!' type=kotlin.Unit operator=EQ + WHEN type=kotlin.Unit origin=IF + if: TYPE_OP origin=INSTANCEOF typeOperand=kotlin.String + GET_VAR 'value-parameter v: Any' type=kotlin.Any origin=null + then: BLOCK type=kotlin.Unit origin=null + SET_BACKING_FIELD 'value: String!' type=kotlin.Unit origin=EQ receiver: THIS of 'Derived' type=Derived - value: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.String! - GET_VAR 'value-parameter v: Any' type=kotlin.Any operator=null + value: TYPE_OP origin=IMPLICIT_CAST typeOperand=kotlin.String! + GET_VAR 'value-parameter v: Any' type=kotlin.Any origin=null diff --git a/compiler/testData/ir/irText/expressions/simpleOperators.txt b/compiler/testData/ir/irText/expressions/simpleOperators.txt index 7d668406d08..463b42bff67 100644 --- a/compiler/testData/ir/irText/expressions/simpleOperators.txt +++ b/compiler/testData/ir/irText/expressions/simpleOperators.txt @@ -2,66 +2,66 @@ FILE /simpleOperators.kt FUN public fun test1(a: kotlin.Int, b: kotlin.Int): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='test1(Int, Int): Int' - CALL 'plus(Int): Int' type=kotlin.Int operator=PLUS - $this: GET_VAR 'value-parameter a: Int' type=kotlin.Int operator=null - other: GET_VAR 'value-parameter b: Int' type=kotlin.Int operator=null + CALL 'plus(Int): Int' type=kotlin.Int origin=PLUS + $this: GET_VAR 'value-parameter a: Int' type=kotlin.Int origin=null + other: GET_VAR 'value-parameter b: Int' type=kotlin.Int origin=null FUN public fun test2(a: kotlin.Int, b: kotlin.Int): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='test2(Int, Int): Int' - CALL 'minus(Int): Int' type=kotlin.Int operator=MINUS - $this: GET_VAR 'value-parameter a: Int' type=kotlin.Int operator=null - other: GET_VAR 'value-parameter b: Int' type=kotlin.Int operator=null + CALL 'minus(Int): Int' type=kotlin.Int origin=MINUS + $this: GET_VAR 'value-parameter a: Int' type=kotlin.Int origin=null + other: GET_VAR 'value-parameter b: Int' type=kotlin.Int origin=null FUN public fun test3(a: kotlin.Int, b: kotlin.Int): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='test3(Int, Int): Int' - CALL 'times(Int): Int' type=kotlin.Int operator=MUL - $this: GET_VAR 'value-parameter a: Int' type=kotlin.Int operator=null - other: GET_VAR 'value-parameter b: Int' type=kotlin.Int operator=null + CALL 'times(Int): Int' type=kotlin.Int origin=MUL + $this: GET_VAR 'value-parameter a: Int' type=kotlin.Int origin=null + other: GET_VAR 'value-parameter b: Int' type=kotlin.Int origin=null FUN public fun test4(a: kotlin.Int, b: kotlin.Int): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='test4(Int, Int): Int' - CALL 'div(Int): Int' type=kotlin.Int operator=DIV - $this: GET_VAR 'value-parameter a: Int' type=kotlin.Int operator=null - other: GET_VAR 'value-parameter b: Int' type=kotlin.Int operator=null + CALL 'div(Int): Int' type=kotlin.Int origin=DIV + $this: GET_VAR 'value-parameter a: Int' type=kotlin.Int origin=null + other: GET_VAR 'value-parameter b: Int' type=kotlin.Int origin=null FUN public fun test5(a: kotlin.Int, b: kotlin.Int): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='test5(Int, Int): Int' - CALL 'mod(Int): Int' type=kotlin.Int operator=PERC - $this: GET_VAR 'value-parameter a: Int' type=kotlin.Int operator=null - other: GET_VAR 'value-parameter b: Int' type=kotlin.Int operator=null + CALL 'mod(Int): Int' type=kotlin.Int origin=PERC + $this: GET_VAR 'value-parameter a: Int' type=kotlin.Int origin=null + other: GET_VAR 'value-parameter b: Int' type=kotlin.Int origin=null FUN public fun test6(a: kotlin.Int, b: kotlin.Int): kotlin.ranges.IntRange BLOCK_BODY RETURN type=kotlin.Nothing from='test6(Int, Int): IntRange' - CALL 'rangeTo(Int): IntRange' type=kotlin.ranges.IntRange operator=RANGE - $this: GET_VAR 'value-parameter a: Int' type=kotlin.Int operator=null - other: GET_VAR 'value-parameter b: Int' type=kotlin.Int operator=null + CALL 'rangeTo(Int): IntRange' type=kotlin.ranges.IntRange origin=RANGE + $this: GET_VAR 'value-parameter a: Int' type=kotlin.Int origin=null + other: GET_VAR 'value-parameter b: Int' type=kotlin.Int origin=null FUN public fun test1x(a: kotlin.Int, b: kotlin.Int): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='test1x(Int, Int): Int' - CALL 'plus(Int): Int' type=kotlin.Int operator=null - $this: GET_VAR 'value-parameter a: Int' type=kotlin.Int operator=null - other: GET_VAR 'value-parameter b: Int' type=kotlin.Int operator=null + CALL 'plus(Int): Int' type=kotlin.Int origin=null + $this: GET_VAR 'value-parameter a: Int' type=kotlin.Int origin=null + other: GET_VAR 'value-parameter b: Int' type=kotlin.Int origin=null FUN public fun test2x(a: kotlin.Int, b: kotlin.Int): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='test2x(Int, Int): Int' - CALL 'minus(Int): Int' type=kotlin.Int operator=null - $this: GET_VAR 'value-parameter a: Int' type=kotlin.Int operator=null - other: GET_VAR 'value-parameter b: Int' type=kotlin.Int operator=null + CALL 'minus(Int): Int' type=kotlin.Int origin=null + $this: GET_VAR 'value-parameter a: Int' type=kotlin.Int origin=null + other: GET_VAR 'value-parameter b: Int' type=kotlin.Int origin=null FUN public fun test3x(a: kotlin.Int, b: kotlin.Int): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='test3x(Int, Int): Int' - CALL 'times(Int): Int' type=kotlin.Int operator=null - $this: GET_VAR 'value-parameter a: Int' type=kotlin.Int operator=null - other: GET_VAR 'value-parameter b: Int' type=kotlin.Int operator=null + CALL 'times(Int): Int' type=kotlin.Int origin=null + $this: GET_VAR 'value-parameter a: Int' type=kotlin.Int origin=null + other: GET_VAR 'value-parameter b: Int' type=kotlin.Int origin=null FUN public fun test4x(a: kotlin.Int, b: kotlin.Int): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='test4x(Int, Int): Int' - CALL 'div(Int): Int' type=kotlin.Int operator=null - $this: GET_VAR 'value-parameter a: Int' type=kotlin.Int operator=null - other: GET_VAR 'value-parameter b: Int' type=kotlin.Int operator=null + CALL 'div(Int): Int' type=kotlin.Int origin=null + $this: GET_VAR 'value-parameter a: Int' type=kotlin.Int origin=null + other: GET_VAR 'value-parameter b: Int' type=kotlin.Int origin=null FUN public fun test5x(a: kotlin.Int, b: kotlin.Int): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='test5x(Int, Int): Int' - CALL 'mod(Int): Int' type=kotlin.Int operator=null - $this: GET_VAR 'value-parameter a: Int' type=kotlin.Int operator=null - other: GET_VAR 'value-parameter b: Int' type=kotlin.Int operator=null + CALL 'mod(Int): Int' type=kotlin.Int origin=null + $this: GET_VAR 'value-parameter a: Int' type=kotlin.Int origin=null + other: GET_VAR 'value-parameter b: Int' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/simpleUnaryOperators.txt b/compiler/testData/ir/irText/expressions/simpleUnaryOperators.txt index 0ed83cfdb13..e09f3a3a94d 100644 --- a/compiler/testData/ir/irText/expressions/simpleUnaryOperators.txt +++ b/compiler/testData/ir/irText/expressions/simpleUnaryOperators.txt @@ -2,8 +2,8 @@ FILE /simpleUnaryOperators.kt FUN public fun test1(x: kotlin.Int): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='test1(Int): Int' - CALL 'unaryMinus(): Int' type=kotlin.Int operator=UMINUS - $this: GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=null + CALL 'unaryMinus(): Int' type=kotlin.Int origin=UMINUS + $this: GET_VAR 'value-parameter x: Int' type=kotlin.Int origin=null FUN public fun test2(): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='test2(): Int' @@ -11,8 +11,8 @@ FILE /simpleUnaryOperators.kt FUN public fun test3(x: kotlin.Int): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='test3(Int): Int' - CALL 'unaryPlus(): Int' type=kotlin.Int operator=UPLUS - $this: GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=null + CALL 'unaryPlus(): Int' type=kotlin.Int origin=UPLUS + $this: GET_VAR 'value-parameter x: Int' type=kotlin.Int origin=null FUN public fun test4(): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='test4(): Int' @@ -20,8 +20,8 @@ FILE /simpleUnaryOperators.kt FUN public fun test5(x: kotlin.Boolean): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='test5(Boolean): Boolean' - CALL 'not(): Boolean' type=kotlin.Boolean operator=EXCL - $this: GET_VAR 'value-parameter x: Boolean' type=kotlin.Boolean operator=null + CALL 'not(): Boolean' type=kotlin.Boolean origin=EXCL + $this: GET_VAR 'value-parameter x: Boolean' type=kotlin.Boolean origin=null FUN public fun test6(): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='test6(): Boolean' diff --git a/compiler/testData/ir/irText/expressions/smartCasts.txt b/compiler/testData/ir/irText/expressions/smartCasts.txt index 0c10d305a38..03d7a66d927 100644 --- a/compiler/testData/ir/irText/expressions/smartCasts.txt +++ b/compiler/testData/ir/irText/expressions/smartCasts.txt @@ -6,50 +6,50 @@ FILE /smartCasts.kt FUN public fun overloaded(s: kotlin.String): kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='overloaded(String): String' - GET_VAR 'value-parameter s: String' type=kotlin.String operator=null + GET_VAR 'value-parameter s: String' type=kotlin.String origin=null FUN public fun overloaded(x: kotlin.Any): kotlin.Any BLOCK_BODY RETURN type=kotlin.Nothing from='overloaded(Any): Any' - GET_VAR 'value-parameter x: Any' type=kotlin.Any operator=null + GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null FUN public fun test1(x: kotlin.Any): kotlin.Unit BLOCK_BODY - WHEN type=kotlin.Unit operator=IF - if: TYPE_OP operator=NOT_INSTANCEOF typeOperand=kotlin.String - GET_VAR 'value-parameter x: Any' type=kotlin.Any operator=null + WHEN type=kotlin.Unit origin=IF + if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=kotlin.String + GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null then: RETURN type=kotlin.Nothing from='test1(Any): Unit' - CALL 'println(Int): Unit' type=kotlin.Unit operator=null - message: CALL '(): Int' type=kotlin.Int operator=GET_PROPERTY - $this: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.String - GET_VAR 'value-parameter x: Any' type=kotlin.Any operator=null - CALL 'expectsString(String): Unit' type=kotlin.Unit operator=null - s: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.String - GET_VAR 'value-parameter x: Any' type=kotlin.Any operator=null - CALL 'expectsInt(Int): Unit' type=kotlin.Unit operator=null - i: CALL '(): Int' type=kotlin.Int operator=GET_PROPERTY - $this: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.String - GET_VAR 'value-parameter x: Any' type=kotlin.Any operator=null - CALL 'expectsString(String): Unit' type=kotlin.Unit operator=null - s: CALL 'overloaded(String): String' type=kotlin.String operator=null - s: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.String - GET_VAR 'value-parameter x: Any' type=kotlin.Any operator=null + CALL 'println(Int): Unit' type=kotlin.Unit origin=null + message: CALL '(): Int' type=kotlin.Int origin=GET_PROPERTY + $this: TYPE_OP origin=IMPLICIT_CAST typeOperand=kotlin.String + GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null + CALL 'expectsString(String): Unit' type=kotlin.Unit origin=null + s: TYPE_OP origin=IMPLICIT_CAST typeOperand=kotlin.String + GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null + CALL 'expectsInt(Int): Unit' type=kotlin.Unit origin=null + i: CALL '(): Int' type=kotlin.Int origin=GET_PROPERTY + $this: TYPE_OP origin=IMPLICIT_CAST typeOperand=kotlin.String + GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null + CALL 'expectsString(String): Unit' type=kotlin.Unit origin=null + s: CALL 'overloaded(String): String' type=kotlin.String origin=null + s: TYPE_OP origin=IMPLICIT_CAST typeOperand=kotlin.String + GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null FUN public fun test2(x: kotlin.Any): kotlin.String BLOCK_BODY - WHEN type=kotlin.Unit operator=IF - if: TYPE_OP operator=NOT_INSTANCEOF typeOperand=kotlin.String - GET_VAR 'value-parameter x: Any' type=kotlin.Any operator=null + WHEN type=kotlin.Unit origin=IF + if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=kotlin.String + GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null then: RETURN type=kotlin.Nothing from='test2(Any): String' CONST String type=kotlin.String value='' RETURN type=kotlin.Nothing from='test2(Any): String' - CALL 'overloaded(String): String' type=kotlin.String operator=null - s: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.String - GET_VAR 'value-parameter x: Any' type=kotlin.Any operator=null + CALL 'overloaded(String): String' type=kotlin.String origin=null + s: TYPE_OP origin=IMPLICIT_CAST typeOperand=kotlin.String + GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null FUN public fun test3(x: kotlin.Any): kotlin.String BLOCK_BODY - WHEN type=kotlin.Unit operator=IF - if: TYPE_OP operator=NOT_INSTANCEOF typeOperand=kotlin.String - GET_VAR 'value-parameter x: Any' type=kotlin.Any operator=null + WHEN type=kotlin.Unit origin=IF + if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=kotlin.String + GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null then: RETURN type=kotlin.Nothing from='test3(Any): String' CONST String type=kotlin.String value='' RETURN type=kotlin.Nothing from='test3(Any): String' - TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.String - GET_VAR 'value-parameter x: Any' type=kotlin.Any operator=null + TYPE_OP origin=IMPLICIT_CAST typeOperand=kotlin.String + GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null diff --git a/compiler/testData/ir/irText/expressions/smartCastsWithDestructuring.txt b/compiler/testData/ir/irText/expressions/smartCastsWithDestructuring.txt index 78e69a7adfe..26226823a7b 100644 --- a/compiler/testData/ir/irText/expressions/smartCastsWithDestructuring.txt +++ b/compiler/testData/ir/irText/expressions/smartCastsWithDestructuring.txt @@ -11,17 +11,17 @@ FILE /smartCastsWithDestructuring.kt CONST String type=kotlin.String value='' FUN public fun test(x: I1): kotlin.Unit BLOCK_BODY - WHEN type=kotlin.Unit operator=IF - if: TYPE_OP operator=NOT_INSTANCEOF typeOperand=I2 - GET_VAR 'value-parameter x: I1' type=I1 operator=null + WHEN type=kotlin.Unit origin=IF + if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=I2 + GET_VAR 'value-parameter x: I1' type=I1 origin=null then: RETURN type=kotlin.Nothing from='test(I1): Unit' - COMPOSITE type=kotlin.Unit operator=DESTRUCTURING_DECLARATION + COMPOSITE type=kotlin.Unit origin=DESTRUCTURING_DECLARATION VAR IR_TEMPORARY_VARIABLE val tmp0_container: I1 - GET_VAR 'value-parameter x: I1' type=I1 operator=null + GET_VAR 'value-parameter x: I1' type=I1 origin=null VAR val c1: kotlin.Int - CALL 'component1() on I1: Int' type=kotlin.Int operator=COMPONENT_N(index=1) - $receiver: GET_VAR 'tmp0_container: I1' type=I1 operator=null + CALL 'component1() on I1: Int' type=kotlin.Int origin=COMPONENT_N(index=1) + $receiver: GET_VAR 'tmp0_container: I1' type=I1 origin=null VAR val c2: kotlin.String - CALL 'component2() on I2: String' type=kotlin.String operator=COMPONENT_N(index=2) - $receiver: TYPE_OP operator=IMPLICIT_CAST typeOperand=I2 - GET_VAR 'tmp0_container: I1' type=I1 operator=null + CALL 'component2() on I2: String' type=kotlin.String origin=COMPONENT_N(index=2) + $receiver: TYPE_OP origin=IMPLICIT_CAST typeOperand=I2 + GET_VAR 'tmp0_container: I1' type=I1 origin=null diff --git a/compiler/testData/ir/irText/expressions/smoke.txt b/compiler/testData/ir/irText/expressions/smoke.txt index de769d72617..3f99793259d 100644 --- a/compiler/testData/ir/irText/expressions/smoke.txt +++ b/compiler/testData/ir/irText/expressions/smoke.txt @@ -10,7 +10,7 @@ FILE /smoke.kt FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'testSimpleVal: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'testSimpleVal: Int' type=kotlin.Int origin=null PROPERTY public val testValWithGetter: kotlin.Int FUN public fun (): kotlin.Int BLOCK_BODY @@ -23,11 +23,11 @@ FILE /smoke.kt FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'testSimpleVar: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'testSimpleVar: Int' type=kotlin.Int origin=null FUN DEFAULT_PROPERTY_ACCESSOR public fun (: kotlin.Int): kotlin.Unit BLOCK_BODY - SET_BACKING_FIELD 'testSimpleVar: Int' type=kotlin.Unit operator=null - value: GET_VAR 'value-parameter : Int' type=kotlin.Int operator=null + SET_BACKING_FIELD 'testSimpleVar: Int' type=kotlin.Unit origin=null + value: GET_VAR 'value-parameter : Int' type=kotlin.Int origin=null PROPERTY public var testVarWithAccessors: kotlin.Int FUN public fun (): kotlin.Int BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/stringComparisons.txt b/compiler/testData/ir/irText/expressions/stringComparisons.txt index a8e41b6f241..d88a60a060b 100644 --- a/compiler/testData/ir/irText/expressions/stringComparisons.txt +++ b/compiler/testData/ir/irText/expressions/stringComparisons.txt @@ -2,28 +2,28 @@ FILE /stringComparisons.kt FUN public fun test1(a: kotlin.String, b: kotlin.String): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='test1(String, String): Boolean' - CALL 'GT0(Int): Boolean' type=kotlin.Boolean operator=GT - arg0: CALL 'compareTo(String): Int' type=kotlin.Int operator=GT - $this: GET_VAR 'value-parameter a: String' type=kotlin.String operator=null - other: GET_VAR 'value-parameter b: String' type=kotlin.String operator=null + CALL 'GT0(Int): Boolean' type=kotlin.Boolean origin=GT + arg0: CALL 'compareTo(String): Int' type=kotlin.Int origin=GT + $this: GET_VAR 'value-parameter a: String' type=kotlin.String origin=null + other: GET_VAR 'value-parameter b: String' type=kotlin.String origin=null FUN public fun test2(a: kotlin.String, b: kotlin.String): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='test2(String, String): Boolean' - CALL 'LT0(Int): Boolean' type=kotlin.Boolean operator=LT - arg0: CALL 'compareTo(String): Int' type=kotlin.Int operator=LT - $this: GET_VAR 'value-parameter a: String' type=kotlin.String operator=null - other: GET_VAR 'value-parameter b: String' type=kotlin.String operator=null + CALL 'LT0(Int): Boolean' type=kotlin.Boolean origin=LT + arg0: CALL 'compareTo(String): Int' type=kotlin.Int origin=LT + $this: GET_VAR 'value-parameter a: String' type=kotlin.String origin=null + other: GET_VAR 'value-parameter b: String' type=kotlin.String origin=null FUN public fun test3(a: kotlin.String, b: kotlin.String): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='test3(String, String): Boolean' - CALL 'GTEQ0(Int): Boolean' type=kotlin.Boolean operator=GTEQ - arg0: CALL 'compareTo(String): Int' type=kotlin.Int operator=GTEQ - $this: GET_VAR 'value-parameter a: String' type=kotlin.String operator=null - other: GET_VAR 'value-parameter b: String' type=kotlin.String operator=null + CALL 'GTEQ0(Int): Boolean' type=kotlin.Boolean origin=GTEQ + arg0: CALL 'compareTo(String): Int' type=kotlin.Int origin=GTEQ + $this: GET_VAR 'value-parameter a: String' type=kotlin.String origin=null + other: GET_VAR 'value-parameter b: String' type=kotlin.String origin=null FUN public fun test4(a: kotlin.String, b: kotlin.String): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='test4(String, String): Boolean' - CALL 'LTEQ0(Int): Boolean' type=kotlin.Boolean operator=LTEQ - arg0: CALL 'compareTo(String): Int' type=kotlin.Int operator=LTEQ - $this: GET_VAR 'value-parameter a: String' type=kotlin.String operator=null - other: GET_VAR 'value-parameter b: String' type=kotlin.String operator=null + CALL 'LTEQ0(Int): Boolean' type=kotlin.Boolean origin=LTEQ + arg0: CALL 'compareTo(String): Int' type=kotlin.Int origin=LTEQ + $this: GET_VAR 'value-parameter a: String' type=kotlin.String origin=null + other: GET_VAR 'value-parameter b: String' type=kotlin.String origin=null diff --git a/compiler/testData/ir/irText/expressions/stringPlus.txt b/compiler/testData/ir/irText/expressions/stringPlus.txt index 2f6964cc5da..7257d57ee39 100644 --- a/compiler/testData/ir/irText/expressions/stringPlus.txt +++ b/compiler/testData/ir/irText/expressions/stringPlus.txt @@ -2,26 +2,26 @@ FILE /stringPlus.kt FUN public fun test1(a: kotlin.String, b: kotlin.Any): kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='test1(String, Any): String' - CALL 'plus(Any?): String' type=kotlin.String operator=PLUS - $this: GET_VAR 'value-parameter a: String' type=kotlin.String operator=null - other: GET_VAR 'value-parameter b: Any' type=kotlin.Any operator=null + CALL 'plus(Any?): String' type=kotlin.String origin=PLUS + $this: GET_VAR 'value-parameter a: String' type=kotlin.String origin=null + other: GET_VAR 'value-parameter b: Any' type=kotlin.Any origin=null FUN public fun test2(a: kotlin.String, b: kotlin.Int): kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='test2(String, Int): String' - CALL 'plus(Any?): String' type=kotlin.String operator=PLUS - $this: CALL 'plus(Any?): String' type=kotlin.String operator=PLUS - $this: GET_VAR 'value-parameter a: String' type=kotlin.String operator=null + CALL 'plus(Any?): String' type=kotlin.String origin=PLUS + $this: CALL 'plus(Any?): String' type=kotlin.String origin=PLUS + $this: GET_VAR 'value-parameter a: String' type=kotlin.String origin=null other: CONST String type=kotlin.String value='+' - other: GET_VAR 'value-parameter b: Int' type=kotlin.Int operator=null + other: GET_VAR 'value-parameter b: Int' type=kotlin.Int origin=null FUN public fun test3(a: kotlin.String, b: kotlin.Int): kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='test3(String, Int): String' - CALL 'plus(Any?): String' type=kotlin.String operator=PLUS - $this: CALL 'plus(Any?): String' type=kotlin.String operator=PLUS - $this: CALL 'plus(Any?): String' type=kotlin.String operator=PLUS - $this: GET_VAR 'value-parameter a: String' type=kotlin.String operator=null + CALL 'plus(Any?): String' type=kotlin.String origin=PLUS + $this: CALL 'plus(Any?): String' type=kotlin.String origin=PLUS + $this: CALL 'plus(Any?): String' type=kotlin.String origin=PLUS + $this: GET_VAR 'value-parameter a: String' type=kotlin.String origin=null other: CONST String type=kotlin.String value='+' - other: CALL 'plus(Int): Int' type=kotlin.Int operator=PLUS - $this: GET_VAR 'value-parameter b: Int' type=kotlin.Int operator=null + other: CALL 'plus(Int): Int' type=kotlin.Int origin=PLUS + $this: GET_VAR 'value-parameter b: Int' type=kotlin.Int origin=null other: CONST Int type=kotlin.Int value='1' - other: GET_VAR 'value-parameter a: String' type=kotlin.String operator=null + other: GET_VAR 'value-parameter a: String' type=kotlin.String origin=null diff --git a/compiler/testData/ir/irText/expressions/stringTemplates.txt b/compiler/testData/ir/irText/expressions/stringTemplates.txt index e413207e38e..462259812da 100644 --- a/compiler/testData/ir/irText/expressions/stringTemplates.txt +++ b/compiler/testData/ir/irText/expressions/stringTemplates.txt @@ -10,7 +10,7 @@ FILE /stringTemplates.kt FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='(): String' - GET_BACKING_FIELD 'test1: String' type=kotlin.String operator=null + GET_BACKING_FIELD 'test1: String' type=kotlin.String origin=null PROPERTY public val test2: kotlin.String = "abc" FIELD PROPERTY_BACKING_FIELD public val test2: kotlin.String = "abc" EXPRESSION_BODY @@ -18,7 +18,7 @@ FILE /stringTemplates.kt FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='(): String' - GET_BACKING_FIELD 'test2: String' type=kotlin.String operator=null + GET_BACKING_FIELD 'test2: String' type=kotlin.String origin=null PROPERTY public val test3: kotlin.String = "" FIELD PROPERTY_BACKING_FIELD public val test3: kotlin.String = "" EXPRESSION_BODY @@ -26,7 +26,7 @@ FILE /stringTemplates.kt FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='(): String' - GET_BACKING_FIELD 'test3: String' type=kotlin.String operator=null + GET_BACKING_FIELD 'test3: String' type=kotlin.String origin=null PROPERTY public val test4: kotlin.String = "abc" FIELD PROPERTY_BACKING_FIELD public val test4: kotlin.String = "abc" EXPRESSION_BODY @@ -34,7 +34,7 @@ FILE /stringTemplates.kt FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='(): String' - GET_BACKING_FIELD 'test4: String' type=kotlin.String operator=null + GET_BACKING_FIELD 'test4: String' type=kotlin.String origin=null PROPERTY public val test5: kotlin.String = " abc " @@ -51,15 +51,15 @@ abc FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='(): String' - GET_BACKING_FIELD 'test5: String' type=kotlin.String operator=null + GET_BACKING_FIELD 'test5: String' type=kotlin.String origin=null PROPERTY public val test6: kotlin.String FIELD PROPERTY_BACKING_FIELD public val test6: kotlin.String EXPRESSION_BODY STRING_CONCATENATION type=kotlin.String - CALL '(): String' type=kotlin.String operator=GET_PROPERTY + CALL '(): String' type=kotlin.String origin=GET_PROPERTY CONST String type=kotlin.String value=' ' - CALL 'foo(): String' type=kotlin.String operator=null + CALL 'foo(): String' type=kotlin.String origin=null FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='(): String' - GET_BACKING_FIELD 'test6: String' type=kotlin.String operator=null + GET_BACKING_FIELD 'test6: String' type=kotlin.String origin=null diff --git a/compiler/testData/ir/irText/expressions/throw.txt b/compiler/testData/ir/irText/expressions/throw.txt index a87f90c2063..dde5f8fc54d 100644 --- a/compiler/testData/ir/irText/expressions/throw.txt +++ b/compiler/testData/ir/irText/expressions/throw.txt @@ -2,13 +2,13 @@ FILE /throw.kt FUN public fun test1(): kotlin.Unit BLOCK_BODY THROW type=kotlin.Nothing - CALL 'constructor Throwable()' type=kotlin.Throwable operator=null + CALL 'constructor Throwable()' type=kotlin.Throwable origin=null FUN public fun testImplicitCast(a: kotlin.Any): kotlin.Unit BLOCK_BODY - WHEN type=kotlin.Unit operator=IF - if: TYPE_OP operator=INSTANCEOF typeOperand=kotlin.Throwable - GET_VAR 'value-parameter a: Any' type=kotlin.Any operator=null - then: BLOCK type=kotlin.Nothing operator=null + WHEN type=kotlin.Unit origin=IF + if: TYPE_OP origin=INSTANCEOF typeOperand=kotlin.Throwable + GET_VAR 'value-parameter a: Any' type=kotlin.Any origin=null + then: BLOCK type=kotlin.Nothing origin=null THROW type=kotlin.Nothing - TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.Throwable - GET_VAR 'value-parameter a: Any' type=kotlin.Any operator=null + TYPE_OP origin=IMPLICIT_CAST typeOperand=kotlin.Throwable + GET_VAR 'value-parameter a: Any' type=kotlin.Any origin=null diff --git a/compiler/testData/ir/irText/expressions/tryCatch.txt b/compiler/testData/ir/irText/expressions/tryCatch.txt index fe7ba27acf0..32c2448c8dc 100644 --- a/compiler/testData/ir/irText/expressions/tryCatch.txt +++ b/compiler/testData/ir/irText/expressions/tryCatch.txt @@ -2,21 +2,21 @@ FILE /tryCatch.kt FUN public fun test1(): kotlin.Unit BLOCK_BODY TRY_CATCH type=kotlin.Unit - try: BLOCK type=kotlin.Unit operator=null - CALL 'println(): Unit' type=kotlin.Unit operator=null - catch e: BLOCK type=kotlin.Unit operator=null - CALL 'println(): Unit' type=kotlin.Unit operator=null - finally: BLOCK type=kotlin.Unit operator=null - CALL 'println(): Unit' type=kotlin.Unit operator=null + try: BLOCK type=kotlin.Unit origin=null + CALL 'println(): Unit' type=kotlin.Unit origin=null + catch e: BLOCK type=kotlin.Unit origin=null + CALL 'println(): Unit' type=kotlin.Unit origin=null + finally: BLOCK type=kotlin.Unit origin=null + CALL 'println(): Unit' type=kotlin.Unit origin=null FUN public fun test2(): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='test2(): Int' TRY_CATCH type=kotlin.Int - try: BLOCK type=kotlin.Int operator=null - CALL 'println(): Unit' type=kotlin.Unit operator=null + try: BLOCK type=kotlin.Int origin=null + CALL 'println(): Unit' type=kotlin.Unit origin=null CONST Int type=kotlin.Int value='42' - catch e: BLOCK type=kotlin.Int operator=null - CALL 'println(): Unit' type=kotlin.Unit operator=null + catch e: BLOCK type=kotlin.Int origin=null + CALL 'println(): Unit' type=kotlin.Unit origin=null CONST Int type=kotlin.Int value='24' - finally: BLOCK type=kotlin.Unit operator=null - CALL 'println(): Unit' type=kotlin.Unit operator=null + finally: BLOCK type=kotlin.Unit origin=null + CALL 'println(): Unit' type=kotlin.Unit origin=null diff --git a/compiler/testData/ir/irText/expressions/tryCatchWithImplicitCast.txt b/compiler/testData/ir/irText/expressions/tryCatchWithImplicitCast.txt index f927ba81741..636cb45ad71 100644 --- a/compiler/testData/ir/irText/expressions/tryCatchWithImplicitCast.txt +++ b/compiler/testData/ir/irText/expressions/tryCatchWithImplicitCast.txt @@ -1,14 +1,14 @@ FILE /tryCatchWithImplicitCast.kt FUN public fun testImplicitCast(a: kotlin.Any): kotlin.Unit BLOCK_BODY - WHEN type=kotlin.Unit operator=IF - if: TYPE_OP operator=NOT_INSTANCEOF typeOperand=kotlin.String - GET_VAR 'value-parameter a: Any' type=kotlin.Any operator=null + WHEN type=kotlin.Unit origin=IF + if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=kotlin.String + GET_VAR 'value-parameter a: Any' type=kotlin.Any origin=null then: RETURN type=kotlin.Nothing from='testImplicitCast(Any): Unit' VAR val t: kotlin.String TRY_CATCH type=kotlin.String - try: BLOCK type=kotlin.String operator=null - TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.String - GET_VAR 'value-parameter a: Any' type=kotlin.Any operator=null - catch e: BLOCK type=kotlin.String operator=null + try: BLOCK type=kotlin.String origin=null + TYPE_OP origin=IMPLICIT_CAST typeOperand=kotlin.String + GET_VAR 'value-parameter a: Any' type=kotlin.Any origin=null + catch e: BLOCK type=kotlin.String origin=null CONST String type=kotlin.String value='' diff --git a/compiler/testData/ir/irText/expressions/typeOperators.txt b/compiler/testData/ir/irText/expressions/typeOperators.txt index f70ab1cbd92..5a9e05e25c7 100644 --- a/compiler/testData/ir/irText/expressions/typeOperators.txt +++ b/compiler/testData/ir/irText/expressions/typeOperators.txt @@ -3,20 +3,20 @@ FILE /typeOperators.kt FUN public fun test1(x: kotlin.Any): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='test1(Any): Boolean' - TYPE_OP operator=INSTANCEOF typeOperand=IThing - GET_VAR 'value-parameter x: Any' type=kotlin.Any operator=null + TYPE_OP origin=INSTANCEOF typeOperand=IThing + GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null FUN public fun test2(x: kotlin.Any): kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='test2(Any): Boolean' - TYPE_OP operator=NOT_INSTANCEOF typeOperand=IThing - GET_VAR 'value-parameter x: Any' type=kotlin.Any operator=null + TYPE_OP origin=NOT_INSTANCEOF typeOperand=IThing + GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null FUN public fun test3(x: kotlin.Any): IThing BLOCK_BODY RETURN type=kotlin.Nothing from='test3(Any): IThing' - TYPE_OP operator=CAST typeOperand=IThing - GET_VAR 'value-parameter x: Any' type=kotlin.Any operator=null + TYPE_OP origin=CAST typeOperand=IThing + GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null FUN public fun test4(x: kotlin.Any): IThing? BLOCK_BODY RETURN type=kotlin.Nothing from='test4(Any): IThing?' - TYPE_OP operator=SAFE_CAST typeOperand=IThing - GET_VAR 'value-parameter x: Any' type=kotlin.Any operator=null + TYPE_OP origin=SAFE_CAST typeOperand=IThing + GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null diff --git a/compiler/testData/ir/irText/expressions/values.txt b/compiler/testData/ir/irText/expressions/values.txt index 5ceb170f857..4030be3aeee 100644 --- a/compiler/testData/ir/irText/expressions/values.txt +++ b/compiler/testData/ir/irText/expressions/values.txt @@ -22,7 +22,7 @@ FILE /values.kt FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' - GET_BACKING_FIELD 'a: Int' type=kotlin.Int operator=null + GET_BACKING_FIELD 'a: Int' type=kotlin.Int origin=null CLASS CLASS Z CONSTRUCTOR public constructor Z() BLOCK_BODY @@ -44,7 +44,7 @@ FILE /values.kt FUN public fun test3(): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='test3(): Int' - CALL '(): Int' type=kotlin.Int operator=GET_PROPERTY + CALL '(): Int' type=kotlin.Int origin=GET_PROPERTY FUN public fun test4(): Z.Companion BLOCK_BODY RETURN type=kotlin.Nothing from='test4(): Z.Companion' diff --git a/compiler/testData/ir/irText/expressions/vararg.txt b/compiler/testData/ir/irText/expressions/vararg.txt index d1bd130ed98..8550a5d1d7c 100644 --- a/compiler/testData/ir/irText/expressions/vararg.txt +++ b/compiler/testData/ir/irText/expressions/vararg.txt @@ -2,15 +2,15 @@ FILE /vararg.kt PROPERTY public val test1: kotlin.Array FIELD PROPERTY_BACKING_FIELD public val test1: kotlin.Array EXPRESSION_BODY - CALL 'arrayOf(vararg String): Array' type=kotlin.Array operator=null + CALL 'arrayOf(vararg String): Array' type=kotlin.Array origin=null FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.Array BLOCK_BODY RETURN type=kotlin.Nothing from='(): Array' - GET_BACKING_FIELD 'test1: Array' type=kotlin.Array operator=null + GET_BACKING_FIELD 'test1: Array' type=kotlin.Array origin=null PROPERTY public val test2: kotlin.Array FIELD PROPERTY_BACKING_FIELD public val test2: kotlin.Array EXPRESSION_BODY - CALL 'arrayOf(vararg String): Array' type=kotlin.Array operator=null + CALL 'arrayOf(vararg String): Array' type=kotlin.Array origin=null elements: VARARG type=Array varargElementType=String CONST String type=kotlin.String value='1' CONST String type=kotlin.String value='2' @@ -18,19 +18,19 @@ FILE /vararg.kt FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.Array BLOCK_BODY RETURN type=kotlin.Nothing from='(): Array' - GET_BACKING_FIELD 'test2: Array' type=kotlin.Array operator=null + GET_BACKING_FIELD 'test2: Array' type=kotlin.Array origin=null PROPERTY public val test3: kotlin.Array FIELD PROPERTY_BACKING_FIELD public val test3: kotlin.Array EXPRESSION_BODY - CALL 'arrayOf(vararg String): Array' type=kotlin.Array operator=null + CALL 'arrayOf(vararg String): Array' type=kotlin.Array origin=null elements: VARARG type=Array varargElementType=String CONST String type=kotlin.String value='0' SPREAD_ELEMENT - CALL '(): Array' type=kotlin.Array operator=GET_PROPERTY + CALL '(): Array' type=kotlin.Array origin=GET_PROPERTY SPREAD_ELEMENT - CALL '(): Array' type=kotlin.Array operator=GET_PROPERTY + CALL '(): Array' type=kotlin.Array origin=GET_PROPERTY CONST String type=kotlin.String value='4' FUN DEFAULT_PROPERTY_ACCESSOR public fun (): kotlin.Array BLOCK_BODY RETURN type=kotlin.Nothing from='(): Array' - GET_BACKING_FIELD 'test3: Array' type=kotlin.Array operator=null + GET_BACKING_FIELD 'test3: Array' type=kotlin.Array origin=null diff --git a/compiler/testData/ir/irText/expressions/varargWithImplicitCast.txt b/compiler/testData/ir/irText/expressions/varargWithImplicitCast.txt index 4b9adb17a22..4678452bccd 100644 --- a/compiler/testData/ir/irText/expressions/varargWithImplicitCast.txt +++ b/compiler/testData/ir/irText/expressions/varargWithImplicitCast.txt @@ -1,26 +1,26 @@ FILE /varargWithImplicitCast.kt FUN public fun testScalar(a: kotlin.Any): kotlin.IntArray BLOCK_BODY - WHEN type=kotlin.Unit operator=IF - if: TYPE_OP operator=NOT_INSTANCEOF typeOperand=kotlin.Int - GET_VAR 'value-parameter a: Any' type=kotlin.Any operator=null + WHEN type=kotlin.Unit origin=IF + if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=kotlin.Int + GET_VAR 'value-parameter a: Any' type=kotlin.Any origin=null then: RETURN type=kotlin.Nothing from='testScalar(Any): IntArray' - CALL 'intArrayOf(vararg Int): IntArray' type=kotlin.IntArray operator=null + CALL 'intArrayOf(vararg Int): IntArray' type=kotlin.IntArray origin=null RETURN type=kotlin.Nothing from='testScalar(Any): IntArray' - CALL 'intArrayOf(vararg Int): IntArray' type=kotlin.IntArray operator=null + CALL 'intArrayOf(vararg Int): IntArray' type=kotlin.IntArray origin=null elements: VARARG type=IntArray varargElementType=Int - TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.Int - GET_VAR 'value-parameter a: Any' type=kotlin.Any operator=null + TYPE_OP origin=IMPLICIT_CAST typeOperand=kotlin.Int + GET_VAR 'value-parameter a: Any' type=kotlin.Any origin=null FUN public fun testSpread(a: kotlin.Any): kotlin.IntArray BLOCK_BODY - WHEN type=kotlin.Unit operator=IF - if: TYPE_OP operator=NOT_INSTANCEOF typeOperand=kotlin.IntArray - GET_VAR 'value-parameter a: Any' type=kotlin.Any operator=null + WHEN type=kotlin.Unit origin=IF + if: TYPE_OP origin=NOT_INSTANCEOF typeOperand=kotlin.IntArray + GET_VAR 'value-parameter a: Any' type=kotlin.Any origin=null then: RETURN type=kotlin.Nothing from='testSpread(Any): IntArray' - CALL 'intArrayOf(vararg Int): IntArray' type=kotlin.IntArray operator=null + CALL 'intArrayOf(vararg Int): IntArray' type=kotlin.IntArray origin=null RETURN type=kotlin.Nothing from='testSpread(Any): IntArray' - CALL 'intArrayOf(vararg Int): IntArray' type=kotlin.IntArray operator=null + CALL 'intArrayOf(vararg Int): IntArray' type=kotlin.IntArray origin=null elements: VARARG type=IntArray varargElementType=Int SPREAD_ELEMENT - TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.IntArray - GET_VAR 'value-parameter a: Any' type=kotlin.Any operator=null + TYPE_OP origin=IMPLICIT_CAST typeOperand=kotlin.IntArray + GET_VAR 'value-parameter a: Any' type=kotlin.Any origin=null diff --git a/compiler/testData/ir/irText/expressions/variableAsFunctionCall.txt b/compiler/testData/ir/irText/expressions/variableAsFunctionCall.txt index ad43e54cf22..daff5c66601 100644 --- a/compiler/testData/ir/irText/expressions/variableAsFunctionCall.txt +++ b/compiler/testData/ir/irText/expressions/variableAsFunctionCall.txt @@ -2,48 +2,48 @@ FILE /variableAsFunctionCall.kt FUN public fun kotlin.String.k(): () -> kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='k() on String: () -> String' - BLOCK type=() -> kotlin.String operator=LAMBDA + BLOCK type=() -> kotlin.String origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA local final fun (): kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='(): String' $RECEIVER of 'k() on String: () -> String' type=kotlin.String - CALLABLE_REFERENCE '(): String' type=() -> kotlin.String operator=LAMBDA + CALLABLE_REFERENCE '(): String' type=() -> kotlin.String origin=LAMBDA FUN public fun test1(f: () -> kotlin.Unit): kotlin.Unit BLOCK_BODY RETURN type=kotlin.Nothing from='test1(() -> Unit): Unit' - CALL 'invoke(): Unit' type=kotlin.Unit operator=INVOKE - $this: GET_VAR 'value-parameter f: () -> Unit' type=() -> kotlin.Unit operator=VARIABLE_AS_FUNCTION + CALL 'invoke(): Unit' type=kotlin.Unit origin=INVOKE + $this: GET_VAR 'value-parameter f: () -> Unit' type=() -> kotlin.Unit origin=VARIABLE_AS_FUNCTION FUN public fun test2(f: kotlin.String.() -> kotlin.Unit): kotlin.Unit BLOCK_BODY RETURN type=kotlin.Nothing from='test2(String.() -> Unit): Unit' - CALL 'invoke() on String: Unit' type=kotlin.Unit operator=INVOKE - $this: GET_VAR 'value-parameter f: String.() -> Unit' type=kotlin.String.() -> kotlin.Unit operator=VARIABLE_AS_FUNCTION + CALL 'invoke() on String: Unit' type=kotlin.Unit origin=INVOKE + $this: GET_VAR 'value-parameter f: String.() -> Unit' type=kotlin.String.() -> kotlin.Unit origin=VARIABLE_AS_FUNCTION $receiver: CONST String type=kotlin.String value='hello' FUN public fun test3(): kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='test3(): String' - CALL 'invoke(): String' type=kotlin.String operator=null - $this: CALL 'k() on String: () -> String' type=() -> kotlin.String operator=null + CALL 'invoke(): String' type=kotlin.String origin=null + $this: CALL 'k() on String: () -> String' type=() -> kotlin.String origin=null $receiver: CONST String type=kotlin.String value='hello' FUN public fun test4(ns: kotlin.String?): kotlin.String? BLOCK_BODY RETURN type=kotlin.Nothing from='test4(String?): String?' - BLOCK type=kotlin.String? operator=SAFE_CALL + BLOCK type=kotlin.String? origin=SAFE_CALL VAR IR_TEMPORARY_VARIABLE val tmp1_safe_receiver: (() -> kotlin.String)? - BLOCK type=(() -> kotlin.String)? operator=SAFE_CALL + BLOCK type=(() -> kotlin.String)? origin=SAFE_CALL VAR IR_TEMPORARY_VARIABLE val tmp0_safe_receiver: kotlin.String? - GET_VAR 'value-parameter ns: String?' type=kotlin.String? operator=null - WHEN type=(() -> kotlin.String)? operator=SAFE_CALL - if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQ - arg0: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? operator=null + GET_VAR 'value-parameter ns: String?' type=kotlin.String? origin=null + WHEN type=(() -> kotlin.String)? origin=SAFE_CALL + if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null arg1: CONST Null type=kotlin.Nothing? value='null' then: CONST Null type=kotlin.Nothing? value='null' - else: CALL 'k() on String: () -> String' type=() -> kotlin.String operator=null - $this: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? operator=null - WHEN type=kotlin.String? operator=SAFE_CALL - if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQ - arg0: GET_VAR 'tmp1_safe_receiver: (() -> String)?' type=(() -> kotlin.String)? operator=null + else: CALL 'k() on String: () -> String' type=() -> kotlin.String origin=null + $this: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null + WHEN type=kotlin.String? origin=SAFE_CALL + if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'tmp1_safe_receiver: (() -> String)?' type=(() -> kotlin.String)? origin=null arg1: CONST Null type=kotlin.Nothing? value='null' then: CONST Null type=kotlin.Nothing? value='null' - else: CALL 'invoke(): String' type=kotlin.String operator=null - $this: GET_VAR 'tmp1_safe_receiver: (() -> String)?' type=(() -> kotlin.String)? operator=null + else: CALL 'invoke(): String' type=kotlin.String origin=null + $this: GET_VAR 'tmp1_safe_receiver: (() -> String)?' type=(() -> kotlin.String)? origin=null diff --git a/compiler/testData/ir/irText/expressions/when.txt b/compiler/testData/ir/irText/expressions/when.txt index 9e98bf3e47c..969058a7b9c 100644 --- a/compiler/testData/ir/irText/expressions/when.txt +++ b/compiler/testData/ir/irText/expressions/when.txt @@ -7,93 +7,93 @@ FILE /when.kt FUN public fun testWithSubject(x: kotlin.Any?): kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='testWithSubject(Any?): String' - BLOCK type=kotlin.String operator=WHEN + BLOCK type=kotlin.String origin=WHEN VAR IR_TEMPORARY_VARIABLE val tmp0_subject: kotlin.Any? - GET_VAR 'value-parameter x: Any?' type=kotlin.Any? operator=null - WHEN type=kotlin.String operator=WHEN - if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQ - arg0: GET_VAR 'tmp0_subject: Any?' type=kotlin.Any? operator=null + GET_VAR 'value-parameter x: Any?' type=kotlin.Any? origin=null + WHEN type=kotlin.String origin=WHEN + if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'tmp0_subject: Any?' type=kotlin.Any? origin=null arg1: CONST Null type=kotlin.Nothing? value='null' then: CONST String type=kotlin.String value='null' - if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQ - arg0: GET_VAR 'tmp0_subject: Any?' type=kotlin.Any? operator=null + if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'tmp0_subject: Any?' type=kotlin.Any? origin=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: Any?' type=kotlin.Any? operator=null + if: TYPE_OP origin=INSTANCEOF typeOperand=kotlin.String + GET_VAR 'tmp0_subject: Any?' type=kotlin.Any? origin=null then: CONST String type=kotlin.String value='String' - if: CALL 'contains(Any) on Iterable: Boolean' type=kotlin.Boolean operator=IN - $receiver: CALL 'setOf(): Set' type=kotlin.collections.Set operator=null - element: GET_VAR 'tmp0_subject: Any?' type=kotlin.Any? operator=null + if: CALL 'contains(Any) on Iterable: Boolean' type=kotlin.Boolean origin=IN + $receiver: CALL 'setOf(): Set' type=kotlin.collections.Set origin=null + element: GET_VAR 'tmp0_subject: Any?' type=kotlin.Any? origin=null then: CONST String type=kotlin.String value='nothingness?' else: CONST String type=kotlin.String value='something' FUN public fun test(x: kotlin.Any?): kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='test(Any?): String' - WHEN type=kotlin.String operator=WHEN - if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQ - arg0: GET_VAR 'value-parameter x: Any?' type=kotlin.Any? operator=null + WHEN type=kotlin.String origin=WHEN + if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'value-parameter x: Any?' type=kotlin.Any? origin=null arg1: CONST Null type=kotlin.Nothing? value='null' then: CONST String type=kotlin.String value='null' - if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQ - arg0: GET_VAR 'value-parameter x: Any?' type=kotlin.Any? operator=null + if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'value-parameter x: Any?' type=kotlin.Any? origin=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 'value-parameter x: Any?' type=kotlin.Any? operator=null + if: TYPE_OP origin=INSTANCEOF typeOperand=kotlin.String + GET_VAR 'value-parameter x: Any?' type=kotlin.Any? origin=null then: CONST String type=kotlin.String value='String' - if: CALL 'contains(Any) on Iterable: Boolean' type=kotlin.Boolean operator=IN - $receiver: CALL 'setOf(): Set' type=kotlin.collections.Set operator=null - element: GET_VAR 'value-parameter x: Any?' type=kotlin.Any? operator=null + if: CALL 'contains(Any) on Iterable: Boolean' type=kotlin.Boolean origin=IN + $receiver: CALL 'setOf(): Set' type=kotlin.collections.Set origin=null + element: GET_VAR 'value-parameter x: Any?' type=kotlin.Any? origin=null then: CONST String type=kotlin.String value='nothingness?' else: CONST String type=kotlin.String value='something' FUN public fun testComma(x: kotlin.Int): kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='testComma(Int): String' - BLOCK type=kotlin.String operator=WHEN + BLOCK type=kotlin.String origin=WHEN VAR IR_TEMPORARY_VARIABLE val tmp0_subject: kotlin.Int - GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=null - 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: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQ - arg0: GET_VAR 'tmp0_subject: Int' type=kotlin.Int operator=null + GET_VAR 'value-parameter x: Int' type=kotlin.Int origin=null + WHEN type=kotlin.String origin=WHEN + if: WHEN type=kotlin.Boolean origin=WHEN_COMMA + if: WHEN type=kotlin.Boolean origin=WHEN_COMMA + if: WHEN type=kotlin.Boolean origin=WHEN_COMMA + if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'tmp0_subject: Int' type=kotlin.Int origin=null arg1: CONST Int type=kotlin.Int value='1' then: CONST Boolean type=kotlin.Boolean value='true' - else: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQ - arg0: GET_VAR 'tmp0_subject: Int' type=kotlin.Int operator=null + else: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'tmp0_subject: Int' type=kotlin.Int origin=null arg1: CONST Int type=kotlin.Int value='2' then: CONST Boolean type=kotlin.Boolean value='true' - else: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQ - arg0: GET_VAR 'tmp0_subject: Int' type=kotlin.Int operator=null + else: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'tmp0_subject: Int' type=kotlin.Int origin=null arg1: CONST Int type=kotlin.Int value='3' then: CONST Boolean type=kotlin.Boolean value='true' - else: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQ - arg0: GET_VAR 'tmp0_subject: Int' type=kotlin.Int operator=null + else: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'tmp0_subject: Int' type=kotlin.Int origin=null arg1: CONST Int type=kotlin.Int value='4' then: CONST String type=kotlin.String value='1234' - if: WHEN type=kotlin.Boolean operator=WHEN_COMMA - if: WHEN type=kotlin.Boolean operator=WHEN_COMMA - if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQ - arg0: GET_VAR 'tmp0_subject: Int' type=kotlin.Int operator=null + if: WHEN type=kotlin.Boolean origin=WHEN_COMMA + if: WHEN type=kotlin.Boolean origin=WHEN_COMMA + if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'tmp0_subject: Int' type=kotlin.Int origin=null arg1: CONST Int type=kotlin.Int value='5' then: CONST Boolean type=kotlin.Boolean value='true' - else: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQ - arg0: GET_VAR 'tmp0_subject: Int' type=kotlin.Int operator=null + else: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'tmp0_subject: Int' type=kotlin.Int origin=null arg1: CONST Int type=kotlin.Int value='6' then: CONST Boolean type=kotlin.Boolean value='true' - else: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQ - arg0: GET_VAR 'tmp0_subject: Int' type=kotlin.Int operator=null + else: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'tmp0_subject: Int' type=kotlin.Int origin=null arg1: CONST Int type=kotlin.Int value='7' then: CONST String type=kotlin.String value='567' - if: WHEN type=kotlin.Boolean operator=WHEN_COMMA - if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQ - arg0: GET_VAR 'tmp0_subject: Int' type=kotlin.Int operator=null + if: WHEN type=kotlin.Boolean origin=WHEN_COMMA + if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'tmp0_subject: Int' type=kotlin.Int origin=null arg1: CONST Int type=kotlin.Int value='8' then: CONST Boolean type=kotlin.Boolean value='true' - else: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQ - arg0: GET_VAR 'tmp0_subject: Int' type=kotlin.Int operator=null + else: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'tmp0_subject: Int' type=kotlin.Int origin=null arg1: CONST Int type=kotlin.Int value='9' then: CONST String type=kotlin.String value='89' else: CONST String type=kotlin.String value='?' diff --git a/compiler/testData/ir/irText/expressions/whenElse.txt b/compiler/testData/ir/irText/expressions/whenElse.txt index f27f9b6477e..1808d652643 100644 --- a/compiler/testData/ir/irText/expressions/whenElse.txt +++ b/compiler/testData/ir/irText/expressions/whenElse.txt @@ -2,5 +2,5 @@ FILE /whenElse.kt FUN public fun test(): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='test(): Int' - WHEN type=kotlin.Int operator=WHEN + WHEN type=kotlin.Int origin=WHEN else: CONST Int type=kotlin.Int value='42' diff --git a/compiler/testData/ir/irText/expressions/whileDoWhile.txt b/compiler/testData/ir/irText/expressions/whileDoWhile.txt index 153caaacf52..aa9b6500c20 100644 --- a/compiler/testData/ir/irText/expressions/whileDoWhile.txt +++ b/compiler/testData/ir/irText/expressions/whileDoWhile.txt @@ -3,79 +3,79 @@ FILE /whileDoWhile.kt BLOCK_BODY VAR var x: kotlin.Int CONST Int type=kotlin.Int value='0' - WHILE label=null operator=WHILE_LOOP - condition: CALL 'LT0(Int): Boolean' type=kotlin.Boolean operator=LT - arg0: CALL 'compareTo(Int): Int' type=kotlin.Int operator=LT - $this: GET_VAR 'x: Int' type=kotlin.Int operator=null + WHILE label=null origin=WHILE_LOOP + condition: CALL 'LT0(Int): Boolean' type=kotlin.Boolean origin=LT + arg0: CALL 'compareTo(Int): Int' type=kotlin.Int origin=LT + $this: GET_VAR 'x: Int' type=kotlin.Int origin=null other: CONST Int type=kotlin.Int value='0' - WHILE label=null operator=WHILE_LOOP - condition: CALL 'LT0(Int): Boolean' type=kotlin.Boolean operator=LT - arg0: CALL 'compareTo(Int): Int' type=kotlin.Int operator=LT - $this: GET_VAR 'x: Int' type=kotlin.Int operator=null + WHILE label=null origin=WHILE_LOOP + condition: CALL 'LT0(Int): Boolean' type=kotlin.Boolean origin=LT + arg0: CALL 'compareTo(Int): Int' type=kotlin.Int origin=LT + $this: GET_VAR 'x: Int' type=kotlin.Int origin=null other: CONST Int type=kotlin.Int value='5' - body: BLOCK type=kotlin.Int operator=POSTFIX_INCR + body: BLOCK type=kotlin.Int origin=POSTFIX_INCR VAR IR_TEMPORARY_VARIABLE val tmp0: kotlin.Int - GET_VAR 'x: Int' type=kotlin.Int operator=POSTFIX_INCR - SET_VAR 'x: Int' type=kotlin.Unit operator=POSTFIX_INCR - CALL 'inc(): Int' type=kotlin.Int operator=POSTFIX_INCR - $this: GET_VAR 'tmp0: Int' type=kotlin.Int operator=null - GET_VAR 'tmp0: Int' type=kotlin.Int operator=null - WHILE label=null operator=WHILE_LOOP - condition: CALL 'LT0(Int): Boolean' type=kotlin.Boolean operator=LT - arg0: CALL 'compareTo(Int): Int' type=kotlin.Int operator=LT - $this: GET_VAR 'x: Int' type=kotlin.Int operator=null + GET_VAR 'x: Int' type=kotlin.Int origin=POSTFIX_INCR + SET_VAR 'x: Int' type=kotlin.Unit origin=POSTFIX_INCR + CALL 'inc(): Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'tmp0: Int' type=kotlin.Int origin=null + GET_VAR 'tmp0: Int' type=kotlin.Int origin=null + WHILE label=null origin=WHILE_LOOP + condition: CALL 'LT0(Int): Boolean' type=kotlin.Boolean origin=LT + arg0: CALL 'compareTo(Int): Int' type=kotlin.Int origin=LT + $this: GET_VAR 'x: Int' type=kotlin.Int origin=null other: CONST Int type=kotlin.Int value='10' - body: BLOCK type=kotlin.Int operator=null - BLOCK type=kotlin.Int operator=POSTFIX_INCR + body: BLOCK type=kotlin.Int origin=null + BLOCK type=kotlin.Int origin=POSTFIX_INCR VAR IR_TEMPORARY_VARIABLE val tmp1: kotlin.Int - GET_VAR 'x: Int' type=kotlin.Int operator=POSTFIX_INCR - SET_VAR 'x: Int' type=kotlin.Unit operator=POSTFIX_INCR - CALL 'inc(): Int' type=kotlin.Int operator=POSTFIX_INCR - $this: GET_VAR 'tmp1: Int' type=kotlin.Int operator=null - GET_VAR 'tmp1: Int' type=kotlin.Int operator=null - DO_WHILE label=null operator=DO_WHILE_LOOP - condition: CALL 'LT0(Int): Boolean' type=kotlin.Boolean operator=LT - arg0: CALL 'compareTo(Int): Int' type=kotlin.Int operator=LT - $this: GET_VAR 'x: Int' type=kotlin.Int operator=null + GET_VAR 'x: Int' type=kotlin.Int origin=POSTFIX_INCR + SET_VAR 'x: Int' type=kotlin.Unit origin=POSTFIX_INCR + CALL 'inc(): Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'tmp1: Int' type=kotlin.Int origin=null + GET_VAR 'tmp1: Int' type=kotlin.Int origin=null + DO_WHILE label=null origin=DO_WHILE_LOOP + condition: CALL 'LT0(Int): Boolean' type=kotlin.Boolean origin=LT + arg0: CALL 'compareTo(Int): Int' type=kotlin.Int origin=LT + $this: GET_VAR 'x: Int' type=kotlin.Int origin=null other: CONST Int type=kotlin.Int value='0' - DO_WHILE label=null operator=DO_WHILE_LOOP - body: BLOCK type=kotlin.Int operator=POSTFIX_INCR + DO_WHILE label=null origin=DO_WHILE_LOOP + body: BLOCK type=kotlin.Int origin=POSTFIX_INCR VAR IR_TEMPORARY_VARIABLE val tmp2: kotlin.Int - GET_VAR 'x: Int' type=kotlin.Int operator=POSTFIX_INCR - SET_VAR 'x: Int' type=kotlin.Unit operator=POSTFIX_INCR - CALL 'inc(): Int' type=kotlin.Int operator=POSTFIX_INCR - $this: GET_VAR 'tmp2: Int' type=kotlin.Int operator=null - GET_VAR 'tmp2: Int' type=kotlin.Int operator=null - condition: CALL 'LT0(Int): Boolean' type=kotlin.Boolean operator=LT - arg0: CALL 'compareTo(Int): Int' type=kotlin.Int operator=LT - $this: GET_VAR 'x: Int' type=kotlin.Int operator=null + GET_VAR 'x: Int' type=kotlin.Int origin=POSTFIX_INCR + SET_VAR 'x: Int' type=kotlin.Unit origin=POSTFIX_INCR + CALL 'inc(): Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'tmp2: Int' type=kotlin.Int origin=null + GET_VAR 'tmp2: Int' type=kotlin.Int origin=null + condition: CALL 'LT0(Int): Boolean' type=kotlin.Boolean origin=LT + arg0: CALL 'compareTo(Int): Int' type=kotlin.Int origin=LT + $this: GET_VAR 'x: Int' type=kotlin.Int origin=null other: CONST Int type=kotlin.Int value='15' - DO_WHILE label=null operator=DO_WHILE_LOOP - body: BLOCK type=kotlin.Unit operator=null - BLOCK type=kotlin.Int operator=POSTFIX_INCR + DO_WHILE label=null origin=DO_WHILE_LOOP + body: BLOCK type=kotlin.Unit origin=null + BLOCK type=kotlin.Int origin=POSTFIX_INCR VAR IR_TEMPORARY_VARIABLE val tmp3: kotlin.Int - GET_VAR 'x: Int' type=kotlin.Int operator=POSTFIX_INCR - SET_VAR 'x: Int' type=kotlin.Unit operator=POSTFIX_INCR - CALL 'inc(): Int' type=kotlin.Int operator=POSTFIX_INCR - $this: GET_VAR 'tmp3: Int' type=kotlin.Int operator=null - GET_VAR 'tmp3: Int' type=kotlin.Int operator=null - condition: CALL 'LT0(Int): Boolean' type=kotlin.Boolean operator=LT - arg0: CALL 'compareTo(Int): Int' type=kotlin.Int operator=LT - $this: GET_VAR 'x: Int' type=kotlin.Int operator=null + GET_VAR 'x: Int' type=kotlin.Int origin=POSTFIX_INCR + SET_VAR 'x: Int' type=kotlin.Unit origin=POSTFIX_INCR + CALL 'inc(): Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'tmp3: Int' type=kotlin.Int origin=null + GET_VAR 'tmp3: Int' type=kotlin.Int origin=null + condition: CALL 'LT0(Int): Boolean' type=kotlin.Boolean origin=LT + arg0: CALL 'compareTo(Int): Int' type=kotlin.Int origin=LT + $this: GET_VAR 'x: Int' type=kotlin.Int origin=null other: CONST Int type=kotlin.Int value='20' FUN public fun testSmartcastInCondition(): kotlin.Unit BLOCK_BODY 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: Any?' type=kotlin.Any? operator=null - then: BLOCK type=kotlin.Unit operator=null - WHILE label=null operator=WHILE_LOOP - condition: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.Boolean - GET_VAR 'a: Any?' type=kotlin.Any? operator=null - body: BLOCK type=kotlin.Unit operator=null - DO_WHILE label=null operator=DO_WHILE_LOOP - body: BLOCK type=kotlin.Unit operator=null - condition: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.Boolean - GET_VAR 'a: Any?' type=kotlin.Any? operator=null + WHEN type=kotlin.Unit origin=IF + if: TYPE_OP origin=INSTANCEOF typeOperand=kotlin.Boolean + GET_VAR 'a: Any?' type=kotlin.Any? origin=null + then: BLOCK type=kotlin.Unit origin=null + WHILE label=null origin=WHILE_LOOP + condition: TYPE_OP origin=IMPLICIT_CAST typeOperand=kotlin.Boolean + GET_VAR 'a: Any?' type=kotlin.Any? origin=null + body: BLOCK type=kotlin.Unit origin=null + DO_WHILE label=null origin=DO_WHILE_LOOP + body: BLOCK type=kotlin.Unit origin=null + condition: TYPE_OP origin=IMPLICIT_CAST typeOperand=kotlin.Boolean + GET_VAR 'a: Any?' type=kotlin.Any? origin=null diff --git a/compiler/testData/ir/irText/lambdas/anonymousFunction.txt b/compiler/testData/ir/irText/lambdas/anonymousFunction.txt index e039673f7be..6f48fc418e0 100644 --- a/compiler/testData/ir/irText/lambdas/anonymousFunction.txt +++ b/compiler/testData/ir/irText/lambdas/anonymousFunction.txt @@ -2,12 +2,12 @@ FILE /anonymousFunction.kt PROPERTY public val anonymous: () -> kotlin.Unit FIELD PROPERTY_BACKING_FIELD public val anonymous: () -> kotlin.Unit EXPRESSION_BODY - BLOCK type=() -> kotlin.Unit operator=ANONYMOUS_FUNCTION + BLOCK type=() -> kotlin.Unit origin=ANONYMOUS_FUNCTION FUN local final fun (): kotlin.Unit BLOCK_BODY - CALL 'println(): Unit' type=kotlin.Unit operator=null - CALLABLE_REFERENCE '(): Unit' type=() -> kotlin.Unit operator=ANONYMOUS_FUNCTION + CALL 'println(): Unit' type=kotlin.Unit origin=null + CALLABLE_REFERENCE '(): Unit' type=() -> kotlin.Unit origin=ANONYMOUS_FUNCTION FUN DEFAULT_PROPERTY_ACCESSOR public fun (): () -> kotlin.Unit BLOCK_BODY RETURN type=kotlin.Nothing from='(): () -> Unit' - GET_BACKING_FIELD 'anonymous: () -> Unit' type=() -> kotlin.Unit operator=null + GET_BACKING_FIELD 'anonymous: () -> Unit' type=() -> kotlin.Unit origin=null diff --git a/compiler/testData/ir/irText/lambdas/extensionLambda.txt b/compiler/testData/ir/irText/lambdas/extensionLambda.txt index 3f4cd830c1e..456a7966f5a 100644 --- a/compiler/testData/ir/irText/lambdas/extensionLambda.txt +++ b/compiler/testData/ir/irText/lambdas/extensionLambda.txt @@ -2,12 +2,12 @@ FILE /extensionLambda.kt FUN public fun test1(): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='test1(): Int' - CALL 'run(String.() -> Int) on String: Int' type=kotlin.Int operator=null + CALL 'run(String.() -> Int) on String: Int' type=kotlin.Int origin=null $receiver: CONST String type=kotlin.String value='42' - block: BLOCK type=kotlin.String.() -> kotlin.Int operator=LAMBDA + block: BLOCK type=kotlin.String.() -> kotlin.Int origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA local final fun kotlin.String.(): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='() on String: Int' - CALL '(): Int' type=kotlin.Int operator=GET_PROPERTY + CALL '(): Int' type=kotlin.Int origin=GET_PROPERTY $this: $RECEIVER of '() on String: Int' type=kotlin.String - CALLABLE_REFERENCE '() on String: Int' type=kotlin.String.() -> kotlin.Int operator=LAMBDA + CALLABLE_REFERENCE '() on String: Int' type=kotlin.String.() -> kotlin.Int origin=LAMBDA diff --git a/compiler/testData/ir/irText/lambdas/justLambda.txt b/compiler/testData/ir/irText/lambdas/justLambda.txt index 22240645431..2f2834be8e2 100644 --- a/compiler/testData/ir/irText/lambdas/justLambda.txt +++ b/compiler/testData/ir/irText/lambdas/justLambda.txt @@ -2,25 +2,25 @@ FILE /justLambda.kt PROPERTY public val test1: () -> kotlin.Int FIELD PROPERTY_BACKING_FIELD public val test1: () -> kotlin.Int EXPRESSION_BODY - BLOCK type=() -> kotlin.Int operator=LAMBDA + BLOCK type=() -> kotlin.Int origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA local final fun (): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): Int' CONST Int type=kotlin.Int value='42' - CALLABLE_REFERENCE '(): Int' type=() -> kotlin.Int operator=LAMBDA + CALLABLE_REFERENCE '(): Int' type=() -> kotlin.Int origin=LAMBDA FUN DEFAULT_PROPERTY_ACCESSOR public fun (): () -> kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='(): () -> Int' - GET_BACKING_FIELD 'test1: () -> Int' type=() -> kotlin.Int operator=null + GET_BACKING_FIELD 'test1: () -> Int' type=() -> kotlin.Int origin=null PROPERTY public val test2: () -> kotlin.Unit FIELD PROPERTY_BACKING_FIELD public val test2: () -> kotlin.Unit EXPRESSION_BODY - BLOCK type=() -> kotlin.Unit operator=LAMBDA + BLOCK type=() -> kotlin.Unit origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA local final fun (): kotlin.Unit BLOCK_BODY RETURN type=kotlin.Nothing from='(): Unit' - CALLABLE_REFERENCE '(): Unit' type=() -> kotlin.Unit operator=LAMBDA + CALLABLE_REFERENCE '(): Unit' type=() -> kotlin.Unit origin=LAMBDA FUN DEFAULT_PROPERTY_ACCESSOR public fun (): () -> kotlin.Unit BLOCK_BODY RETURN type=kotlin.Nothing from='(): () -> Unit' - GET_BACKING_FIELD 'test2: () -> Unit' type=() -> kotlin.Unit operator=null + GET_BACKING_FIELD 'test2: () -> Unit' type=() -> kotlin.Unit origin=null diff --git a/compiler/testData/ir/irText/lambdas/localFunction.txt b/compiler/testData/ir/irText/lambdas/localFunction.txt index f56595c6daa..bf7e961f64b 100644 --- a/compiler/testData/ir/irText/lambdas/localFunction.txt +++ b/compiler/testData/ir/irText/lambdas/localFunction.txt @@ -5,11 +5,11 @@ FILE /localFunction.kt CONST Int type=kotlin.Int value='0' FUN local final fun local(): kotlin.Unit BLOCK_BODY - BLOCK type=kotlin.Int operator=POSTFIX_INCR + BLOCK type=kotlin.Int origin=POSTFIX_INCR VAR IR_TEMPORARY_VARIABLE val tmp0: kotlin.Int - GET_VAR 'x: Int' type=kotlin.Int operator=POSTFIX_INCR - SET_VAR 'x: Int' type=kotlin.Unit operator=POSTFIX_INCR - CALL 'inc(): Int' type=kotlin.Int operator=POSTFIX_INCR - $this: GET_VAR 'tmp0: Int' type=kotlin.Int operator=null - GET_VAR 'tmp0: Int' type=kotlin.Int operator=null - CALL 'local(): Unit' type=kotlin.Unit operator=null + GET_VAR 'x: Int' type=kotlin.Int origin=POSTFIX_INCR + SET_VAR 'x: Int' type=kotlin.Unit origin=POSTFIX_INCR + CALL 'inc(): Int' type=kotlin.Int origin=POSTFIX_INCR + $this: GET_VAR 'tmp0: Int' type=kotlin.Int origin=null + GET_VAR 'tmp0: Int' type=kotlin.Int origin=null + CALL 'local(): Unit' type=kotlin.Unit origin=null diff --git a/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.txt b/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.txt index 85d82d29d83..b7ff2b08fd9 100644 --- a/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.txt +++ b/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.txt @@ -22,29 +22,29 @@ FILE /multipleImplicitReceivers.kt CONST Int type=kotlin.Int value='42' FUN public fun test(fooImpl: IFoo, invokeImpl: IInvoke): kotlin.Unit BLOCK_BODY - CALL 'with(A, A.() -> Int): Int' type=kotlin.Int operator=null + CALL 'with(A, A.() -> Int): Int' type=kotlin.Int origin=null receiver: GET_OBJECT 'A' type=A - block: BLOCK type=A.() -> kotlin.Int operator=LAMBDA + block: BLOCK type=A.() -> kotlin.Int origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA local final fun A.(): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='() on A: Int' - CALL 'with(IFoo, IFoo.() -> Int): Int' type=kotlin.Int operator=null - receiver: GET_VAR 'value-parameter fooImpl: IFoo' type=IFoo operator=null - block: BLOCK type=IFoo.() -> kotlin.Int operator=LAMBDA + CALL 'with(IFoo, IFoo.() -> Int): Int' type=kotlin.Int origin=null + receiver: GET_VAR 'value-parameter fooImpl: IFoo' type=IFoo origin=null + block: BLOCK type=IFoo.() -> kotlin.Int origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA local final fun IFoo.(): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='() on IFoo: Int' - CALL 'with(IInvoke, IInvoke.() -> Int): Int' type=kotlin.Int operator=null - receiver: GET_VAR 'value-parameter invokeImpl: IInvoke' type=IInvoke operator=null - block: BLOCK type=IInvoke.() -> kotlin.Int operator=LAMBDA + CALL 'with(IInvoke, IInvoke.() -> Int): Int' type=kotlin.Int origin=null + receiver: GET_VAR 'value-parameter invokeImpl: IInvoke' type=IInvoke origin=null + block: BLOCK type=IInvoke.() -> kotlin.Int origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA local final fun IInvoke.(): kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='() on IInvoke: Int' - CALL 'invoke() on B: Int' type=kotlin.Int operator=INVOKE + CALL 'invoke() on B: Int' type=kotlin.Int origin=INVOKE $this: $RECEIVER of '() on IInvoke: Int' type=IInvoke - $receiver: CALL '() on A: B' type=B operator=GET_PROPERTY + $receiver: CALL '() on A: B' type=B origin=GET_PROPERTY $this: $RECEIVER of '() on IFoo: Int' type=IFoo $receiver: $RECEIVER of '() on A: Int' type=A - CALLABLE_REFERENCE '() on IInvoke: Int' type=IInvoke.() -> kotlin.Int operator=LAMBDA - CALLABLE_REFERENCE '() on IFoo: Int' type=IFoo.() -> kotlin.Int operator=LAMBDA - CALLABLE_REFERENCE '() on A: Int' type=A.() -> kotlin.Int operator=LAMBDA + CALLABLE_REFERENCE '() on IInvoke: Int' type=IInvoke.() -> kotlin.Int origin=LAMBDA + CALLABLE_REFERENCE '() on IFoo: Int' type=IFoo.() -> kotlin.Int origin=LAMBDA + CALLABLE_REFERENCE '() on A: Int' type=A.() -> kotlin.Int origin=LAMBDA diff --git a/compiler/testData/ir/irText/lambdas/nonLocalReturn.txt b/compiler/testData/ir/irText/lambdas/nonLocalReturn.txt index 0eb6330bd6f..686480a60ae 100644 --- a/compiler/testData/ir/irText/lambdas/nonLocalReturn.txt +++ b/compiler/testData/ir/irText/lambdas/nonLocalReturn.txt @@ -1,57 +1,57 @@ FILE /nonLocalReturn.kt FUN public fun test0(): kotlin.Unit BLOCK_BODY - CALL 'run(() -> Nothing): Nothing' type=kotlin.Nothing operator=null - block: BLOCK type=() -> kotlin.Nothing operator=LAMBDA + CALL 'run(() -> Nothing): Nothing' type=kotlin.Nothing origin=null + block: BLOCK type=() -> kotlin.Nothing origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA local final fun (): kotlin.Nothing BLOCK_BODY RETURN type=kotlin.Nothing from='test0(): Unit' - CALLABLE_REFERENCE '(): Nothing' type=() -> kotlin.Nothing operator=LAMBDA + CALLABLE_REFERENCE '(): Nothing' type=() -> kotlin.Nothing origin=LAMBDA FUN public fun test1(): kotlin.Unit BLOCK_BODY - CALL 'run(() -> Unit): Unit' type=kotlin.Unit operator=null - block: BLOCK type=() -> kotlin.Unit operator=LAMBDA + CALL 'run(() -> Unit): Unit' type=kotlin.Unit origin=null + block: BLOCK type=() -> kotlin.Unit origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA local final fun (): kotlin.Unit BLOCK_BODY RETURN type=kotlin.Nothing from='(): Unit' - CALLABLE_REFERENCE '(): Unit' type=() -> kotlin.Unit operator=LAMBDA + CALLABLE_REFERENCE '(): Unit' type=() -> kotlin.Unit origin=LAMBDA FUN public fun test2(): kotlin.Unit BLOCK_BODY - CALL 'run(() -> Unit): Unit' type=kotlin.Unit operator=null - block: BLOCK type=() -> kotlin.Unit operator=LAMBDA + CALL 'run(() -> Unit): Unit' type=kotlin.Unit origin=null + block: BLOCK type=() -> kotlin.Unit origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA local final fun (): kotlin.Unit BLOCK_BODY RETURN type=kotlin.Nothing from='(): Unit' - CALLABLE_REFERENCE '(): Unit' type=() -> kotlin.Unit operator=LAMBDA + CALLABLE_REFERENCE '(): Unit' type=() -> kotlin.Unit origin=LAMBDA FUN public fun testLrmFoo1(ints: kotlin.collections.List): kotlin.Unit BLOCK_BODY - CALL 'forEach((Int) -> Unit) on Iterable: Unit' type=kotlin.Unit operator=null - $receiver: GET_VAR 'value-parameter ints: List' type=kotlin.collections.List operator=null - action: BLOCK type=(kotlin.Int) -> kotlin.Unit operator=LAMBDA + CALL 'forEach((Int) -> Unit) on Iterable: Unit' type=kotlin.Unit origin=null + $receiver: GET_VAR 'value-parameter ints: List' type=kotlin.collections.List origin=null + action: BLOCK type=(kotlin.Int) -> kotlin.Unit origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA local final fun (it: kotlin.Int): kotlin.Unit BLOCK_BODY - WHEN type=kotlin.Unit operator=IF - if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQ - arg0: GET_VAR 'value-parameter it: Int' type=kotlin.Int operator=null + WHEN type=kotlin.Unit origin=IF + if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'value-parameter it: Int' type=kotlin.Int origin=null arg1: CONST Int type=kotlin.Int value='0' then: RETURN type=kotlin.Nothing from='(Int): Unit' RETURN type=kotlin.Nothing from='(Int): Unit' - CALL 'print(Int): Unit' type=kotlin.Unit operator=null - message: GET_VAR 'value-parameter it: Int' type=kotlin.Int operator=null - CALLABLE_REFERENCE '(Int): Unit' type=(kotlin.Int) -> kotlin.Unit operator=LAMBDA + CALL 'print(Int): Unit' type=kotlin.Unit origin=null + message: GET_VAR 'value-parameter it: Int' type=kotlin.Int origin=null + CALLABLE_REFERENCE '(Int): Unit' type=(kotlin.Int) -> kotlin.Unit origin=LAMBDA FUN public fun testLrmFoo2(ints: kotlin.collections.List): kotlin.Unit BLOCK_BODY - CALL 'forEach((Int) -> Unit) on Iterable: Unit' type=kotlin.Unit operator=null - $receiver: GET_VAR 'value-parameter ints: List' type=kotlin.collections.List operator=null - action: BLOCK type=(kotlin.Int) -> kotlin.Unit operator=LAMBDA + CALL 'forEach((Int) -> Unit) on Iterable: Unit' type=kotlin.Unit origin=null + $receiver: GET_VAR 'value-parameter ints: List' type=kotlin.collections.List origin=null + action: BLOCK type=(kotlin.Int) -> kotlin.Unit origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA local final fun (it: kotlin.Int): kotlin.Unit BLOCK_BODY - WHEN type=kotlin.Unit operator=IF - if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean operator=EQEQ - arg0: GET_VAR 'value-parameter it: Int' type=kotlin.Int operator=null + WHEN type=kotlin.Unit origin=IF + if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'value-parameter it: Int' type=kotlin.Int origin=null arg1: CONST Int type=kotlin.Int value='0' then: RETURN type=kotlin.Nothing from='(Int): Unit' RETURN type=kotlin.Nothing from='(Int): Unit' - CALL 'print(Int): Unit' type=kotlin.Unit operator=null - message: GET_VAR 'value-parameter it: Int' type=kotlin.Int operator=null - CALLABLE_REFERENCE '(Int): Unit' type=(kotlin.Int) -> kotlin.Unit operator=LAMBDA + CALL 'print(Int): Unit' type=kotlin.Unit origin=null + message: GET_VAR 'value-parameter it: Int' type=kotlin.Int origin=null + CALLABLE_REFERENCE '(Int): Unit' type=(kotlin.Int) -> kotlin.Unit origin=LAMBDA diff --git a/compiler/testData/ir/irText/lambdas/samAdapter.txt b/compiler/testData/ir/irText/lambdas/samAdapter.txt index 66dda5dd577..4aba26e966d 100644 --- a/compiler/testData/ir/irText/lambdas/samAdapter.txt +++ b/compiler/testData/ir/irText/lambdas/samAdapter.txt @@ -2,13 +2,13 @@ FILE /samAdapter.kt FUN public fun test1(): kotlin.Unit BLOCK_BODY VAR val hello: java.lang.Runnable - CALL 'Runnable(() -> Unit): Runnable' type=java.lang.Runnable operator=null - function: BLOCK type=() -> kotlin.Unit operator=LAMBDA + CALL 'Runnable(() -> Unit): Runnable' type=java.lang.Runnable origin=null + function: BLOCK type=() -> kotlin.Unit origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA local final fun (): kotlin.Unit BLOCK_BODY RETURN type=kotlin.Nothing from='(): Unit' - CALL 'println(Any?): Unit' type=kotlin.Unit operator=null + CALL 'println(Any?): Unit' type=kotlin.Unit origin=null message: CONST String type=kotlin.String value='Hello, world!' - CALLABLE_REFERENCE '(): Unit' type=() -> kotlin.Unit operator=LAMBDA - CALL 'run(): Unit' type=kotlin.Unit operator=null - $this: GET_VAR 'hello: Runnable' type=java.lang.Runnable operator=null + CALLABLE_REFERENCE '(): Unit' type=() -> kotlin.Unit origin=LAMBDA + CALL 'run(): Unit' type=kotlin.Unit origin=null + $this: GET_VAR 'hello: Runnable' type=java.lang.Runnable origin=null