Skip to content

Commit 1b2d5d6

Browse files
author
Daniel Kroening
committed
add goto_programt::make_return(c, l)
This avoids modification of instructiont::code after the object's creation.
1 parent 89d4fa7 commit 1b2d5d6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/goto-programs/goto_program.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -814,6 +814,12 @@ class goto_programt
814814
return instructiont(code_returnt(), irep_idt(), l, RETURN, nil_exprt(), {});
815815
}
816816

817+
static instructiont
818+
make_return(code_returnt c, const source_locationt &l = source_locationt::nil())
819+
{
820+
return instructiont(std::move(c), irep_idt(), l, RETURN, nil_exprt(), {});
821+
}
822+
817823
static instructiont
818824
make_skip(const source_locationt &l = source_locationt::nil())
819825
{

0 commit comments

Comments
 (0)