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

Function verifyCallGraph

libsolidity/codegen/ir/IRGenerator.cpp:56–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54{
55
56void verifyCallGraph(
57 std::set<CallableDeclaration const*, ASTNode::CompareByID> const& _expectedCallables,
58 std::set<FunctionDefinition const*> _generatedFunctions
59)
60{
61 for (auto const& expectedCallable: _expectedCallables)
62 if (auto const* expectedFunction = dynamic_cast<FunctionDefinition const*>(expectedCallable))
63 {
64 solAssert(
65 _generatedFunctions.count(expectedFunction) == 1 || expectedFunction->isConstructor(),
66 "No code generated for function " + expectedFunction->name() + " even though it is not a constructor."
67 );
68 _generatedFunctions.erase(expectedFunction);
69 }
70
71 solAssert(
72 _generatedFunctions.size() == 0,
73 "Of the generated functions " + toString(_generatedFunctions.size()) + " are not in the call graph."
74 );
75}
76
77std::set<CallableDeclaration const*, ASTNode::CompareByID> collectReachableCallables(
78 CallGraph const& _graph

Callers 1

generateMethod · 0.85

Calls 6

isConstructorMethod · 0.80
eraseMethod · 0.80
toStringFunction · 0.50
countMethod · 0.45
nameMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected