@@ -27,13 +27,11 @@ Author: Peter Schrammel
27
27
28
28
#include < memory>
29
29
30
- static exprt simplify_json_expr (const exprt &src, const namespacet &ns )
30
+ static exprt simplify_json_expr (const exprt &src)
31
31
{
32
32
if (src.id () == ID_constant)
33
33
{
34
- const typet &type = ns.follow (src.type ());
35
-
36
- if (type.id () == ID_pointer)
34
+ if (src.type ().id () == ID_pointer)
37
35
{
38
36
const constant_exprt &c = to_constant_expr (src);
39
37
@@ -44,7 +42,7 @@ static exprt simplify_json_expr(const exprt &src, const namespacet &ns)
44
42
to_unary_expr (src).op ().id () != ID_constant)
45
43
// try to simplify the constant pointer
46
44
{
47
- return simplify_json_expr (to_unary_expr (src).op (), ns );
45
+ return simplify_json_expr (to_unary_expr (src).op ());
48
46
}
49
47
}
50
48
}
@@ -56,7 +54,7 @@ static exprt simplify_json_expr(const exprt &src, const namespacet &ns)
56
54
.find (" @" ) != std::string::npos)
57
55
{
58
56
// simplify expressions of the form &member_expr(object, @class_identifier)
59
- return simplify_json_expr (to_address_of_expr (src).object (), ns );
57
+ return simplify_json_expr (to_address_of_expr (src).object ());
60
58
}
61
59
else if (
62
60
src.id () == ID_address_of &&
@@ -68,15 +66,15 @@ static exprt simplify_json_expr(const exprt &src, const namespacet &ns)
68
66
{
69
67
// simplify expressions of the form &array[0]
70
68
return simplify_json_expr (
71
- to_index_expr (to_address_of_expr (src).object ()).array (), ns );
69
+ to_index_expr (to_address_of_expr (src).object ()).array ());
72
70
}
73
71
else if (
74
72
src.id () == ID_member &&
75
73
id2string (to_member_expr (src).get_component_name ()).find (" @" ) !=
76
74
std::string::npos)
77
75
{
78
76
// simplify expressions of the form member_expr(object, @class_identifier)
79
- return simplify_json_expr (to_member_expr (src).struct_op (), ns );
77
+ return simplify_json_expr (to_member_expr (src).struct_op ());
80
78
}
81
79
82
80
return src;
@@ -287,7 +285,7 @@ json_objectt json(const exprt &expr, const namespacet &ns, const irep_idt &mode)
287
285
{
288
286
result[" name" ] = json_stringt (" pointer" );
289
287
result[" type" ] = json_stringt (type_string);
290
- exprt simpl_expr = simplify_json_expr (expr, ns );
288
+ exprt simpl_expr = simplify_json_expr (expr);
291
289
if (
292
290
simpl_expr.get (ID_value) == ID_NULL ||
293
291
// remove typecast on NULL
0 commit comments