Skip to content

Commit 706e391

Browse files
author
Daniel Kroening
authored
Merge pull request #2093 from owen-jones-diffblue/owen-jones-diffblue/remove_unnecessary_irep_id_hash
Remove unnecessary uses of irep_id_hash
2 parents 290feb4 + e28a662 commit 706e391

File tree

72 files changed

+173
-216
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+173
-216
lines changed

src/analyses/call_graph.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ class function_indicest
172172
call_grapht::directed_grapht &graph;
173173

174174
public:
175-
std::unordered_map<irep_idt, node_indext, irep_id_hash> function_indices;
175+
std::unordered_map<irep_idt, node_indext> function_indices;
176176

177177
explicit function_indicest(call_grapht::directed_grapht &graph):
178178
graph(graph)

src/analyses/call_graph.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ class call_grapht
119119
friend class call_grapht;
120120

121121
/// Maps function names onto node indices
122-
std::unordered_map<irep_idt, node_indext, irep_id_hash> nodes_by_name;
122+
std::unordered_map<irep_idt, node_indext> nodes_by_name;
123123

124124
public:
125125
/// Find the graph node by function name
@@ -128,8 +128,7 @@ class call_grapht
128128
optionalt<node_indext> get_node_index(const irep_idt &function) const;
129129

130130
/// Type of the node name -> node index map.
131-
typedef
132-
std::unordered_map<irep_idt, node_indext, irep_id_hash> nodes_by_namet;
131+
typedef std::unordered_map<irep_idt, node_indext> nodes_by_namet;
133132

134133
/// Get the node name -> node index map
135134
/// \return node-by-name map

src/analyses/dirty.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ class dirtyt
3434

3535
public:
3636
bool initialized;
37-
typedef std::unordered_set<irep_idt, irep_id_hash> id_sett;
3837
typedef goto_functionst::goto_functiont goto_functiont;
3938

4039
/// \post dirtyt objects that are created through this constructor are not
@@ -72,7 +71,7 @@ class dirtyt
7271
return operator()(expr.get_identifier());
7372
}
7473

75-
const id_sett &get_dirty_ids() const
74+
const std::unordered_set<irep_idt> &get_dirty_ids() const
7675
{
7776
die_if_uninitialized();
7877
return dirty;
@@ -97,7 +96,7 @@ class dirtyt
9796
void build(const goto_functiont &goto_function);
9897

9998
// variables whose address is taken
100-
id_sett dirty;
99+
std::unordered_set<irep_idt> dirty;
101100

102101
void find_dirty(const exprt &expr);
103102
void find_dirty_address_of(const exprt &expr);
@@ -131,7 +130,7 @@ class incremental_dirtyt
131130

132131
private:
133132
dirtyt dirty;
134-
std::unordered_set<irep_idt, irep_id_hash> dirty_processed_functions;
133+
std::unordered_set<irep_idt> dirty_processed_functions;
135134
};
136135

137136
#endif // CPROVER_ANALYSES_DIRTY_H

