Skip to content

Commit 5f3303a

Browse files
author
Owen Jones
committed
Remove redundant irep_id_hash for unordered maps
1 parent aa48409 commit 5f3303a

Some content is hidden

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

41 files changed

+56
-78
lines changed

src/analyses/call_graph.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ class function_indicest
165165
call_grapht::directed_grapht &graph;
166166

167167
public:
168-
std::unordered_map<irep_idt, node_indext, irep_id_hash> function_indices;
168+
std::unordered_map<irep_idt, node_indext> function_indices;
169169

170170
explicit function_indicest(call_grapht::directed_grapht &graph):
171171
graph(graph)

src/analyses/call_graph.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class call_grapht
115115
friend class call_grapht;
116116

117117
/// Maps function names onto node indices
118-
std::unordered_map<irep_idt, node_indext, irep_id_hash> nodes_by_name;
118+
std::unordered_map<irep_idt, node_indext> nodes_by_name;
119119

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

126126
/// Type of the node name -> node index map.
127-
typedef
128-
std::unordered_map<irep_idt, node_indext, irep_id_hash> nodes_by_namet;
127+
typedef std::unordered_map<irep_idt, node_indext> nodes_by_namet;
129128

130129
/// Get the node name -> node index map
131130
/// \return node-by-name map

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/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 & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,8 @@ class expr2ct
6464

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

67-
std::unordered_map<irep_idt, std::unordered_set<irep_idt>, irep_id_hash>
68-
ns_collision;
69-
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;
7069

7170
unsigned sizeof_nesting;
7271

src/ansi-c/type2name.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ Author: Daniel Kroening, [email protected]
1919
#include <util/pointer_offset_size.h>
2020
#include <util/invariant.h>
2121

22-
typedef std::unordered_map<irep_idt, std::pair<size_t, bool>, irep_id_hash>
23-
symbol_numbert;
22+
typedef std::unordered_map<irep_idt, std::pair<size_t, bool>> symbol_numbert;
2423

2524
static std::string type2name(
2625
const typet &type,

src/cbmc/symex_bmc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class symex_bmct: public goto_symext
112112
unsigned max_unwind;
113113
bool max_unwind_is_set;
114114

115-
typedef std::unordered_map<irep_idt, unsigned, irep_id_hash> loop_limitst;
115+
typedef std::unordered_map<irep_idt, unsigned> loop_limitst;
116116
loop_limitst loop_limits;
117117

118118
typedef std::map<unsigned, loop_limitst> thread_loop_limitst;

0 commit comments

Comments
 (0)