31 assert(start->location_number<end->location_number);
32 assert(goto_program.
empty());
35 typedef std::map<goto_programt::const_targett, unsigned> target_mapt;
36 target_mapt target_map;
44 std::vector<goto_programt::targett> target_vector;
45 target_vector.reserve(target_map.size());
46 assert(target_vector.empty());
54 target_vector.push_back(t_new);
57 assert(goto_program.
instructions.size()==target_vector.size());
60 for(std::size_t target_index = 0; target_index < target_vector.size();
70 target_mapt::const_iterator m_it=target_map.find(tgt);
72 if(m_it!=target_map.end())
74 unsigned j=m_it->second;
76 assert(j<target_vector.size());
77 t->set_target(target_vector[j]);
90 std::vector<goto_programt::targett> iteration_points;
108 std::vector<goto_programt::targett> &iteration_points)
110 assert(iteration_points.empty());
111 assert(loop_head->location_number<loop_exit->location_number);
121 t->location_number=loop_head->location_number;
138 assert(t->is_backwards_goto());
142 if(!t->condition().is_true())
146 else if(loop_head->is_goto())
148 if(loop_head->get_target()==loop_exit)
149 exit_cond = loop_head->condition();
173 assert(!rest_program.
empty());
180 iteration_points.resize(k);
187 if(!t_before->is_goto() || !t_before->condition().is_true())
195 t_goto->location_number=loop_exit->location_number;
204 t_skip->location_number=loop_head->location_number;
212 iteration_points[0]=loop_iter;
223 if(t->get_target()==loop_head)
224 t->set_target(loop_iter);
228 for(
unsigned i=1; i<k; i++)
245 t_skip->location_number=loop_head->location_number;
252 if(!instruction.is_goto())
257 if(t->location_number>=loop_head->location_number &&
258 t->location_number<loop_exit->location_number)
260 instruction.set_target(t_skip);
285 std::cout <<
"Instruction:\n";
286 i_it->output(std::cout);
289 if(!i_it->is_backwards_goto())
298 auto limit=unwindset.
get_limit(loop_id, 0);
300 if(!limit.has_value())
313 function_id, goto_program, loop_head, loop_exit, *limit, unwind_strategy);
329 if(!goto_function.body_available())
333 std::cout <<
"Function: " << gf_entry.first <<
'\n';
338 unwind(gf_entry.first, goto_program, unwindset, unwind_strategy);
348 for(location_mapt::const_iterator it=
location_map.begin();
352 unsigned location_number=it->second;
356 {
"newLocationNumber",
359 json_unwound.
push_back(std::move(
object));
362 return std::move(json_result);