File tree 5 files changed +50
-13
lines changed 5 files changed +50
-13
lines changed Original file line number Diff line number Diff line change @@ -132,11 +132,7 @@ jsont static_analysis_baset::output_json(
132
132
pretty_type << i_it->type ;
133
133
instruction_object[" instruction_type" ]=json_stringt (pretty_type.str ());
134
134
}
135
- {
136
- std::ostringstream state_text;
137
- get_state (i_it).output (ns, state_text);
138
- instruction_object[" state" ]=json_stringt (state_text.str ());
139
- }
135
+ instruction_object[" state" ]=get_state (i_it).output_json (ns);
140
136
retval.push_back (instruction_object);
141
137
}
142
138
Original file line number Diff line number Diff line change @@ -68,6 +68,11 @@ class domain_baset
68
68
{
69
69
}
70
70
71
+ virtual jsont output_json (const namespacet &ns) const
72
+ {
73
+ return json_stringt (" " );
74
+ }
75
+
71
76
typedef std::unordered_set<exprt, irep_hash> expr_sett;
72
77
73
78
// will go away
Original file line number Diff line number Diff line change 20
20
#include < util/arith_tools.h>
21
21
#include < util/pointer_offset_size.h>
22
22
#include < util/cprover_prefix.h>
23
+ #include < util/json_irep.h>
23
24
24
25
#include < util/c_types.h>
25
26
@@ -192,6 +193,33 @@ void value_sett::output(
192
193
}
193
194
}
194
195
196
+ jsont value_sett::output_json (const namespacet &) const
197
+ {
198
+ json_arrayt retval;
199
+ json_irept irep_converter (true );
200
+
201
+ for (const auto &name_values : values)
202
+ {
203
+ json_objectt json_entry;
204
+
205
+ json_entry[" id" ]=json_stringt (id2string (name_values.second .identifier ));
206
+ json_entry[" suffix" ]=json_stringt (id2string (name_values.second .suffix ));
207
+
208
+ json_arrayt vals;
209
+ for (const auto &obj_entry : name_values.second .object_map .read ())
210
+ {
211
+ vals.push_back (
212
+ irep_converter.convert_from_irep (object_numbering[obj_entry.first ]));
213
+ }
214
+
215
+ json_entry[" values" ]=vals;
216
+
217
+ retval.push_back (json_entry);
218
+ }
219
+
220
+ return retval;
221
+ }
222
+
195
223
exprt value_sett::to_expr (const object_map_dt::value_type &it) const
196
224
{
197
225
const exprt &object=object_numbering[it.first ];
Original file line number Diff line number Diff line change 14
14
15
15
#include < set>
16
16
17
+ #include < util/json.h>
17
18
#include < util/mp_arith.h>
18
19
#include < util/reference_counting.h>
19
20
@@ -206,6 +207,8 @@ class value_sett
206
207
const namespacet &ns,
207
208
std::ostream &out) const ;
208
209
210
+ jsont output_json (const namespacet &) const ;
211
+
209
212
valuest values;
210
213
211
214
// true = added something new
Original file line number Diff line number Diff line change @@ -30,34 +30,39 @@ class value_set_domaint:public domain_baset
30
30
return value_set.make_union (other.value_set );
31
31
}
32
32
33
- virtual void output (
33
+ void output (
34
34
const namespacet &ns,
35
- std::ostream &out) const
35
+ std::ostream &out) const override
36
36
{
37
37
value_set.output (ns, out);
38
38
}
39
39
40
- virtual void initialize (
40
+ jsont output_json (const namespacet &ns) const override
41
+ {
42
+ return value_set.output_json (ns);
43
+ }
44
+
45
+ void initialize (
41
46
const namespacet &ns,
42
- locationt l)
47
+ locationt l) override
43
48
{
44
49
value_set.clear ();
45
50
value_set.location_number =l->location_number ;
46
51
value_set.function =l->function ;
47
52
}
48
53
49
- virtual void get_reference_set (
54
+ void get_reference_set (
50
55
const namespacet &ns,
51
56
const exprt &expr,
52
- value_setst::valuest &dest)
57
+ value_setst::valuest &dest) override
53
58
{
54
59
value_set.get_reference_set (expr, dest, ns);
55
60
}
56
61
57
- virtual void transform (
62
+ void transform (
58
63
const namespacet &ns,
59
64
locationt from_l,
60
- locationt to_l)
65
+ locationt to_l) override
61
66
{
62
67
switch (from_l->type )
63
68
{
You can’t perform that action at this time.
0 commit comments