diff --git a/src/goto-programs/goto_instruction_code.h b/src/goto-programs/goto_instruction_code.h index f6d2c1a1538..a7621a40870 100644 --- a/src/goto-programs/goto_instruction_code.h +++ b/src/goto-programs/goto_instruction_code.h @@ -129,6 +129,11 @@ class code_deadt : public codet { } + code_deadt(symbol_exprt symbol, source_locationt loc) + : codet(ID_dead, {std::move(symbol)}, std::move(loc)) + { + } + symbol_exprt &symbol() { return static_cast(op0()); @@ -201,6 +206,11 @@ class code_declt : public codet { } + code_declt(symbol_exprt symbol, source_locationt loc) + : codet(ID_decl, {std::move(symbol)}, std::move(loc)) + { + } + symbol_exprt &symbol() { return static_cast(op0()); diff --git a/src/goto-programs/goto_program.h b/src/goto-programs/goto_program.h index 82aaa3b6f1a..1a7b1cbae5a 100644 --- a/src/goto-programs/goto_program.h +++ b/src/goto-programs/goto_program.h @@ -929,6 +929,13 @@ class goto_programt return instructiont(_code, l, OTHER, nil_exprt(), {}); } + static instructiont make_decl( + const code_declt &_code, + const source_locationt &l = source_locationt::nil()) + { + return instructiont(_code, l, DECL, nil_exprt(), {}); + } + static instructiont make_decl( const symbol_exprt &symbol, const source_locationt &l = source_locationt::nil()) @@ -936,6 +943,13 @@ class goto_programt return instructiont(code_declt(symbol), l, DECL, nil_exprt(), {}); } + static instructiont make_dead( + const code_deadt &_code, + const source_locationt &l = source_locationt::nil()) + { + return instructiont(_code, l, DEAD, nil_exprt(), {}); + } + static instructiont make_dead( const symbol_exprt &symbol, const source_locationt &l = source_locationt::nil()) @@ -1047,13 +1061,6 @@ class goto_programt code_assignt(std::move(lhs), std::move(rhs)), l, ASSIGN, nil_exprt(), {}); } - static instructiont make_decl( - const code_declt &_code, - const source_locationt &l = source_locationt::nil()) - { - return instructiont(_code, l, DECL, nil_exprt(), {}); - } - /// Create a function call instruction static instructiont make_function_call( const code_function_callt &_code,