34 for(std::size_t i=0; i<count; i++)
53 sym.
is_weak = (flags &(1 << 16))!=0;
54 sym.
is_type = (flags &(1 << 15))!=0;
56 sym.
is_macro = (flags &(1 << 13))!=0;
58 sym.
is_input = (flags &(1 << 11))!=0;
79 symbol_table.
add(sym);
84 for(std::size_t i=0; i<count; i++)
89 typedef std::map<goto_programt::targett, std::list<unsigned> > target_mapt;
90 target_mapt target_map;
91 typedef std::map<unsigned, goto_programt::targett> rev_target_mapt;
92 rev_target_mapt rev_target_map;
97 for(std::size_t i=0; i<ins_count; i++)
112 rev_target_map.insert(
113 rev_target_map.end(),
114 std::make_pair(instruction.
target_number, itarget))->second!=itarget)
118 for(std::size_t i=0; i<t_count; i++)
120 target_map[itarget].push_back(irepconverter.
read_gb_word(in));
124 for(std::size_t i=0; i<l_count; i++)
127 instruction.
labels.push_back(label);
128 if(label==
"__CPROVER_HIDE")
136 for(target_mapt::iterator tit = target_map.begin();
137 tit!=target_map.end();
142 for(std::list<unsigned>::iterator nit = tit->second.begin();
143 nit!=tit->second.end();
147 rev_target_mapt::const_iterator entry=rev_target_map.find(n);
148 assert(entry!=rev_target_map.end());
149 ins->targets.push_back(entry->second);
169 const std::string &filename,
178 hdr[0]=
static_cast<char>(in.get());
179 hdr[1]=
static_cast<char>(in.get());
180 hdr[2]=
static_cast<char>(in.get());
182 if(hdr[0]==
'G' && hdr[1]==
'B' && hdr[2]==
'F')
188 hdr[3]=
static_cast<char>(in.get());
189 if(hdr[0]==0x7f && hdr[1]==
'G' && hdr[2]==
'B' && hdr[3]==
'F')
193 else if(hdr[0]==0x7f && hdr[1]==
'E' && hdr[2]==
'L' && hdr[3]==
'F')
196 message.
error() <<
"Sorry, but I can't read ELF binary `" 199 message.
error() <<
"Sorry, but I can't read ELF binaries" 206 message.
error() <<
"`" << filename <<
"' is not a goto-binary" 225 "The input was compiled with an old version of " 231 in, symbol_table, functions, irepconverter);
236 "The input was compiled with an unsupported version of " exprt guard
Guard for gotos, assume, assert.
irep_idt function
The function this instruction belongs to.
irep_idt name
The unique identifier.
irep_idt mode
Language mode.
goto_program_instruction_typet type
What kind of instruction?
const code_typet & to_code_type(const typet &type)
Cast a generic typet to a code_typet.
Goto Programs with Functions.
exprt value
Initial value of symbol.
irep_idt read_string_ref(std::istream &)
reads a string reference from the stream
irep_idt module
Name of module the symbol belongs to.
function_mapt function_map
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...
static mstreamt & eom(mstreamt &m)
static bool read_bin_goto_object_v3(std::istream &in, symbol_tablet &symbol_table, goto_functionst &functions, irep_serializationt &irepconverter)
read goto binary format v3
This class represents an instruction in the GOTO intermediate representation.
unsigned target_number
A number to identify branch targets.
const irep_idt & id() const
void compute_location_numbers()
instructionst::iterator targett
::goto_functiont goto_functiont
void reference_convert(std::istream &, irept &irep)
goto_program_instruction_typet
The type of an instruction in a GOTO program.
dstringt has one field, an unsigned integer no which is an index into a static table of strings...
binary irep conversions with hashing
bool read_bin_goto_object(std::istream &in, const std::string &filename, symbol_tablet &symbol_table, goto_functionst &functions, message_handlert &message_handler)
reads a goto binary file back into a symbol and a function table
irep_idt read_gb_string(std::istream &)
reads a string from the stream
typet type
Type of symbol.
source_locationt location
Source code location of definition of symbol.
source_locationt source_location
The location of the instruction in the source file.
irep_idt base_name
Base (non-scoped) name.
static std::size_t read_gb_word(std::istream &)
reads 4 characters and builds a long int from them
bool add(const symbolt &symbol)
Add a new symbol to the symbol table.
goto_programt coverage_criteriont message_handlert & message_handler
bool is_target() const
Is this node a branch target?