12 #define USE_DEPRECATED_STATIC_ANALYSIS_H
30 else if(std::next(from) == to)
33 return from->get_condition();
42 if(to->is_end_function())
46 assert(to->is_function_call());
67 fixedpoint(function_identifier, goto_program, goto_functions);
72 std::ostream &out)
const
76 if(gf_entry.second.body_available())
79 out <<
"//// Function: " << gf_entry.first <<
"\n";
83 output(gf_entry.second.body, gf_entry.first, out);
91 std::ostream &out)
const
95 out <<
"**** " << i_it->location_number <<
" "
96 << i_it->source_location <<
"\n";
125 update(gf_entry.second.body);
153 assert(!working_set.empty());
155 working_sett::iterator i=working_set.begin();
157 working_set.erase(i);
163 const irep_idt &function_identifier,
178 while(!working_set.empty())
182 if(
visit(function_identifier, l, working_set, goto_program, goto_functions))
190 const irep_idt &function_identifier,
207 std::unique_ptr<statet> tmp_state(
210 statet &new_values=*tmp_state;
212 if(l->is_function_call())
229 ns, function_identifier, l, function_identifier, to_l);
233 bool have_new_values=
234 merge(other, new_values, to_l);
239 if(have_new_values || !other.
seen)
251 const goto_functionst::function_mapt::const_iterator f_it,
257 if(!goto_function.body_available())
260 assert(!goto_function.body.instructions.empty());
264 locationt l_begin=goto_function.body.instructions.begin();
268 tmp_state->
transform(
ns, calling_function, l_call, f_it->first, l_begin);
275 if(
merge(begin_state, *tmp_state, l_begin))
290 fixedpoint(f_it->first, goto_function.body, goto_functions);
296 locationt l_end=--goto_function.body.instructions.end();
298 assert(l_end->is_end_function());
303 std::unique_ptr<statet> tmp_state(
305 tmp_state->
transform(
ns, f_it->first, l_end, calling_function, l_return);
310 merge(new_state, *tmp_state, l_return);
316 ns, calling_function, l_call, calling_function, l_return);
324 const exprt &
function,
333 if(
function.
id()==ID_symbol)
345 goto_functionst::function_mapt::const_iterator it=
349 throw "failed to find function "+
id2string(identifier);
362 else if(
function.
id()==ID_if)
364 if(
function.operands().size()!=3)
365 throw "if takes three arguments";
387 merge(new_state, *n2, l_return);
389 else if(
function.
id()==ID_dereference)
392 std::list<exprt> values;
398 for(
const auto &value : values)
400 if(value.id()==ID_object_descriptor)
412 merge(new_state, *n2, l_return);
416 else if(
function.
id() == ID_null_object ||
417 function.
id() == ID_integer_address)
421 else if(
function.
id()==ID_member ||
function.
id()==ID_index)
425 else if(
function.
id()==
"builtin-function")
431 throw "unexpected function_call argument: "+
432 function.id_string();
444 fixedpoint(gf_entry.first, gf_entry.second.body, goto_functions);
466 const irep_idt &_function_identifier,
469 : function_identifier(_function_identifier),
470 goto_program(&_goto_program),
480 typedef std::list<wl_entryt> thread_wlt;
481 thread_wlt thread_wl;
487 if(is_threaded(t_it))
490 wl_entryt(gf_entry.first, gf_entry.second.body, t_it));
493 gf_entry.second.body.instructions.end();
504 bool new_shared=
true;
509 for(
const auto &thread : thread_wl)
515 merge(begin_state, shared_state, thread.location);
517 while(!working_set.empty())
522 thread.function_identifier,
525 *thread.goto_program,
531 if(l->is_end_function())
534 new_shared|=
merge_shared(shared_state, end_state, sh_target);