void goto_inline( goto_modelt &goto_model, message_handlert &message_handler, bool adjust_function) { const namespacet ns(goto_model.symbol_table); goto_inline( goto_model.goto_functions, ns, message_handler, adjust_function); }
void safety_preprocessingt::operator ()() { const namespacet ns(original_program.st); null_message_handlert null_msg; goto_functionst &gf=original_program.gf; goto_inline(gf, ns, null_msg); invariant_remove_loops_and_assertion(original_program); store_skolem_choices(original_program); add_skolem_labels(original_program); gf.update(); current_program=original_program; }
void goto_inline( goto_functionst &goto_functions, const namespacet &ns, message_handlert &message_handler, bool adjust_function) { goto_inlinet goto_inline( goto_functions, ns, message_handler, adjust_function); typedef goto_functionst::goto_functiont goto_functiont; // find entry point goto_functionst::function_mapt::iterator it= goto_functions.function_map.find(goto_functionst::entry_point()); if(it==goto_functions.function_map.end()) return; goto_functiont &goto_function=it->second; assert(goto_function.body_available()); // gather all calls // we use non-transitive inlining to avoid the goto program // copying that goto_inlinet would do otherwise goto_inlinet::inline_mapt inline_map; Forall_goto_functions(f_it, goto_functions) { goto_functiont &goto_function=f_it->second; if(!goto_function.body_available()) continue; goto_inlinet::call_listt &call_list=inline_map[f_it->first]; goto_programt &goto_program=goto_function.body; Forall_goto_program_instructions(i_it, goto_program) { if(!goto_inlinet::is_call(i_it)) continue; call_list.push_back(goto_inlinet::callt(i_it, false)); } }