Skip to content

Commit 92ac82c

Browse files
author
Owen Jones
committed
Remove redundant irep_id_hash for unordered maps
1 parent dc2b436 commit 92ac82c

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;

src/cpp/cpp_scopes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class cpp_scopest
6565
}
6666

6767
// mapping from function/class/scope names to their cpp_idt
68-
typedef std::unordered_map<irep_idt, cpp_idt *, irep_id_hash> id_mapt;
68+
typedef std::unordered_map<irep_idt, cpp_idt *> id_mapt;
6969
id_mapt id_map;
7070

7171
cpp_scopet *current_scope_ptr;

src/goto-instrument/count_eloc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ Date: December 2012
2222
#include <goto-programs/cfg.h>
2323

2424
typedef std::unordered_set<irep_idt> linest;
25-
typedef std::unordered_map<irep_idt, linest, irep_id_hash> filest;
26-
typedef std::unordered_map<irep_idt, filest, irep_id_hash> working_dirst;
25+
typedef std::unordered_map<irep_idt, linest> filest;
26+
typedef std::unordered_map<irep_idt, filest> working_dirst;
2727

2828
static void collect_eloc(
2929
const goto_modelt &goto_model,

src/goto-instrument/cover_basic_blocks.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class cover_basic_blocks_javat final : public cover_blocks_baset
125125
// map block number to its location
126126
std::vector<source_locationt> block_locations;
127127
// map java indexes to block indexes
128-
std::unordered_map<irep_idt, std::size_t, irep_id_hash> index_to_block;
128+
std::unordered_map<irep_idt, std::size_t> index_to_block;
129129

130130
public:
131131
explicit cover_basic_blocks_javat(const goto_programt &_goto_program);

src/goto-instrument/dump_c.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ void dump_ct::operator()(std::ostream &os)
8787
copied_symbol_table.add(symbol_pair.second);
8888
}
8989

90-
typedef std::unordered_map<irep_idt, unsigned, irep_id_hash> unique_tagst;
90+
typedef std::unordered_map<irep_idt, unsigned> unique_tagst;
9191
unique_tagst unique_tags;
9292

9393
// add tags to anonymous union/struct/enum,
@@ -770,8 +770,8 @@ void dump_ct::dump_typedefs(std::ostream &os) const
770770
std::map<std::string, typedef_infot> to_insert;
771771

772772
std::unordered_set<irep_idt> typedefs_done;
773-
std::unordered_map<irep_idt, std::unordered_set<irep_idt>, irep_id_hash>
774-
forward_deps, reverse_deps;
773+
std::unordered_map<irep_idt, std::unordered_set<irep_idt>> forward_deps,
774+
reverse_deps;
775775

776776
for(const auto &td : typedef_map)
777777
if(!td.second.type_decl_str.empty())

src/goto-instrument/dump_c_class.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ class dump_ct
5959

6060
system_library_symbolst system_symbols;
6161

62-
typedef std::unordered_map<irep_idt, irep_idt, irep_id_hash>
63-
declared_enum_constants_mapt;
62+
typedef std::unordered_map<irep_idt, irep_idt> declared_enum_constants_mapt;
6463
declared_enum_constants_mapt declared_enum_constants;
6564

6665
struct typedef_infot
@@ -129,8 +128,7 @@ class dump_ct
129128
const typet &type,
130129
std::ostream &os);
131130

132-
typedef std::unordered_map<irep_idt, code_declt, irep_id_hash>
133-
local_static_declst;
131+
typedef std::unordered_map<irep_idt, code_declt> local_static_declst;
134132

135133
void convert_global_variable(
136134
const symbolt &symbol,

src/goto-instrument/full_slicer_class.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class full_slicert
6262
typedef std::vector<cfgt::entryt> dep_node_to_cfgt;
6363
typedef std::stack<cfgt::entryt> queuet;
6464
typedef std::list<cfgt::entryt> jumpst;
65-
typedef std::unordered_map<irep_idt, queuet, irep_id_hash> decl_deadt;
65+
typedef std::unordered_map<irep_idt, queuet> decl_deadt;
6666

6767
void fixedpoint(
6868
goto_functionst &goto_functions,

src/goto-instrument/goto_program2code.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class goto_program2codet
2222
typedef std::list<irep_idt> id_listt;
2323
typedef std::map<goto_programt::const_targett, goto_programt::const_targett>
2424
loopt;
25-
typedef std::unordered_map<irep_idt, unsigned, irep_id_hash> dead_mapt;
25+
typedef std::unordered_map<irep_idt, unsigned> dead_mapt;
2626
typedef std::list<std::pair<goto_programt::const_targett, bool> >
2727
loop_last_stackt;
2828

src/goto-instrument/rw_set.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class rw_set_baset
5353
}
5454
};
5555

