|
18 | 18 | #include <sstream> |
19 | 19 | #include <string> |
20 | 20 |
|
| 21 | +#include <util/deprecate.h> |
21 | 22 | #include <util/invariant.h> |
22 | 23 | #include <util/namespace.h> |
23 | 24 | #include <util/source_location.h> |
@@ -232,13 +233,29 @@ class goto_programt |
232 | 233 | } |
233 | 234 |
|
234 | 235 | /// Get the return statement for READ |
| 236 | + DEPRECATED(SINCE(2021, 2, 24, "Use return_value instead")) |
235 | 237 | const code_returnt &get_return() const |
236 | 238 | { |
237 | 239 | PRECONDITION(is_return()); |
238 | 240 | return to_code_return(code); |
239 | 241 | } |
240 | 242 |
|
| 243 | + /// Get the return value of a RETURN instruction |
| 244 | + const exprt &return_value() const |
| 245 | + { |
| 246 | + PRECONDITION(is_return()); |
| 247 | + return to_code_return(code).return_value(); |
| 248 | + } |
| 249 | + |
| 250 | + /// Get the return value of a RETURN instruction |
| 251 | + exprt &return_value() |
| 252 | + { |
| 253 | + PRECONDITION(is_return()); |
| 254 | + return to_code_return(code).return_value(); |
| 255 | + } |
| 256 | + |
241 | 257 | /// Set the return statement for READ |
| 258 | + DEPRECATED(SINCE(2021, 2, 24, "Use return_value instead")) |
242 | 259 | void set_return(code_returnt c) |
243 | 260 | { |
244 | 261 | PRECONDITION(is_return()); |
|
0 commit comments