@@ -19,15 +19,12 @@ Author: CM Wintersteiger
19
19
20
20
#include < goto-programs/goto_model.h>
21
21
22
- // / Writes a goto program to disc, using goto binary format
23
- bool write_goto_binary (
22
+ // / Writes the symbol table to file.
23
+ static void write_symbol_table_binary (
24
24
std::ostream &out,
25
25
const symbol_table_baset &symbol_table,
26
- const goto_functionst &goto_functions,
27
26
irep_serializationt &irepconverter)
28
27
{
29
- // first write symbol table
30
-
31
28
write_gb_word (out, symbol_table.symbols .size ());
32
29
33
30
for (const auto &symbol_pair : symbol_table.symbols )
@@ -70,9 +67,14 @@ bool write_goto_binary(
70
67
71
68
write_gb_word (out, flags);
72
69
}
70
+ }
73
71
74
- // now write functions, but only those with body
75
-
72
+ // / Writes the functions to file, but only those with non-empty body.
73
+ static void write_goto_functions_binary (
74
+ std::ostream &out,
75
+ const goto_functionst &goto_functions,
76
+ irep_serializationt &irepconverter)
77
+ {
76
78
unsigned cnt=0 ;
77
79
for (const auto &gf_entry : goto_functions.function_map )
78
80
{
@@ -116,6 +118,17 @@ bool write_goto_binary(
116
118
}
117
119
}
118
120
}
121
+ }
122
+
123
+ // / Writes a goto program to disc, using goto binary format
124
+ bool write_goto_binary (
125
+ std::ostream &out,
126
+ const symbol_table_baset &symbol_table,
127
+ const goto_functionst &goto_functions,
128
+ irep_serializationt &irepconverter)
129
+ {
130
+ write_symbol_table_binary (out, symbol_table, irepconverter);
131
+ write_goto_functions_binary (out, goto_functions, irepconverter);
119
132
120
133
// irepconverter.output_map(f);
121
134
// irepconverter.output_string_map(f);
0 commit comments