Skip to content

Commit 63f192c

Browse files
committed
Switch to using a work set that orders by location number, in order to optimise the common case of forward propagation
1 parent 8393d16 commit 63f192c

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/goto-analyzer/taint_summary.cpp

+11-3
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,15 @@ static void initialise_domain(
206206

207207
/*******************************************************************\
208208
\*******************************************************************/
209-
typedef std::unordered_set<instruction_iteratort,
210-
instruction_iterator_hashert>
209+
210+
struct order_by_location_number {
211+
bool operator()(instruction_iteratort a, instruction_iteratort b)
212+
{
213+
return a->location_number < b->location_number;
214+
}
215+
};
216+
217+
typedef std::set<instruction_iteratort,order_by_location_number>
211218
solver_work_set_t;
212219

213220

@@ -1357,7 +1364,7 @@ taint_summary_ptrt taint_summarise_function(
13571364
*log << "<h2>Called sumfn::taint::taint_summarise_function( "
13581365
<< to_html_text(as_string(function_id)) << " )</h2>\n"
13591366
;
1360-
1367+
13611368
goto_functionst::function_mapt const& functions =
13621369
instrumented_program.goto_functions.function_map;
13631370
auto const fn_iter = functions.find(function_id);
@@ -1426,6 +1433,7 @@ taint_summary_ptrt taint_summarise_function(
14261433
{
14271434
instruction_iteratort const src_instr_it = *work_set.cbegin();
14281435
work_set.erase(work_set.cbegin());
1436+
14291437
++steps;
14301438

14311439
taint_map_from_lvalues_to_svaluest const& src_value =

0 commit comments

Comments
 (0)