| 112 | } |
| 113 | |
| 114 | bool FunctionCallGraphBuilder::visit(FunctionCall const& _functionCall) |
| 115 | { |
| 116 | if (*_functionCall.annotation().kind != FunctionCallKind::FunctionCall) |
| 117 | return true; |
| 118 | |
| 119 | auto const* functionType = dynamic_cast<FunctionType const*>(_functionCall.expression().annotation().type); |
| 120 | solAssert(functionType, ""); |
| 121 | |
| 122 | if (functionType->kind() == FunctionType::Kind::Internal && !_functionCall.expression().annotation().calledDirectly) |
| 123 | // If it's not a direct call, we don't really know which function will be called (it may even |
| 124 | // change at runtime). All we can do is to add an edge to the dispatch which in turn has |
| 125 | // edges to all functions could possibly be called. |
| 126 | add(m_currentNode, CallGraph::SpecialNode::InternalDispatch); |
| 127 | else if (functionType->kind() == FunctionType::Kind::Error) |
| 128 | m_graph.usedErrors.insert(&dynamic_cast<ErrorDefinition const&>(functionType->declaration())); |
| 129 | |
| 130 | return true; |
| 131 | } |
| 132 | |
| 133 | bool FunctionCallGraphBuilder::visit(EmitStatement const& _emitStatement) |
| 134 | { |
nothing calls this directly
no test coverage detected