@@ -13,8 +13,70 @@ Date: June 2003
13
13
14
14
#include " goto_functions.h"
15
15
16
+ void goto_functionst::output (
17
+ const namespacet &ns,
18
+ std::ostream &out) const
19
+ {
20
+ for (const auto &fun : function_map)
21
+ {
22
+ if (fun.second .body_available ())
23
+ {
24
+ out << " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n " ;
25
+
26
+ const symbolt &symbol=ns.lookup (fun.first );
27
+ out << symbol.display_name () << " /* " << symbol.name << " */\n " ;
28
+ fun.second .body .output (ns, symbol.name , out);
29
+
30
+ out << std::flush;
31
+ }
32
+ }
33
+ }
34
+
35
+ void goto_functionst::compute_location_numbers ()
36
+ {
37
+ unused_location_number = 0 ;
38
+ for (auto &func : function_map)
39
+ {
40
+ // Side-effect: bumps unused_location_number.
41
+ func.second .body .compute_location_numbers (unused_location_number);
42
+ }
43
+ }
44
+
45
+ void goto_functionst::compute_location_numbers (
46
+ goto_programt &program)
47
+ {
48
+ // Renumber just this single function. Use fresh numbers in case it has
49
+ // grown since it was last numbered.
50
+ program.compute_location_numbers (unused_location_number);
51
+ }
52
+
53
+ void goto_functionst::compute_incoming_edges ()
54
+ {
55
+ for (auto &func : function_map)
56
+ {
57
+ func.second .body .compute_incoming_edges ();
58
+ }
59
+ }
60
+
61
+ void goto_functionst::compute_target_numbers ()
62
+ {
63
+ for (auto &func : function_map)
64
+ {
65
+ func.second .body .compute_target_numbers ();
66
+ }
67
+ }
68
+
69
+ void goto_functionst::compute_loop_numbers ()
70
+ {
71
+ for (auto &func : function_map)
72
+ {
73
+ func.second .body .compute_loop_numbers ();
74
+ }
75
+ }
76
+
77
+
16
78
void get_local_identifiers (
17
- const goto_function_templatet<goto_programt> &goto_function,
79
+ const goto_functiont &goto_function,
18
80
std::set<irep_idt> &dest)
19
81
{
20
82
goto_function.body .get_decl_identifiers (dest);
0 commit comments