@@ -44,10 +44,8 @@ class dott
44
44
std::list<exprt> function_calls;
45
45
std::list<exprt> clusters;
46
46
47
- void write_dot_subgraph (
48
- std::ostream &,
49
- const std::string &,
50
- const goto_programt &);
47
+ void
48
+ write_dot_subgraph (std::ostream &, const irep_idt &, const goto_programt &);
51
49
52
50
void do_dot_function_calls (std::ostream &);
53
51
@@ -64,21 +62,23 @@ class dott
64
62
std::set<goto_programt::const_targett> &);
65
63
};
66
64
67
- // / writes the dot graph that corresponds to the goto program to the output
65
+ // / Write the dot graph that corresponds to the goto program to the output
68
66
// / stream.
69
- // / \par parameters: output stream, name and goto program
67
+ // / \param out: output stream
68
+ // / \param function_id: name of \p goto_program
69
+ // / \param goto_program: goto program the dot graph of which is written
70
70
// / \return true on error, false otherwise
71
71
void dott::write_dot_subgraph (
72
72
std::ostream &out,
73
- const std::string &name ,
73
+ const irep_idt &function_id ,
74
74
const goto_programt &goto_program)
75
75
{
76
76
clusters.push_back (exprt (" cluster" ));
77
- clusters.back ().set (" name" , name );
77
+ clusters.back ().set (" name" , function_id );
78
78
clusters.back ().set (" nr" , subgraphscount);
79
79
80
- out << " subgraph \" cluster_" << name << " \" {\n " ;
81
- out << " label=\" " << name << " \" ;\n " ;
80
+ out << " subgraph \" cluster_" << function_id << " \" {\n " ;
81
+ out << " label=\" " << function_id << " \" ;\n " ;
82
82
83
83
const goto_programt::instructionst &instructions =
84
84
goto_program.instructions ;
@@ -111,22 +111,22 @@ void dott::write_dot_subgraph(
111
111
tmp.str (" Goto" );
112
112
else
113
113
{
114
- std::string t = from_expr (ns, it-> function , it->guard );
114
+ std::string t = from_expr (ns, function_id , it->guard );
115
115
while (t[ t.size ()-1 ]==' \n ' )
116
116
t = t.substr (0 , t.size ()-1 );
117
117
tmp << escape (t) << " ?" ;
118
118
}
119
119
}
120
120
else if (it->is_assume ())
121
121
{
122
- std::string t = from_expr (ns, it-> function , it->guard );
122
+ std::string t = from_expr (ns, function_id , it->guard );
123
123
while (t[ t.size ()-1 ]==' \n ' )
124
124
t = t.substr (0 , t.size ()-1 );
125
125
tmp << " Assume\\ n(" << escape (t) << " )" ;
126
126
}
127
127
else if (it->is_assert ())
128
128
{
129
- std::string t = from_expr (ns, it-> function , it->guard );
129
+ std::string t = from_expr (ns, function_id , it->guard );
130
130
while (t[ t.size ()-1 ]==' \n ' )
131
131
t = t.substr (0 , t.size ()-1 );
132
132
tmp << " Assert\\ n(" << escape (t) << " )" ;
@@ -145,7 +145,7 @@ void dott::write_dot_subgraph(
145
145
tmp.str (" Atomic End" );
146
146
else if (it->is_function_call ())
147
147
{
148
- std::string t = from_expr (ns, it-> function , it->code );
148
+ std::string t = from_expr (ns, function_id , it->code );
149
149
while (t[ t.size ()-1 ]==' \n ' )
150
150
t = t.substr (0 , t.size ()-1 );
151
151
tmp.str (escape (t));
@@ -162,7 +162,7 @@ void dott::write_dot_subgraph(
162
162
it->is_return () ||
163
163
it->is_other ())
164
164
{
165
- std::string t = from_expr (ns, it-> function , it->code );
165
+ std::string t = from_expr (ns, function_id , it->code );
166
166
while (t[ t.size ()-1 ]==' \n ' )
167
167
t = t.substr (0 , t.size ()-1 );
168
168
tmp.str (escape (t));
@@ -266,7 +266,7 @@ void dott::output(std::ostream &out)
266
266
267
267
forall_goto_functions (it, goto_model.goto_functions )
268
268
if (it->second .body_available ())
269
- write_dot_subgraph (out, id2string ( it->first ) , it->second .body );
269
+ write_dot_subgraph (out, it->first , it->second .body );
270
270
271
271
do_dot_function_calls (out);
272
272
0 commit comments