File tree 1 file changed +10
-4
lines changed
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -645,20 +645,26 @@ class goto_programt
645
645
instructions.splice (target, p.instructions );
646
646
}
647
647
648
+ // / Adds a given instruction at the end.
649
+ // / \return The newly added instruction.
650
+ targett add (instructiont &&instruction)
651
+ {
652
+ instructions.push_back (std::move (instruction));
653
+ return --instructions.end ();
654
+ }
655
+
648
656
// / Adds an instruction at the end.
649
657
// / \return The newly added instruction.
650
658
targett add_instruction ()
651
659
{
652
- instructions.push_back (instructiont ());
653
- return --instructions.end ();
660
+ return add (instructiont ());
654
661
}
655
662
656
663
// / Adds an instruction of given type at the end.
657
664
// / \return The newly added instruction.
658
665
targett add_instruction (goto_program_instruction_typet type)
659
666
{
660
- instructions.push_back (instructiont (type));
661
- return --instructions.end ();
667
+ return add (instructiont (type));
662
668
}
663
669
664
670
// / Output goto program to given stream
You can’t perform that action at this time.
0 commit comments