29 loop_idst::const_iterator l_it=loop_ids.begin();
32 if(l_it==loop_ids.end())
34 if(!it->is_backwards_goto())
37 const unsigned loop_id=it->loop_number;
50 g->source_location=loop_head->source_location;
51 g->function=loop_head->function;
55 if(l_it!=loop_ids.end())
57 message.
error() <<
"Loop " << *l_it <<
" not found" 66 const std::string &loop_ids,
74 std::string val=loop_ids.substr(idx, next-idx);
77 if(delim==std::string::npos)
80 std::string fn=val.substr(0, delim);
83 loop_map[fn].insert(nr);
85 if(next==std::string::npos)
95 const std::string &loop_ids,
107 loop_mapt::const_iterator it=loop_map.begin();
110 if(it==loop_map.end() || it->first<f_it->first)
112 else if(it->first==f_it->first)
114 if(
skip_loops(f_it->second.body, it->second, message))
119 if(it!=loop_map.end())
121 message.
error() <<
"No function " << it->first <<
" in goto program" Skip over selected loops by adding gotos.
targett insert_before(const_targett target)
Insertion before the given target.
std::map< irep_idt, loop_idst > loop_mapt
static bool skip_loops(goto_programt &goto_program, const loop_idst &loop_ids, messaget &message)
unsignedbv_typet size_type()
static mstreamt & eom(mstreamt &m)
std::set< unsigned > loop_idst
The boolean constant true.
instructionst::iterator targett
instructionst instructions
The list of instructions in the goto program.
A generic container class for the GOTO intermediate representation of one function.
unsigned safe_string2unsigned(const std::string &str, int base)
#define Forall_goto_functions(it, functions)
goto_programt & goto_program
#define Forall_goto_program_instructions(it, program)
goto_programt coverage_criteriont message_handlert & message_handler
const irept & find(const irep_namet &name) const
goto_functionst goto_functions
GOTO functions.
static bool parse_loop_ids(const std::string &loop_ids, loop_mapt &loop_map)