56-
typedef std::unordered_map<irep_idt, entryt, irep_id_hash> entriest;
56+
typedef std::unordered_map<irep_idt, entryt> entriest;
5757
entriest r_entries, w_entries;
5858

5959
void swap(rw_set_baset &other)

src/goto-programs/class_hierarchy.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ class class_hierarchy_grapht : public grapht<class_hierarchy_graph_nodet>
7575
{
7676
public:
7777
/// Maps class identifiers onto node indices
78-
typedef std::unordered_map<irep_idt, node_indext, irep_id_hash>
79-
nodes_by_namet;
78+
typedef std::unordered_map<irep_idt, node_indext> nodes_by_namet;
8079

8180
void populate(const symbol_tablet &);
8281

src/goto-programs/interpreter_class.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class interpretert:public messaget
104104

105105
const goto_functionst &goto_functions;
106106

107-
typedef std::unordered_map<irep_idt, mp_integer, irep_id_hash> memory_mapt;
107+
typedef std::unordered_map<irep_idt, mp_integer> memory_mapt;
108108
typedef std::map<mp_integer, irep_idt> inverse_memory_mapt;
109109
memory_mapt memory_map;
110110
inverse_memory_mapt inverse_memory_map;

src/goto-programs/string_abstraction.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,7 @@ void string_abstractiont::abstract(goto_programt &dest)
252252

253253
void string_abstractiont::declare_define_locals(goto_programt &dest)
254254
{
255-
typedef std::unordered_map<irep_idt, goto_programt::targett, irep_id_hash>
256-
available_declst;
255+
typedef std::unordered_map<irep_idt, goto_programt::targett> available_declst;
257256
available_declst available_decls;
258257

259258
Forall_goto_program_instructions(it, dest)

src/goto-programs/string_abstraction.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ class string_abstractiont:public messaget
134134
typet string_struct;
135135
goto_programt initialization;
136136

137-
typedef std::unordered_map<irep_idt, irep_idt, irep_id_hash> localst;
137+
typedef std::unordered_map<irep_idt, irep_idt> localst;
138138
localst locals;
139139

140140
void abstract(goto_programt &dest);

src/goto-symex/goto_symex_state.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ class goto_symex_statet final
192192
void get_l1_name(exprt &expr) const;
193193

194194
// this maps L1 names to (L2) types
195-
typedef std::unordered_map<irep_idt, typet, irep_id_hash> l1_typest;
195+
typedef std::unordered_map<irep_idt, typet> l1_typest;
196196
l1_typest l1_types;
197197

198198
public:
@@ -298,8 +298,7 @@ class goto_symex_statet final
298298
unsigned count;
299299
bool is_recursion;
300300
};
301-
typedef std::unordered_map<irep_idt, loop_infot, irep_id_hash>
302-
loop_iterationst;
301+
typedef std::unordered_map<irep_idt, loop_infot> loop_iterationst;
303302
loop_iterationst loop_iterations;
304303
};
305304

src/java_bytecode/character_refine_preprocess.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ class character_refine_preprocesst:public messaget
3636
typedef const code_function_callt &conversion_inputt;
3737
typedef codet (*conversion_functiont)(conversion_inputt &target);
3838
// A table tells us what method to call for each java method signature
39-
std::unordered_map<irep_idt, conversion_functiont, irep_id_hash>
40-
conversion_table;
39+
std::unordered_map<irep_idt, conversion_functiont> conversion_table;
4140

4241
// Conversion functions
4342
static exprt expr_of_char_count(const exprt &chr, const typet &type);

