@@ -328,7 +328,8 @@ class goto_programt
328328 goto_program_instruction_typet type;
329329
330330 // / Guard for gotos, assume, assert
331- // / Use get_condition() to read, and set_condition(c) to write.
331+ // / Use condition() method to access.
332+ // / This member will eventually be protected.
332333 exprt guard;
333334
334335 // / Does this instruction have a condition?
@@ -338,19 +339,35 @@ class goto_programt
338339 }
339340
340341 // / Get the condition of gotos, assume, assert
342+ DEPRECATED (SINCE(2021 , 10 , 12 , " Use condition() instead" ))
341343 const exprt &get_condition () const
342344 {
343345 PRECONDITION (has_condition ());
344346 return guard;
345347 }
346348
347349 // / Set the condition of gotos, assume, assert
350+ DEPRECATED (SINCE(2021 , 10 , 12 , " Use condition_nonconst() instead" ))
348351 void set_condition (exprt c)
349352 {
350353 PRECONDITION (has_condition ());
351354 guard = std::move (c);
352355 }
353356
357+ // / Get the condition of gotos, assume, assert
358+ const exprt &condition () const
359+ {
360+ PRECONDITION (has_condition ());
361+ return guard;
362+ }
363+
364+ // / Get the condition of gotos, assume, assert
365+ exprt &condition_nonconst ()
366+ {
367+ PRECONDITION (has_condition ());
368+ return guard;
369+ }
370+
354371 // The below will eventually become a single target only.
355372 // / The target for gotos and for start_thread nodes
356373 typedef std::list<instructiont>::iterator targett;
0 commit comments