Skip to content

Commit 0d862d8

Browse files
smowtonpeterschrammel
authored andcommitted
Add call-graph topo sort on goto_functionst
This sorts the entire call graph, rather than just the graph reachable from some particular start point as before.
1 parent 85df6db commit 0d862d8

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

src/analyses/call_graph.cpp

+14
Original file line numberDiff line numberDiff line change
@@ -216,3 +216,17 @@ void inverted_partial_topological_order(
216216
);
217217
output.push_back(start_function);
218218
}
219+
220+
void get_inverted_topological_order(
221+
call_grapht const& call_graph,
222+
goto_functionst const& functions,
223+
std::vector<irep_idt>& output)
224+
{
225+
std::unordered_set<irep_idt,dstring_hash> processed;
226+
for (auto const& elem : functions.function_map)
227+
inverted_partial_topological_order(
228+
call_graph,
229+
elem.first,
230+
processed,
231+
output);
232+
}

src/analyses/call_graph.h

+4
Original file line numberDiff line numberDiff line change
@@ -114,5 +114,9 @@ void inverted_partial_topological_order(
114114
std::vector<irep_idt>& output
115115
);
116116

117+
void get_inverted_topological_order(
118+
call_grapht const& call_graph,
119+
goto_functionst const& functions,
120+
std::vector<irep_idt>& output);
117121

118122
#endif // CPROVER_ANALYSES_CALL_GRAPH_H

0 commit comments

Comments
 (0)