@@ -27,6 +27,7 @@ void show_loop_ids(
27
27
28
28
void show_loop_ids (
29
29
ui_message_handlert::uit ui,
30
+ const irep_idt &function_identifier,
30
31
const goto_programt &goto_program)
31
32
{
32
33
switch (ui)
@@ -39,8 +40,8 @@ void show_loop_ids(
39
40
{
40
41
unsigned loop_id=it->loop_number ;
41
42
42
- std::cout << " Loop "
43
- << it-> function << " . " << loop_id << " : " << " \n " ;
43
+ std::cout << " Loop " << function_identifier << " . " << loop_id << " : "
44
+ << " \n " ;
44
45
45
46
std::cout << " " << it->source_location << " \n " ;
46
47
std::cout << " \n " ;
@@ -55,7 +56,8 @@ void show_loop_ids(
55
56
if (it->is_backwards_goto ())
56
57
{
57
58
unsigned loop_id=it->loop_number ;
58
- std::string id=id2string (it->function )+" ." +std::to_string (loop_id);
59
+ std::string id =
60
+ id2string (function_identifier) + " ." + std::to_string (loop_id);
59
61
60
62
xmlt xml_loop (" loop" );
61
63
xml_loop.set_attribute (" name" , id);
@@ -73,6 +75,7 @@ void show_loop_ids(
73
75
74
76
void show_loop_ids_json (
75
77
ui_message_handlert::uit ui,
78
+ const irep_idt &function_identifier,
76
79
const goto_programt &goto_program,
77
80
json_arrayt &loops)
78
81
{
@@ -83,7 +86,8 @@ void show_loop_ids_json(
83
86
if (it->is_backwards_goto ())
84
87
{
85
88
unsigned loop_id=it->loop_number ;
86
- std::string id=id2string (it->function )+" ." +std::to_string (loop_id);
89
+ std::string id =
90
+ id2string (function_identifier) + " ." + std::to_string (loop_id);
87
91
88
92
json_objectt &loop=loops.push_back ().make_object ();
89
93
loop[" name" ]=json_stringt (id);
@@ -100,15 +104,16 @@ void show_loop_ids(
100
104
{
101
105
case ui_message_handlert::uit::PLAIN:
102
106
case ui_message_handlert::uit::XML_UI:
103
- forall_goto_functions (it, goto_functions)
104
- show_loop_ids (ui, it-> second .body );
107
+ for ( const auto &f: goto_functions. function_map )
108
+ show_loop_ids (ui, f. first , f. second .body );
105
109
break ;
110
+
106
111
case ui_message_handlert::uit::JSON_UI:
107
112
json_objectt json_result;
108
113
json_arrayt &loops=json_result[" loops" ].make_array ();
109
114
110
- forall_goto_functions (it, goto_functions)
111
- show_loop_ids_json (ui, it-> second .body , loops);
115
+ for ( const auto &f : goto_functions. function_map )
116
+ show_loop_ids_json (ui, f. first , f. second .body , loops);
112
117
113
118
std::cout << " ,\n " << json_result;
114
119
break ;
0 commit comments