public void visitReturnStatement(GrReturnStatement returnStatement) { boolean isNodeNeeded = myHead == null || myHead.getElement() != returnStatement; final GrExpression value = returnStatement.getReturnValue(); if (value != null) value.accept(this); if (isNodeNeeded) { InstructionImpl returnInstruction = startNode(returnStatement); addPendingEdge(null, myHead); finishNode(returnInstruction); } else { addPendingEdge(null, myHead); } interruptFlow(); }
private static boolean returnStatementsAreEquivalent( @NotNull GrReturnStatement statement1, @NotNull GrReturnStatement statement2) { final GrExpression returnValue1 = statement1.getReturnValue(); final GrExpression returnValue2 = statement2.getReturnValue(); return expressionsAreEquivalent(returnValue1, returnValue2); }