From 7b439c21731aa78a9ff47ca2621b19555090be81 Mon Sep 17 00:00:00 2001 From: Alexey Sedunov Date: Thu, 19 Jun 2014 16:17:39 +0400 Subject: [PATCH] Minor: Formatting changed --- .../jet/lang/cfg/JetControlFlowProcessor.java | 36 ++++++++++--------- .../eval/operationInstructions.kt | 22 ++++-------- 2 files changed, 25 insertions(+), 33 deletions(-) diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor.java b/compiler/frontend/src/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor.java index fc336163bdc..7379e15f149 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor.java @@ -555,16 +555,12 @@ public class JetControlFlowProcessor { @NotNull AccessTarget target, @Nullable PseudoValue rightValue, @NotNull Map receiverValues, - @NotNull JetExpression parentExpression) { + @NotNull JetExpression parentExpression + ) { VariableDescriptor descriptor = BindingContextUtils.extractVariableDescriptorIfAny(trace.getBindingContext(), left, false); if (descriptor != null) { - builder.write( - parentExpression, - left, - rightValue != null ? rightValue : createSyntheticValue(parentExpression), - target, - receiverValues - ); + PseudoValue rValue = rightValue != null ? rightValue : createSyntheticValue(parentExpression); + builder.write(parentExpression, left, rValue, target, receiverValues); } } @@ -1142,15 +1138,21 @@ public class JetControlFlowProcessor { builder.declareVariable(entry); ResolvedCall resolvedCall = trace.get(BindingContext.COMPONENT_RESOLVED_CALL, entry); - PseudoValue writtenValue = resolvedCall != null - ? builder.call( - entry, - entry, - resolvedCall, - getReceiverValues(initializer, resolvedCall, false), - Collections.emptyMap() - ).getOutputValue() - : createSyntheticValue(entry, initializer); + + PseudoValue writtenValue; + if (resolvedCall != null) { + writtenValue = builder.call( + entry, + entry, + resolvedCall, + getReceiverValues(initializer, resolvedCall, false), + Collections.emptyMap() + ).getOutputValue(); + } + else { + writtenValue = createSyntheticValue(entry, initializer); + } + if (generateWriteForEntries) { generateInitializer(entry, writtenValue != null ? writtenValue : createSyntheticValue(entry)); } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/cfg/pseudocode/instructions/eval/operationInstructions.kt b/compiler/frontend/src/org/jetbrains/jet/lang/cfg/pseudocode/instructions/eval/operationInstructions.kt index e9a220ed3cb..a53a8dad35b 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/cfg/pseudocode/instructions/eval/operationInstructions.kt +++ b/compiler/frontend/src/org/jetbrains/jet/lang/cfg/pseudocode/instructions/eval/operationInstructions.kt @@ -107,16 +107,11 @@ public class MagicInstruction( inputValues: List, val expectedTypes: Map ) : OperationInstruction(element, lexicalScope, inputValues), StrictlyValuedOperationInstruction { - override fun accept(visitor: InstructionVisitor) { - visitor.visitMagic(this) - } + override fun accept(visitor: InstructionVisitor) = visitor.visitMagic(this) - override fun accept(visitor: InstructionVisitorWithResult): R { - return visitor.visitMagic(this) - } + override fun accept(visitor: InstructionVisitorWithResult): R = visitor.visitMagic(this) - override fun createCopy() = - MagicInstruction(element, lexicalScope, synthetic, inputValues, expectedTypes).setResult(resultValue) + override fun createCopy() = MagicInstruction(element, lexicalScope, synthetic, inputValues, expectedTypes).setResult(resultValue) override fun toString() = renderInstruction("magic", render(element)) @@ -141,16 +136,11 @@ class MergeInstruction private( lexicalScope: LexicalScope, inputValues: List ): OperationInstruction(element, lexicalScope, inputValues), StrictlyValuedOperationInstruction { - override fun accept(visitor: InstructionVisitor) { - visitor.visitMerge(this) - } + override fun accept(visitor: InstructionVisitor) = visitor.visitMerge(this) - override fun accept(visitor: InstructionVisitorWithResult): R { - return visitor.visitMerge(this) - } + override fun accept(visitor: InstructionVisitorWithResult): R = visitor.visitMerge(this) - override fun createCopy() = - MergeInstruction(element, lexicalScope, inputValues).setResult(resultValue) + override fun createCopy() = MergeInstruction(element, lexicalScope, inputValues).setResult(resultValue) override fun toString() = renderInstruction("merge", render(element))