Skip to content

Commit 02f68bb

Browse files
author
Daniel Kroening
committed
deprecate old instructiont API
We now avoid construction followed by overwriting, and construct the final object directly.
1 parent e91d3e1 commit 02f68bb

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

src/goto-programs/goto_program.h

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ class goto_programt
178178
class instructiont final
179179
{
180180
public:
181+
/// Do not read or modify directly -- use get_X() instead
181182
codet code;
182183

183184
/// Get the assignment for ASSIGN
@@ -352,34 +353,64 @@ class goto_programt
352353
clear(SKIP);
353354
}
354355

356+
DEPRECATED("use goto_programt::make_return() instead")
355357
void make_return() { clear(RETURN); }
358+
359+
DEPRECATED("use goto_programt::make_skip() instead")
356360
void make_skip() { clear(SKIP); }
361+
362+
DEPRECATED("use goto_programt::make_location() instead")
357363
void make_location(const source_locationt &l)
358364
{ clear(LOCATION); source_location=l; }
365+
366+
DEPRECATED("use goto_programt::make_throw() instead")
359367
void make_throw() { clear(THROW); }
368+
369+
DEPRECATED("use goto_programt::make_catch() instead")
360370
void make_catch() { clear(CATCH); }
371+
372+
DEPRECATED("use goto_programt::make_assertion() instead")
361373
void make_assertion(const exprt &g) { clear(ASSERT); guard=g; }
374+
375+
DEPRECATED("use goto_programt::make_assumption() instead")
362376
void make_assumption(const exprt &g) { clear(ASSUME); guard=g; }
377+
378+
DEPRECATED("use goto_programt::make_assignment() instead")
363379
void make_assignment() { clear(ASSIGN); }
380+
381+
DEPRECATED("use goto_programt::make_other() instead")
364382
void make_other(const codet &_code) { clear(OTHER); code=_code; }
383+
384+
DEPRECATED("use goto_programt::make_decl() instead")
365385
void make_decl() { clear(DECL); }
386+
387+
DEPRECATED("use goto_programt::make_dead() instead")
366388
void make_dead() { clear(DEAD); }
389+
390+
DEPRECATED("use goto_programt::make_atomic_begin() instead")
367391
void make_atomic_begin() { clear(ATOMIC_BEGIN); }
392+
393+
DEPRECATED("use goto_programt::make_atomic_end() instead")
368394
void make_atomic_end() { clear(ATOMIC_END); }
395+
396+
DEPRECATED("use goto_programt::make_atomic_end_function() instead")
369397
void make_end_function() { clear(END_FUNCTION); }
370398

399+
DEPRECATED("use goto_programt::make_incomplete_goto() instead")
371400
void make_incomplete_goto(const code_gotot &_code)
372401
{
373402
clear(INCOMPLETE_GOTO);
374403
code = _code;
375404
}
376405

406+
DEPRECATED("use goto_programt::make_goto() instead")
377407
void make_goto(targett _target)
378408
{
379409
clear(GOTO);
380410
targets.push_back(_target);
381411
}
382412

413+
DEPRECATED("use goto_programt::make_goto() instead")
383414
void make_goto(targett _target, const exprt &g)
384415
{
385416
make_goto(_target);
@@ -394,18 +425,21 @@ class goto_programt
394425
type = GOTO;
395426
}
396427

428+
DEPRECATED("use goto_programt::make_assignment() instead")
397429
void make_assignment(const code_assignt &_code)
398430
{
399431
clear(ASSIGN);
400432
code=_code;
401433
}
402434

435+
DEPRECATED("use goto_programt::make_decl() instead")
403436
void make_decl(const code_declt &_code)
404437
{
405438
clear(DECL);
406439
code=_code;
407440
}
408441

442+
DEPRECATED("use goto_programt::make_function_call() instead")
409443
void make_function_call(const code_function_callt &_code)
410444
{
411445
clear(FUNCTION_CALL);

0 commit comments

Comments
 (0)