|
14 | 14 | #include <util/std_expr.h> |
15 | 15 | #include <util/xml.h> |
16 | 16 |
|
| 17 | +/// Create empty call graph |
| 18 | +/// \param collect_callsites: if true, then each added graph edge will have |
| 19 | +/// the calling instruction recorded in `callsites` map. |
17 | 20 | call_grapht::call_grapht(bool collect_callsites): |
18 | 21 | collect_callsites(collect_callsites) |
19 | 22 | { |
20 | 23 | } |
21 | 24 |
|
| 25 | +/// Create complete call graph |
| 26 | +/// \param goto_model: model to search for callsites |
| 27 | +/// \param collect_callsites: if true, then each added graph edge will have |
| 28 | +/// the calling instruction recorded in `callsites` map. |
22 | 29 | call_grapht::call_grapht(const goto_modelt &goto_model, bool collect_callsites): |
23 | 30 | call_grapht(goto_model.goto_functions, collect_callsites) |
24 | 31 | { |
25 | 32 | } |
26 | 33 |
|
| 34 | +/// Create complete call graph |
| 35 | +/// \param goto_functions: functions to search for callsites |
| 36 | +/// \param collect_callsites: if true, then each added graph edge will have |
| 37 | +/// the calling instruction recorded in `callsites` map. |
27 | 38 | call_grapht::call_grapht( |
28 | 39 | const goto_functionst &goto_functions, bool collect_callsites): |
29 | 40 | collect_callsites(collect_callsites) |
@@ -54,7 +65,7 @@ static void forall_callsites( |
54 | 65 | } |
55 | 66 |
|
56 | 67 | /// Create call graph restricted to functions reachable from `root` |
57 | | -/// \param functions: functions to search for callsites |
| 68 | +/// \param goto_functions: functions to search for callsites |
58 | 69 | /// \param root: function to start exploring the graph |
59 | 70 | /// \param collect_callsites: if true, then each added graph edge will have |
60 | 71 | /// the calling instruction recorded in `callsites` map. |
@@ -204,6 +215,10 @@ call_grapht::directed_grapht call_grapht::get_directed_graph() const |
204 | 215 | return ret; |
205 | 216 | } |
206 | 217 |
|
| 218 | +/// Prints callsites responsible for a graph edge as comma-separated |
| 219 | +/// location numbers, e.g. "{1, 2, 3}". |
| 220 | +/// \param edge: graph edge |
| 221 | +/// \return pretty representation of edge callsites |
207 | 222 | std::string call_grapht::format_callsites(const edget &edge) const |
208 | 223 | { |
209 | 224 | PRECONDITION(collect_callsites); |
|
0 commit comments