Skip to content

Commit 2773218

Browse files
committed
remove 7 deprecated goto-program API methods
This removes 7 methods from the goto-program API that have been deprecated since February, along with a few remaining uses.
1 parent a76195a commit 2773218

File tree

3 files changed

+4
-72
lines changed

3 files changed

+4
-72
lines changed

src/analyses/goto_check.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2001,14 +2001,10 @@ void goto_checkt::goto_check(
20012001
expr.id() == ID_rw_ok;
20022002
}))
20032003
{
2004-
const exprt &rhs = i.get_assign().rhs();
2004+
const exprt &rhs = i.assign_rhs();
20052005
auto rw_ok_cond = rw_ok_check(rhs);
20062006
if(rw_ok_cond.has_value())
2007-
{
2008-
auto new_assign = i.get_assign(); // copy
2009-
new_assign.rhs() = *rw_ok_cond;
2010-
i.set_assign(new_assign);
2011-
}
2007+
i.assign_rhs_nonconst() = *rw_ok_cond;
20122008
}
20132009
}
20142010
else if(i.is_function_call())

src/goto-instrument/contracts/contracts.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ void code_contractst::check_frame_conditions(
816816
if(instruction_it->is_decl())
817817
{
818818
// grab the declared symbol
819-
const auto &decl_symbol = instruction_it->get_decl().symbol();
819+
const auto &decl_symbol = instruction_it->decl_symbol();
820820
// move past the call and then insert the CAR
821821
instruction_it++;
822822
const auto car = assigns.add_to_write_set(decl_symbol);
@@ -838,7 +838,7 @@ void code_contractst::check_frame_conditions(
838838
}
839839
else if(instruction_it->is_dead())
840840
{
841-
assigns.remove_from_write_set(instruction_it->get_dead().symbol());
841+
assigns.remove_from_write_set(instruction_it->dead_symbol());
842842
}
843843
else if(
844844
instruction_it->is_other() &&

src/goto-programs/goto_program.h

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -229,26 +229,6 @@ class goto_programt
229229
return to_code_assign(code).rhs();
230230
}
231231

232-
/// Set the assignment for ASSIGN
233-
DEPRECATED(SINCE(2021, 2, 24, "Use assign_lhs/rhs instead"))
234-
void set_assign(code_assignt c)
235-
{
236-
PRECONDITION(is_assign());
237-
code = std::move(c);
238-
}
239-
240-
/// Get the declaration for DECL
241-
DEPRECATED(SINCE(2021, 2, 24, "Use decl_symbol instead"))
242-
const code_declt &get_decl() const
243-
{
244-
PRECONDITION(is_decl());
245-
const auto &decl = expr_checked_cast<code_declt>(code);
246-
INVARIANT(
247-
!decl.initial_value(),
248-
"code_declt in goto program may not contain initialization.");
249-
return decl;
250-
}
251-
252232
/// Get the declared symbol for DECL
253233
const symbol_exprt &decl_symbol() const
254234
{
@@ -271,26 +251,6 @@ class goto_programt
271251
return decl.symbol();
272252
}
273253

274-
/// Set the declaration for DECL
275-
DEPRECATED(SINCE(2021, 2, 24, "Use decl_symbol instead"))
276-
void set_decl(code_declt c)
277-
{
278-
PRECONDITION(is_decl());
279-
INVARIANT(
280-
!c.initial_value(),
281-
"Initialization must be separated from code_declt before adding to "
282-
"goto_instructiont.");
283-
code = std::move(c);
284-
}
285-
286-
/// Get the dead statement for DEAD
287-
DEPRECATED(SINCE(2021, 2, 24, "Use dead_symbol instead"))
288-
const code_deadt &get_dead() const
289-
{
290-
PRECONDITION(is_dead());
291-
return to_code_dead(code);
292-
}
293-
294254
/// Get the symbol for DEAD
295255
const symbol_exprt &dead_symbol() const
296256
{
@@ -305,22 +265,6 @@ class goto_programt
305265
return to_code_dead(code).symbol();
306266
}
307267

308-
/// Set the dead statement for DEAD
309-
DEPRECATED(SINCE(2021, 2, 24, "Use dead_symbol instead"))
310-
void set_dead(code_deadt c)
311-
{
312-
PRECONDITION(is_dead());
313-
code = std::move(c);
314-
}
315-
316-
/// Get the return statement for READ
317-
DEPRECATED(SINCE(2021, 2, 24, "Use return_value instead"))
318-
const code_returnt &get_return() const
319-
{
320-
PRECONDITION(is_set_return_value());
321-
return to_code_return(code);
322-
}
323-
324268
/// Get the return value of a SET_RETURN_VALUE instruction
325269
const exprt &return_value() const
326270
{
@@ -335,14 +279,6 @@ class goto_programt
335279
return to_code_return(code).return_value();
336280
}
337281

338-
/// Set the return statement for SET_RETURN_VALUE
339-
DEPRECATED(SINCE(2021, 2, 24, "Use return_value instead"))
340-
void set_return(code_returnt c)
341-
{
342-
PRECONDITION(is_set_return_value());
343-
code = std::move(c);
344-
}
345-
346282
/// Get the function call for FUNCTION_CALL
347283
#if 1
348284
DEPRECATED(SINCE(

0 commit comments

Comments
 (0)