Go to the documentation of this file.
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 fct_index = 0; fct_index < count; ++fct_index)
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 ins_index = 0; ins_index < ins_count; ++ins_index)
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);
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);
149 entry != rev_target_map.end(),
150 "something from the target map should also be in the reverse target "
152 ins->targets.push_back(entry->second);
172 const std::string &filename,
181 hdr[0]=
static_cast<char>(in.get());
182 hdr[1]=
static_cast<char>(in.get());
183 hdr[2]=
static_cast<char>(in.get());
185 if(hdr[0]==
'G' && hdr[1]==
'B' && hdr[2]==
'F')
191 hdr[3]=
static_cast<char>(in.get());
192 if(hdr[0]==0x7f && hdr[1]==
'G' && hdr[2]==
'B' && hdr[3]==
'F')
196 else if(hdr[0]==0x7f && hdr[1]==
'E' && hdr[2]==
'L' && hdr[3]==
'F')
199 message.
error() <<
"Sorry, but I can't read ELF binary `"
202 message.
error() <<
"Sorry, but I can't read ELF binaries"
209 message.
error() <<
"`" << filename <<
"' is not a goto-binary"
229 "The input was compiled with an old version of "
235 in, symbol_table, functions, irepconverter);
240 "The input was compiled with an unsupported version of "
Class that provides messages with a built-in verbosity 'level'.
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
source_locationt source_location
The location of the instruction in the source file.
void reference_convert(std::istream &, irept &irep)
irep_idt read_gb_string(std::istream &)
reads a string from the stream
typet type
Type of symbol.
goto_program_instruction_typet type
What kind of instruction?
void compute_location_numbers()
#define INVARIANT(CONDITION, REASON)
This macro uses the wrapper function 'invariant_violated_string'.
irep_idt base_name
Base (non-scoped) name.
static std::size_t read_gb_word(std::istream &)
Interpret a stream of byte as a 7-bit encoded unsigned number.
function_mapt function_map
#define UNREACHABLE
This should be used to mark dead code.
irep_idt pretty_name
Language-specific display name.
const code_typet & to_code_type(const typet &type)
Cast a typet to a code_typet.
irep_idt mode
Language mode.
static bool read_bin_goto_object_v4(std::istream &in, symbol_tablet &symbol_table, goto_functionst &functions, irep_serializationt &irepconverter)
read goto binary format v4
const irep_idt & id() const
goto_program_instruction_typet
The type of an instruction in a GOTO program.
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
::goto_functiont goto_functiont
bool add(const symbolt &symbol)
Add a new symbol to the symbol table.
A collection of goto functions.
exprt value
Initial value of symbol.
unsigned target_number
A number to identify branch targets.
irep_idt function
The function this instruction belongs to.
source_locationt location
Source code location of definition of symbol.
exprt guard
Guard for gotos, assume, assert.
irep_idt read_string_ref(std::istream &)
Read a string reference from the stream.
irep_idt module
Name of module the symbol belongs to.
This class represents an instruction in the GOTO intermediate representation.
bool is_target() const
Is this node a branch target?
irep_idt name
The unique identifier.
instructionst::iterator targett