| 54 | } |
| 55 | |
| 56 | bool ControlFlowBuilder::visit(BinaryOperation const& _operation) |
| 57 | { |
| 58 | solAssert(!!m_currentNode, ""); |
| 59 | |
| 60 | switch (_operation.getOperator()) |
| 61 | { |
| 62 | case Token::Or: |
| 63 | case Token::And: |
| 64 | { |
| 65 | visitNode(_operation); |
| 66 | solAssert(*_operation.annotation().userDefinedFunction == nullptr); |
| 67 | appendControlFlow(_operation.leftExpression()); |
| 68 | |
| 69 | auto nodes = splitFlow<2>(); |
| 70 | nodes[0] = createFlow(nodes[0], _operation.rightExpression()); |
| 71 | mergeFlow(nodes, nodes[1]); |
| 72 | return false; |
| 73 | } |
| 74 | default: |
| 75 | { |
| 76 | if (*_operation.annotation().userDefinedFunction != nullptr) |
| 77 | { |
| 78 | visitNode(_operation); |
| 79 | _operation.leftExpression().accept(*this); |
| 80 | _operation.rightExpression().accept(*this); |
| 81 | |
| 82 | m_currentNode->functionDefinition = *_operation.annotation().userDefinedFunction; |
| 83 | |
| 84 | auto nextNode = newLabel(); |
| 85 | |
| 86 | connect(m_currentNode, nextNode); |
| 87 | m_currentNode = nextNode; |
| 88 | return false; |
| 89 | } |
| 90 | } |
| 91 | } |
| 92 | return ASTConstVisitor::visit(_operation); |
| 93 | } |
| 94 | |
| 95 | bool ControlFlowBuilder::visit(UnaryOperation const& _operation) |
| 96 | { |
nothing calls this directly
no test coverage detected