@@ -11,6 +11,8 @@ Date: August 2013
11
11
12
12
#include < cassert>
13
13
14
+ #include < util/json.h>
15
+
14
16
#include " goto_rw.h"
15
17
16
18
#include " dependence_graph.h"
@@ -345,6 +347,54 @@ void dep_graph_domaint::output(
345
347
}
346
348
}
347
349
350
+ /* ******************************************************************\
351
+
352
+ Function: dep_graph_domaint::output_json
353
+
354
+ Inputs: The abstract interpreter and the namespace.
355
+
356
+ Outputs: The domain, formatted as a JSON object.
357
+
358
+ Purpose: Outputs the current value of the domain.
359
+
360
+ \*******************************************************************/
361
+
362
+
363
+ jsont dep_graph_domaint::output_json (
364
+ const ai_baset &ai,
365
+ const namespacet &ns) const
366
+ {
367
+ json_arrayt graph;
368
+
369
+ for (dep_graph_domaint::depst::const_iterator cdi=control_deps.begin ();
370
+ cdi!=control_deps.end ();
371
+ ++cdi)
372
+ {
373
+ json_objectt &link=graph.push_back ().make_object ();
374
+ link[" location_number" ]=
375
+ json_numbert (std::to_string ((*cdi)->location_number ));
376
+ link[" source_location" ]=
377
+ json_stringt ((*cdi)->source_location .as_string ());
378
+ link[" type" ]=json_stringt (" control" );
379
+ }
380
+
381
+ for (dep_graph_domaint::depst::const_iterator ddi=data_deps.begin ();
382
+ ddi!=data_deps.end ();
383
+ ++ddi)
384
+ {
385
+ json_objectt &link=graph.push_back ().make_object ();
386
+ link[" location_number" ]=
387
+ json_numbert (std::to_string ((*ddi)->location_number ));
388
+ link[" source_location" ]=
389
+ json_stringt ((*ddi)->source_location .as_string ());
390
+ link[" type" ]=json_stringt (" data" );
391
+ }
392
+
393
+ return graph;
394
+ }
395
+
396
+
397
+
348
398
/* ******************************************************************\
349
399
350
400
Function: dependence_grapht::add_dep
0 commit comments