| 54 | { |
| 55 | |
| 56 | void 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 | |
| 77 | std::set<CallableDeclaration const*, ASTNode::CompareByID> collectReachableCallables( |
| 78 | CallGraph const& _graph |