@@ -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"
@@ -351,6 +353,50 @@ void dep_graph_domaint::output(
351
353
}
352
354
}
353
355
356
+ /* ******************************************************************\
357
+
358
+ Function: dep_graph_domaint::output_json
359
+
360
+ Inputs: The abstract interpreter and the namespace.
361
+
362
+ Outputs: The domain, formatted as a JSON object.
363
+
364
+ Purpose: Outputs the current value of the domain.
365
+
366
+ \*******************************************************************/
367
+
368
+
369
+ jsont dep_graph_domaint::output_json (
370
+ const ai_baset &ai,
371
+ const namespacet &ns) const
372
+ {
373
+ json_arrayt graph;
374
+
375
+ for (dep_graph_domaint::depst::const_iterator cdi=control_deps.begin ();
376
+ cdi!=control_deps.end ();
377
+ ++cdi)
378
+ {
379
+ json_objectt &link=graph.push_back ().make_object ();
380
+ link[" location_number" ] = json_numbert (std::to_string ((*cdi)->location_number ));
381
+ link[" source_location" ] = json_stringt ((*cdi)->source_location .as_string ());
382
+ link[" type" ]=json_stringt (" control" );
383
+ }
384
+
385
+ for (dep_graph_domaint::depst::const_iterator ddi=data_deps.begin ();
386
+ ddi!=data_deps.end ();
387
+ ++ddi)
388
+ {
389
+ json_objectt &link=graph.push_back ().make_object ();
390
+ link[" location_number" ] = json_numbert (std::to_string ((*ddi)->location_number ));
391
+ link[" source_location" ] = json_stringt ((*ddi)->source_location .as_string ());
392
+ link[" type" ]=json_stringt (" data" );
393
+ }
394
+
395
+ return graph;
396
+ }
397
+
398
+
399
+
354
400
/* ******************************************************************\
355
401
356
402
Function: dependence_grapht::add_dep
0 commit comments