12 #define USE_DEPRECATED_STATIC_ANALYSIS_H
29 else if(std::next(from) == to)
32 return from->condition();
41 if(to->is_end_function())
45 assert(to->is_function_call());
47 return to->call_lhs();
63 fixedpoint(function_identifier, goto_program, goto_functions);
68 std::ostream &out)
const
72 if(gf_entry.second.body_available())
75 out <<
"//// Function: " << gf_entry.first <<
"\n";
79 output(gf_entry.second.body, gf_entry.first, out);
87 std::ostream &out)
const
91 out <<
"**** " << i_it->location_number <<
" " << i_it->source_location()
121 update(gf_entry.second.body);
149 assert(!working_set.empty());
151 working_sett::iterator i=working_set.begin();
153 working_set.erase(i);
159 const irep_idt &function_identifier,
174 while(!working_set.empty())
178 if(
visit(function_identifier, l, working_set, goto_program, goto_functions))
186 const irep_idt &function_identifier,
203 std::unique_ptr<statet> tmp_state(
206 statet &new_values=*tmp_state;
208 if(l->is_function_call())
222 ns, function_identifier, l, function_identifier, to_l);
226 bool have_new_values=
227 merge(other, new_values, to_l);
232 if(have_new_values || !other.
seen)
244 const goto_functionst::function_mapt::const_iterator f_it,
250 if(!goto_function.body_available())
253 assert(!goto_function.body.instructions.empty());
257 locationt l_begin=goto_function.body.instructions.begin();
261 tmp_state->
transform(
ns, calling_function, l_call, f_it->first, l_begin);
268 if(
merge(begin_state, *tmp_state, l_begin))
283 fixedpoint(f_it->first, goto_function.body, goto_functions);
289 locationt l_end=--goto_function.body.instructions.end();
291 assert(l_end->is_end_function());
296 std::unique_ptr<statet> tmp_state(
298 tmp_state->
transform(
ns, f_it->first, l_end, calling_function, l_return);
303 merge(new_state, *tmp_state, l_return);
309 ns, calling_function, l_call, calling_function, l_return);
317 const exprt &
function,
326 if(
function.
id()==ID_symbol)
338 goto_functionst::function_mapt::const_iterator it=
342 throw "failed to find function "+
id2string(identifier);
355 else if(
function.
id()==ID_if)
357 if(
function.operands().size()!=3)
358 throw "if takes three arguments";
380 merge(new_state, *n2, l_return);
382 else if(
function.
id()==ID_dereference)
385 std::list<exprt> values;
391 for(
const auto &value : values)
393 if(value.id()==ID_object_descriptor)
405 merge(new_state, *n2, l_return);
409 else if(
function.
id() == ID_null_object ||
410 function.
id() == ID_integer_address)
414 else if(
function.
id()==ID_member ||
function.
id()==ID_index)
418 else if(
function.
id()==
"builtin-function")
424 throw "unexpected function_call argument: "+
425 function.id_string();
437 fixedpoint(gf_entry.first, gf_entry.second.body, goto_functions);
459 const irep_idt &_function_identifier,
462 : function_identifier(_function_identifier),
463 goto_program(&_goto_program),
473 typedef std::list<wl_entryt> thread_wlt;
474 thread_wlt thread_wl;
480 if(is_threaded(t_it))
483 wl_entryt(gf_entry.first, gf_entry.second.body, t_it));
486 gf_entry.second.body.instructions.end();
497 bool new_shared=
true;
502 for(
const auto &thread : thread_wl)
508 merge(begin_state, shared_state, thread.location);
510 while(!working_set.empty())
515 thread.function_identifier,
518 *thread.goto_program,
524 if(l->is_end_function())
527 new_shared|=
merge_shared(shared_state, end_state, sh_target);