src/java_bytecode/java_static_initializers.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ codet get_clinit_wrapper_body(
3131
class stub_global_initializer_factoryt
3232
{
3333
/// Maps class symbols onto the stub globals that belong to them
34-
typedef std::unordered_multimap<irep_idt, irep_idt, irep_id_hash>
35-
stub_globals_by_classt;
34+
typedef std::unordered_multimap<irep_idt, irep_idt> stub_globals_by_classt;
3635
stub_globals_by_classt stub_globals_by_class;
3736

3837
public:

src/java_bytecode/java_string_library_preprocess.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,10 @@ class java_string_library_preprocesst:public messaget
105105
symbol_table_baset &)>
106106
conversion_functiont;
107107

108-
typedef std::unordered_map<irep_idt, irep_idt, irep_id_hash> id_mapt;
108+
typedef std::unordered_map<irep_idt, irep_idt> id_mapt;
109109

110110
// Table mapping each java method signature to the code generating function
111-
std::unordered_map<irep_idt, conversion_functiont, irep_id_hash>
112-
conversion_table;
111+
std::unordered_map<irep_idt, conversion_functiont> conversion_table;
113112

114113
// Some Java functions have an equivalent in the solver that we will
115114
// call with the same argument and will return the same result

src/java_bytecode/select_pointer_type.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include <stack>
1717
#include "java_types.h"
1818

19-
typedef std::unordered_map<irep_idt, std::stack<reference_typet>, irep_id_hash>
19+
typedef std::unordered_map<irep_idt, std::stack<reference_typet>>
2020
generic_parameter_specialization_mapt;
2121

2222
class namespacet;

src/java_bytecode/synthetic_methods_map.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ enum class synthetic_method_typet
3434
};
3535

3636
/// Maps method names on to a synthetic method kind.
37-
typedef std::unordered_map<irep_idt, synthetic_method_typet, irep_id_hash>
37+
typedef std::unordered_map<irep_idt, synthetic_method_typet>
3838
synthetic_methods_mapt;
3939

4040
#endif

src/linking/linking_class.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,7 @@ class linkingt:public typecheckt
171171
namespacet ns;
172172

173173
// X -> Y iff Y uses X for new symbol type IDs X and Y
174-
typedef std::unordered_map<irep_idt,
175-
std::unordered_set<irep_idt>,
176-
irep_id_hash>
177-
used_byt;
174+
typedef std::unordered_map<irep_idt, std::unordered_set<irep_idt>> used_byt;
178175

179176
irep_idt rename(irep_idt);
180177

src/pointer-analysis/value_set_analysis_fi.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ void value_set_analysis_fit::add_vars(
4747
goto_program.get_decl_identifiers(locals);
4848

4949
// cache the list for the locals to speed things up
50-
typedef std::unordered_map<irep_idt, entry_listt, irep_id_hash> entry_cachet;
50+
typedef std::unordered_map<irep_idt, entry_listt> entry_cachet;
5151
entry_cachet entry_cache;
5252

5353
value_set_fit &v=state.value_set;

src/pointer-analysis/value_set_analysis_fivr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ void value_set_analysis_fivrt::add_vars(
4747
goto_program.get_decl_identifiers(locals);
4848

4949
// cache the list for the locals to speed things up
50-
typedef std::unordered_map<irep_idt, entry_listt, irep_id_hash> entry_cachet;
50+
typedef std::unordered_map<irep_idt, entry_listt> entry_cachet;
5151
entry_cachet entry_cache;
5252

5353
value_set_fivrt &v=state.value_set;

src/pointer-analysis/value_set_analysis_fivrns.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ void value_set_analysis_fivrnst::add_vars(
4747
goto_program.get_decl_identifiers(locals);
4848

4949
// cache the list for the locals to speed things up
50-
typedef std::unordered_map<irep_idt, entry_listt, irep_id_hash> entry_cachet;
50+
typedef std::unordered_map<irep_idt, entry_listt> entry_cachet;
5151
entry_cachet entry_cache;
5252

5353
value_set_fivrnst &v=state.value_set;

src/solvers/cvc/cvc_conv.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ class cvc_convt:public prop_convt
5555
}
5656
};
5757

58-
typedef std::unordered_map<irep_idt, identifiert, irep_id_hash>
59-
identifier_mapt;
58+
typedef std::unordered_map<irep_idt, identifiert> identifier_mapt;
6059

6160
identifier_mapt identifier_map;
6261

0 commit comments

Comments
 (0)