Skip to content

Commit a508bca

Browse files
authored
Merge pull request #6252 from diffblue/cleanup_make_return
remove unusuable goto_programt::make_return variant
2 parents d6fe178 + 768a2c7 commit a508bca

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

src/goto-programs/goto_program.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -901,12 +901,6 @@ class goto_programt
901901
}
902902
}
903903

904-
static instructiont
905-
make_return(const source_locationt &l = source_locationt::nil())
906-
{
907-
return instructiont(code_returnt(), l, SET_RETURN_VALUE, nil_exprt(), {});
908-
}
909-
910904
static instructiont make_return(
911905
code_returnt c,
912906
const source_locationt &l = source_locationt::nil())

unit/goto-instrument/cover_instrument.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ TEST_CASE("cover_intrument_end_of_function", "[core]")
1717
goto_programt::make_function_call(code_function_callt({}, {})));
1818
goto_program.add(
1919
goto_programt::make_function_call(code_function_callt({}, {})));
20-
goto_program.add(goto_programt::make_return());
20+
goto_program.add(goto_programt::make_end_function());
2121
// Act
2222
cover_instrument_end_of_function(
2323
"foo", goto_program, goto_programt::make_assertion);
@@ -37,7 +37,7 @@ TEST_CASE("cover_instrument_end_of_function with custom expression", "[core]")
3737
goto_programt::make_function_call(code_function_callt({}, {})));
3838
goto_program.add(
3939
goto_programt::make_function_call(code_function_callt({}, {})));
40-
goto_program.add(goto_programt::make_return());
40+
goto_program.add(goto_programt::make_end_function());
4141
const cover_instrumenter_baset::assertion_factoryt assertion_factory =
4242
[](const exprt &, const source_locationt &location) {
4343
return goto_programt::make_assertion(true_exprt{}, location);

unit/goto-programs/goto_program_validate.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,8 @@ SCENARIO("Validation of a goto program", "[core][goto-programs][validate]")
197197
auto &function_map = goto_model.goto_functions.function_map;
198198
auto it = function_map.find("g");
199199
auto &instructions = it->second.body.instructions;
200-
instructions.insert(instructions.begin(), goto_programt::make_return());
200+
instructions.insert(
201+
instructions.begin(), goto_programt::make_return(code_returnt()));
201202

202203
goto_model_validation_optionst validation_options{
203204
goto_model_validation_optionst ::set_optionst::all_false};

0 commit comments

Comments
 (0)