| 42 | std::vector<FunctionHandle> currentPath{}; |
| 43 | |
| 44 | void visit(FunctionHandle const& _function) |
| 45 | { |
| 46 | if (visited.count(_function)) |
| 47 | return; |
| 48 | if ( |
| 49 | auto it = find(currentPath.begin(), currentPath.end(), _function); |
| 50 | it != currentPath.end() |
| 51 | ) |
| 52 | containedInCycle.insert(it, currentPath.end()); |
| 53 | else |
| 54 | { |
| 55 | currentPath.emplace_back(_function); |
| 56 | if (callGraph.functionCalls.count(_function)) |
| 57 | for (auto const& child: callGraph.functionCalls.at(_function)) |
| 58 | visit(child); |
| 59 | currentPath.pop_back(); |
| 60 | visited.insert(_function); |
| 61 | } |
| 62 | } |
| 63 | }; |
| 64 | } |
| 65 | |