MCPcopy Create free account
hub / github.com/argotorg/solidity / visit

Method visit

libsolidity/analysis/ControlFlowBuilder.cpp:56–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54}
55
56bool 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
95bool ControlFlowBuilder::visit(UnaryOperation const& _operation)
96{

Callers

nothing calls this directly

Calls 15

nativeLocationOfFunction · 0.85
originLocationOfFunction · 0.85
resolveOuterUnaryTuplesFunction · 0.85
conditionMethod · 0.80
falseStatementMethod · 0.80
loopExpressionMethod · 0.80
isDoWhileMethod · 0.80
isImplementedMethod · 0.80
parametersMethod · 0.80
isReturnParameterMethod · 0.80

Tested by

no test coverage detected