@@ -27,20 +27,11 @@ Module: Read Goto Programs
27
27
#include " elf_reader.h"
28
28
#include " osx_fat_reader.h"
29
29
30
- // / \brief Read a goto binary from a file, but do not update \ref config
31
- // / \param filename: the file name of the goto binary
32
- // / \param dest: the goto model returned
33
- // / \param message_handler: for diagnostics
34
- // / \deprecated Use read_goto_binary(file, message_handler) instead
35
- // / \return true on failure, false on success
36
- bool read_goto_binary (
30
+ static bool read_goto_binary (
37
31
const std::string &filename,
38
- goto_modelt &dest,
39
- message_handlert &message_handler)
40
- {
41
- return read_goto_binary (
42
- filename, dest.symbol_table , dest.goto_functions , message_handler);
43
- }
32
+ symbol_tablet &,
33
+ goto_functionst &,
34
+ message_handlert &);
44
35
45
36
// / \brief Read a goto binary from a file, but do not update \ref config
46
37
// / \param filename: the file name of the goto binary
@@ -66,7 +57,7 @@ read_goto_binary(const std::string &filename, message_handlert &message_handler)
66
57
// / \param goto_functions: the goto functions from the goto binary
67
58
// / \param message_handler: for diagnostics
68
59
// / \return true on failure, false on success
69
- bool read_goto_binary (
60
+ static bool read_goto_binary (
70
61
const std::string &filename,
71
62
symbol_tablet &symbol_table,
72
63
goto_functionst &goto_functions,
@@ -240,17 +231,13 @@ bool read_object_and_link(
240
231
<< file_name << messaget::eom;
241
232
242
233
// we read into a temporary model
243
- goto_modelt temp_model;
244
-
245
- if (read_goto_binary (
246
- file_name,
247
- temp_model,
248
- message_handler))
234
+ auto temp_model = read_goto_binary (file_name, message_handler);
235
+ if (!temp_model.has_value ())
249
236
return true ;
250
237
251
238
try
252
239
{
253
- link_goto_model (dest, temp_model, message_handler);
240
+ link_goto_model (dest, * temp_model, message_handler);
254
241
}
255
242
catch (...)
256
243
{
0 commit comments