File tree Expand file tree Collapse file tree 4 files changed +13
-10
lines changed
jbmc/unit/java_bytecode/goto-programs Expand file tree Collapse file tree 4 files changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ SCENARIO(
47
47
std::stringstream output_dot_stream;
48
48
49
49
hierarchy (symbol_table);
50
- hierarchy.output (output_stream);
50
+ hierarchy.output (output_stream, false );
51
51
hierarchy.output_dot (output_dot_stream);
52
52
53
53
std::string output = output_stream.str ();
Original file line number Diff line number Diff line change @@ -659,7 +659,7 @@ int goto_instrument_parse_optionst::doit()
659
659
if (cmdline.isset (" dot" ))
660
660
hierarchy.output_dot (std::cout);
661
661
else
662
- hierarchy.output (std::cout);
662
+ hierarchy.output (std::cout, false );
663
663
664
664
return 0 ;
665
665
}
Original file line number Diff line number Diff line change @@ -30,6 +30,8 @@ void class_hierarchyt::operator()(const symbol_tablet &symbol_table)
30
30
{
31
31
const struct_typet &struct_type = to_struct_type (symbol_pair.second .type );
32
32
33
+ class_map[symbol_pair.first ].is_abstract = struct_type.get_bool (ID_abstract);
34
+
33
35
const irept::subt &bases=
34
36
struct_type.find (ID_bases).get_sub ();
35
37
@@ -123,17 +125,17 @@ void class_hierarchyt::get_parents_trans_rec(
123
125
get_parents_trans_rec (child, dest);
124
126
}
125
127
126
- void class_hierarchyt::output (std::ostream &out) const
128
+ void class_hierarchyt::output (std::ostream &out, bool children_only ) const
127
129
{
128
130
for (const auto &c : class_map)
129
131
{
130
- for (const auto &pa : c.second .parents )
131
- out << " Parent of " << c.first << " : "
132
- << pa << ' \n ' ;
133
-
132
+ if (!children_only)
133
+ {
134
+ for (const auto &pa : c.second .parents )
135
+ out << " Parent of " << c.first << " : " << pa << ' \n ' ;
136
+ }
134
137
for (const auto &ch : c.second .children )
135
- out << " Child of " << c.first << " : "
136
- << ch << ' \n ' ;
138
+ out << " Child of " << c.first << " : " << ch << ' \n ' ;
137
139
}
138
140
}
139
141
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ class class_hierarchyt
32
32
{
33
33
public:
34
34
idst parents, children;
35
+ bool is_abstract;
35
36
};
36
37
37
38
typedef std::map<irep_idt, entryt> class_mapt;
@@ -55,7 +56,7 @@ class class_hierarchyt
55
56
return result;
56
57
}
57
58
58
- void output (std::ostream &) const ;
59
+ void output (std::ostream &, bool children_only ) const ;
59
60
void output_dot (std::ostream &) const ;
60
61
61
62
protected:
You can’t perform that action at this time.
0 commit comments