@@ -16,7 +16,7 @@ Author: Daniel Kroening, kroening@kroening.com
1616// / get all functions whose address is taken
1717void compute_address_taken_functions (
1818 const exprt &src,
19- std::set <irep_idt> &address_taken)
19+ std::unordered_set <irep_idt> &address_taken)
2020{
2121 forall_operands (it, src)
2222 compute_address_taken_functions (*it, address_taken);
@@ -35,7 +35,7 @@ void compute_address_taken_functions(
3535// / get all functions in the expression
3636void compute_functions (
3737 const exprt &src,
38- std::set <irep_idt> &address_taken)
38+ std::unordered_set <irep_idt> &address_taken)
3939{
4040 forall_operands (it, src)
4141 compute_functions (*it, address_taken);
@@ -48,7 +48,7 @@ void compute_functions(
4848// / get all functions whose address is taken
4949void compute_address_taken_functions (
5050 const goto_programt &goto_program,
51- std::set <irep_idt> &address_taken)
51+ std::unordered_set <irep_idt> &address_taken)
5252{
5353 forall_goto_program_instructions (it, goto_program)
5454 {
@@ -60,27 +60,27 @@ void compute_address_taken_functions(
6060// / get all functions whose address is taken
6161void compute_address_taken_functions (
6262 const goto_functionst &goto_functions,
63- std::set <irep_idt> &address_taken)
63+ std::unordered_set <irep_idt> &address_taken)
6464{
6565 forall_goto_functions (it, goto_functions)
6666 compute_address_taken_functions (it->second .body , address_taken);
6767}
6868
6969// / get all functions whose address is taken
70- std::set <irep_idt> compute_address_taken_functions (
71- const goto_functionst &goto_functions)
70+ std::unordered_set <irep_idt>
71+ compute_address_taken_functions ( const goto_functionst &goto_functions)
7272{
73- std::set <irep_idt> address_taken;
73+ std::unordered_set <irep_idt> address_taken;
7474 compute_address_taken_functions (goto_functions, address_taken);
7575 return address_taken;
7676}
7777
7878// / computes the functions that are (potentially) called
79- std::set <irep_idt> compute_called_functions (
80- const goto_functionst &goto_functions)
79+ std::unordered_set <irep_idt>
80+ compute_called_functions ( const goto_functionst &goto_functions)
8181{
82- std::set <irep_idt> working_queue;
83- std::set <irep_idt> functions;
82+ std::unordered_set <irep_idt> working_queue;
83+ std::unordered_set <irep_idt> functions;
8484
8585 // start from entry point
8686 working_queue.insert (goto_functions.entry_point ());
@@ -119,8 +119,8 @@ std::set<irep_idt> compute_called_functions(
119119}
120120
121121// / computes the functions that are (potentially) called
122- std::set <irep_idt> compute_called_functions (
123- const goto_modelt &goto_model)
122+ std::unordered_set <irep_idt>
123+ compute_called_functions ( const goto_modelt &goto_model)
124124{
125125 return compute_called_functions (goto_model.goto_functions );
126126}
0 commit comments