src/analyses/invariant_propagation.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ void invariant_propagationt::add_objects(
4040
goto_program.get_decl_identifiers(locals);
4141

4242
// cache the list for the locals to speed things up
43-
typedef std::unordered_map<irep_idt, object_listt, irep_id_hash>
44-
object_cachet;
43+
typedef std::unordered_map<irep_idt, object_listt> object_cachet;
4544
object_cachet object_cache;
4645

4746
forall_goto_program_instructions(i_it, goto_program)
@@ -133,8 +132,7 @@ void invariant_propagationt::add_objects(
133132
const goto_programt &goto_program=f_it->second.body;
134133

135134
// cache the list for the locals to speed things up
136-
typedef std::unordered_map<irep_idt, object_listt, irep_id_hash>
137-
object_cachet;
135+
typedef std::unordered_map<irep_idt, object_listt> object_cachet;
138136
object_cachet object_cache;
139137

140138
forall_goto_program_instructions(i_it, goto_program)

src/analyses/reaching_definitions.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class sparse_bitvector_analysist
6060
protected:
6161
typedef typename std::map<V, std::size_t> inner_mapt;
6262
std::vector<typename inner_mapt::const_iterator> values;
63-
std::unordered_map<irep_idt, inner_mapt, irep_id_hash> value_map;
63+
std::unordered_map<irep_idt, inner_mapt> value_map;
6464
};
6565

6666
struct reaching_definitiont
@@ -191,15 +191,14 @@ class rd_range_domaint:public ai_domain_baset
191191
#ifdef USE_DSTRING
192192
typedef std::map<irep_idt, values_innert> valuest;
193193
#else
194-
typedef std::unordered_map<irep_idt, values_innert, irep_id_hash> valuest;
194+
typedef std::unordered_map<irep_idt, values_innert> valuest;
195195
#endif
196196
valuest values;
197197

198198
#ifdef USE_DSTRING
199199
typedef std::map<irep_idt, ranges_at_loct> export_cachet;
200200
#else
201-
typedef std::unordered_map<irep_idt, ranges_at_loct, irep_id_hash>
202-
export_cachet;
201+
typedef std::unordered_map<irep_idt, ranges_at_loct> export_cachet;
203202
#endif
204203
mutable export_cachet export_cache;
205204

src/ansi-c/ansi_c_scope.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ class ansi_c_scopet
4141
public:
4242
// This maps "scope names" (tag-X, label-X, X) to
4343
// ansi_c_identifiert.
44-
typedef std::unordered_map<irep_idt, ansi_c_identifiert, irep_id_hash>
45-
name_mapt;
44+
typedef std::unordered_map<irep_idt, ansi_c_identifiert> name_mapt;
4645
name_mapt name_map;
4746

4847
std::string prefix;

src/ansi-c/c_typecheck_base.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class c_typecheck_baset:
6969
const irep_idt mode;
7070
symbolt current_symbol;
7171

72-
typedef std::unordered_map<irep_idt, typet, irep_id_hash> id_type_mapt;
72+
typedef std::unordered_map<irep_idt, typet> id_type_mapt;
7373
id_type_mapt parameter_map;
7474

7575
// overload to use language specific syntax
@@ -270,7 +270,7 @@ class c_typecheck_baset:
270270
src.id()==ID_real;
271271
}
272272

273-
typedef std::unordered_map<irep_idt, irep_idt, irep_id_hash> asm_label_mapt;
273+
typedef std::unordered_map<irep_idt, irep_idt> asm_label_mapt;
274274
asm_label_mapt asm_label_map;
275275

276276
void apply_asm_label(const irep_idt &asm_label, symbolt &symbol);

src/ansi-c/c_typecheck_type.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,7 @@ void c_typecheck_baset::typecheck_compound_body(
877877
// scan for duplicate members
878878

879879
{
880-
std::unordered_set<irep_idt, irep_id_hash> members;
880+
std::unordered_set<irep_idt> members;
881881

882882
for(struct_union_typet::componentst::iterator
883883
it=components.begin();

src/ansi-c/expr2c.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1688,8 +1688,8 @@ std::string expr2ct::convert_symbol(
16881688
dest=src.op0().get_string(ID_identifier);
16891689
else
16901690
{
1691-
std::unordered_map<irep_idt, irep_idt, irep_id_hash>::const_iterator
1692-
entry=shorthands.find(id);
1691+
std::unordered_map<irep_idt, irep_idt>::const_iterator entry =
1692+
shorthands.find(id);
16931693
// we might be called from conversion of a type
16941694
if(entry==shorthands.end())
16951695
{

src/ansi-c/expr2c_class.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,8 @@ class expr2ct
6464

6565
static std::string indent_str(unsigned indent);
6666

67-
std::unordered_map<irep_idt,
68-
std::unordered_set<irep_idt, irep_id_hash>,
69-
irep_id_hash> ns_collision;
70-
std::unordered_map<irep_idt, irep_idt, irep_id_hash> shorthands;
67+
std::unordered_map<irep_idt, std::unordered_set<irep_idt>> ns_collision;
68+
std::unordered_map<irep_idt, irep_idt> shorthands;
7169

7270
unsigned sizeof_nesting;
7371

0 commit comments

Comments
 (0)