File tree Expand file tree Collapse file tree 6 files changed +13
-20
lines changed
unit/java_bytecode/java_bytecode_convert_method Expand file tree Collapse file tree 6 files changed +13
-20
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ void uncaught_exceptions_domaint::transform(
77
77
join (type_id);
78
78
// we must consider all the subtypes given that
79
79
// the runtime type is a subtype of the static type
80
- std::vector<irep_idt> subtypes=
80
+ class_hierarchyt::idst subtypes =
81
81
class_hierarchy.get_children_trans (type_id);
82
82
join (subtypes);
83
83
}
@@ -98,7 +98,7 @@ void uncaught_exceptions_domaint::transform(
98
98
for (const auto &exc : exception_list)
99
99
{
100
100
last_caught.insert (exc.id ());
101
- std::vector<irep_idt> subtypes=
101
+ class_hierarchyt::idst subtypes =
102
102
class_hierarchy.get_children_trans (exc.id ());
103
103
last_caught.insert (subtypes.begin (), subtypes.end ());
104
104
}
Original file line number Diff line number Diff line change @@ -39,8 +39,8 @@ void class_hierarchyt::operator()(const symbol_tablet &symbol_table)
39
39
if (parent.empty ())
40
40
continue ;
41
41
42
- class_map[parent].children .push_back (symbol_pair.first );
43
- class_map[symbol_pair.first ].parents .push_back (parent);
42
+ class_map[parent].children .insert (symbol_pair.first );
43
+ class_map[symbol_pair.first ].parents .insert (parent);
44
44
}
45
45
}
46
46
}
@@ -94,7 +94,7 @@ void class_hierarchyt::get_children_trans_rec(
94
94
const entryt &entry=it->second ;
95
95
96
96
for (const auto &child : entry.children )
97
- dest.push_back (child);
97
+ dest.insert (child);
98
98
99
99
// recursive calls
100
100
for (const auto &child : entry.children )
@@ -116,7 +116,7 @@ void class_hierarchyt::get_parents_trans_rec(
116
116
const entryt &entry=it->second ;
117
117
118
118
for (const auto &child : entry.parents )
119
- dest.push_back (child);
119
+ dest.insert (child);
120
120
121
121
// recursive calls
122
122
for (const auto &child : entry.parents )
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ Date: April 2016
16
16
17
17
#include < iosfwd>
18
18
#include < map>
19
+ #include < set>
19
20
#include < unordered_map>
20
21
21
22
#include < util/graph.h>
@@ -24,7 +25,7 @@ Date: April 2016
24
25
class class_hierarchyt
25
26
{
26
27
public:
27
- typedef std::vector <irep_idt> idst;
28
+ typedef std::set <irep_idt> idst;
28
29
29
30
class entryt
30
31
{
Original file line number Diff line number Diff line change @@ -84,9 +84,9 @@ std::size_t remove_instanceoft::lower_instanceof(
84
84
" instanceof second operand should have a simple type" );
85
85
const irep_idt &target_name=
86
86
to_symbol_type (target_type).get_identifier ();
87
- std::vector<irep_idt> children=
87
+ class_hierarchyt::idst children =
88
88
class_hierarchy.get_children_trans (target_name);
89
- children.push_back (target_name);
89
+ children.insert (target_name);
90
90
91
91
// Insert an instruction before the new check that assigns the clsid we're
92
92
// checking for to a temporary, as GOTO program if-expressions should
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ resolve_inherited_componentt::inherited_componentt
78
78
else
79
79
{
80
80
if (!parents.empty ())
81
- classes_to_visit.push_back (parents.front ());
81
+ classes_to_visit.push_back (* parents.begin ());
82
82
}
83
83
}
84
84
Original file line number Diff line number Diff line change @@ -92,20 +92,12 @@ void validate_lambda_assignment(
92
92
class_hierarchy (symbol_table);
93
93
94
94
const auto &parents = class_hierarchy.get_parents_trans (tmp_class_identifier);
95
- REQUIRE_THAT (
96
- parents,
97
- // NOLINTNEXTLINE(whitespace/braces)
98
- Catch::Matchers::Vector::ContainsElementMatcher<irep_idt>{
99
- test_data.lambda_interface });
95
+ REQUIRE (parents.count (test_data.lambda_interface ) > 0 );
100
96
101
97
const auto &interface_children =
102
98
class_hierarchy.get_children_trans (test_data.lambda_interface );
103
99
104
- REQUIRE_THAT (
105
- interface_children,
106
- // NOLINTNEXTLINE(whitespace/braces)
107
- Catch::Matchers::Vector::ContainsElementMatcher<irep_idt>{
108
- tmp_class_identifier});
100
+ REQUIRE (interface_children.count (tmp_class_identifier) > 0 );
109
101
110
102
const java_class_typet::componentt super_class_component =
111
103
require_type::require_component (tmp_lambda_class_type, " @java.lang.Object" );
You can’t perform that action at this time.
0 commit comments