void scratch_programt::append(goto_programt::instructionst &new_instructions) { instructions.insert( instructions.end(), new_instructions.begin(), new_instructions.end()); }
void insert_program(goto_programt &body, goto_programt::targett pos, const goto_programt::instructionst &prog, const replacementst &replacements) { copy_instructionst copy_instr; insert_instrt insert_instr(copy_instr, body, pos, replacements); goto_programt::const_targett first=prog.begin(); goto_programt::const_targett last=prog.end(); if (first == last) return; --last; for (; first != last; ++first) insert_instr(first); copy_instr.finalize(++pos, last); }
goto_programt::targett find_instruction( const xmlt &xml, goto_programt::instructionst &instructions, const irep_idt &label) { goto_programt::targett ins_it=instructions.begin(); xmlt::elementst::const_iterator it=xml.elements.begin(); for(; it != xml.elements.end() && ins_it!=instructions.end(); it++) { if(label==it->get_attribute("targetlabel")) return ins_it; ins_it++; } return instructions.end(); }