36 const symbolt &sym = it->second;
51 flags = (flags << 1) | static_cast<int>(sym.
is_weak);
52 flags = (flags << 1) | static_cast<int>(sym.
is_type);
53 flags = (flags << 1) | static_cast<int>(sym.
is_property);
54 flags = (flags << 1) | static_cast<int>(sym.
is_macro);
55 flags = (flags << 1) | static_cast<int>(sym.
is_exported);
56 flags = (flags << 1) | static_cast<int>(sym.
is_input);
57 flags = (flags << 1) | static_cast<int>(sym.
is_output);
58 flags = (flags << 1) | static_cast<int>(sym.
is_state_var);
59 flags = (flags << 1) | static_cast<int>(sym.
is_parameter);
60 flags = (flags << 1) | static_cast<int>(sym.
is_auxiliary);
61 flags = (flags << 1) | static_cast<int>(
false);
62 flags = (flags << 1) | static_cast<int>(sym.
is_lvalue);
66 flags = (flags << 1) | static_cast<int>(sym.
is_extern);
67 flags = (flags << 1) | static_cast<int>(sym.
is_volatile);
76 if(it->second.body_available())
83 if(fct.second.body_available())
93 const goto_programt::instructiont &instruction = *i_it;
105 for(
const auto &t_it : instruction.targets)
110 for(
const auto &l_it : instruction.labels)
130 out << char(0x7f) <<
"GBF";
139 throw "version 1 no longer supported";
142 throw "version 2 no longer supported";
146 out, lsymbol_table, functions,
150 throw "unknown goto binary version";
158 const std::string &filename,
163 std::ofstream out(filename, std::ios::binary);
169 "Failed to open `" << filename <<
"'";
irep_idt name
The unique identifier.
const std::string & id2string(const irep_idt &d)
#define forall_symbols(it, expr)
irep_idt mode
Language mode.
exprt value
Initial value of symbol.
void write_gb_word(std::ostream &out, std::size_t u)
outputs 4 characters for a long, most-significant byte first
irep_idt module
Name of module the symbol belongs to.
irep_idt pretty_name
Language-specific display name.
Symbol table entry.This is a symbol in the symbol table, stored in an object of type symbol_tablet...
void reference_convert(std::istream &, irept &irep)
function_mapt function_map
void write_gb_string(std::ostream &out, const std::string &s)
outputs the string and then a zero byte.
binary irep conversions with hashing
typet type
Type of symbol.
source_locationt location
Source code location of definition of symbol.
void write_string_ref(std::ostream &, const irep_idt &)
outputs the string reference
irep_idt base_name
Base (non-scoped) name.
bool write_goto_binary(std::ostream &out, const symbol_tablet &lsymbol_table, const goto_functionst &functions, int version)
Writes a goto program to disc.
#define forall_goto_functions(it, functions)
#define forall_goto_program_instructions(it, program)
bool write_goto_binary_v3(std::ostream &out, const symbol_tablet &lsymbol_table, const goto_functionst &functions, irep_serializationt &irepconverter)
Writes a goto program to disc, using goto binary format ver 2.