@@ -41,7 +41,7 @@ class dott
41
41
42
42
unsigned subgraphscount;
43
43
44
- std::list<exprt> function_calls;
44
+ std::list<std::pair<std::string, exprt> > function_calls;
45
45
std::list<exprt> clusters;
46
46
47
47
void
@@ -145,17 +145,16 @@ 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, function_id, it->code );
148
+ const auto &function_call = it->get_function_call ();
149
+ std::string t = from_expr (ns, function_id, function_call);
149
150
while (t[ t.size ()-1 ]==' \n ' )
150
151
t = t.substr (0 , t.size ()-1 );
151
152
tmp.str (escape (t));
152
153
153
- exprt fc;
154
154
std::stringstream ss;
155
155
ss << " Node_" << subgraphscount << " _" << it->location_number ;
156
- fc.operands ().push_back (exprt (ss.str ()));
157
- fc.operands ().push_back (it->code .op1 ());
158
- function_calls.push_back (fc);
156
+ function_calls.push_back (
157
+ std::pair<std::string, exprt>(ss.str (), function_call.function ()));
159
158
}
160
159
else if (it->is_assign () ||
161
160
it->is_decl () ||
@@ -224,36 +223,40 @@ void dott::write_dot_subgraph(
224
223
void dott::do_dot_function_calls (
225
224
std::ostream &out)
226
225
{
227
- for (const auto &expr : function_calls)
226
+ for (const auto &call : function_calls)
228
227
{
229
228
std::list<exprt>::const_iterator cit=clusters.begin ();
230
229
for ( ; cit!=clusters.end (); cit++)
231
- if (cit->get (" name" )==expr. op1 () .get (ID_identifier))
230
+ if (cit->get (" name" ) == call. second .get (ID_identifier))
232
231
break ;
233
232
234
233
if (cit!=clusters.end ())
235
234
{
236
- out << expr.op0 ().id () <<
237
- " -> " " Node_" << cit->get (" nr" ) << " _0" <<
238
- " [lhead=\" cluster_" << expr.op1 ().get (ID_identifier) << " \" ," <<
239
- " color=blue];\n " ;
235
+ out << call.first
236
+ << " -> "
237
+ " Node_"
238
+ << cit->get (" nr" ) << " _0"
239
+ << " [lhead=\" cluster_" << call.second .get (ID_identifier) << " \" ,"
240
+ << " color=blue];\n " ;
240
241
}
241
242
else
242
243
{
243
- out << " subgraph \" cluster_" << expr. op1 () .get (ID_identifier) <<
244
- " \" {\n " ;
244
+ out << " subgraph \" cluster_" << call. second .get (ID_identifier)
245
+ << " \" {\n " ;
245
246
out << " rank=sink;\n " ;
246
- out << " label=\" " << expr. op1 () .get (ID_identifier) << " \" ;\n " ;
247
+ out << " label=\" " << call. second .get (ID_identifier) << " \" ;\n " ;
247
248
out << " Node_" << subgraphscount << " _0 " <<
248
249
" [shape=Mrecord,fontsize=22,label=\" ?\" ];\n " ;
249
250
out << " }\n " ;
250
251
clusters.push_back (exprt (" cluster" ));
251
- clusters.back ().set (" name" , expr. op1 () .get (ID_identifier));
252
+ clusters.back ().set (" name" , call. second .get (ID_identifier));
252
253
clusters.back ().set (" nr" , subgraphscount);
253
- out << expr.op0 ().id () <<
254
- " -> " " Node_" << subgraphscount << " _0" <<
255
- " [lhead=\" cluster_" << expr.op1 ().get (" identifier" ) << " \" ," <<
256
- " color=blue];\n " ;
254
+ out << call.first
255
+ << " -> "
256
+ " Node_"
257
+ << subgraphscount << " _0"
258
+ << " [lhead=\" cluster_" << call.second .get (" identifier" ) << " \" ,"
259
+ << " color=blue];\n " ;
257
260
subgraphscount++;
258
261
}
259
262
}
0 commit comments