Go to the documentation of this file.
28 symbol_tablet::symbolst::const_iterator s_it=
31 if(s_it==symbol_table.
symbols.end())
41 new_symbol.base_name=id;
42 new_symbol.type=function_type;
44 symbol_table.
insert(std::move(new_symbol));
46 s_it=symbol_table.
symbols.find(
id);
47 assert(s_it!=symbol_table.
symbols.end());
52 if(s_it->second.type.id()!=ID_code ||
56 std::string error =
"function '" +
id2string(
id) +
"' has wrong signature";
66 index_exprt(function_id_string, from_integer(0, index_type()))),
67 to_code_type(s_it->second.type).parameters()[0].type())});
124 if(i_it->is_return())
138 assert(last->is_end_function());
141 bool has_return=
false;
147 if(before_last->is_return())
#define Forall_goto_program_instructions(it, program)
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
const typet & subtype() const
The type of an expression, extends irept.
static instructiont make_end_function(const source_locationt &l=source_locationt::nil())
targett add(instructiont &&instruction)
Adds a given instruction at the end.
Expression to hold a symbol (variable)
static instructiont make_function_call(const code_function_callt &_code, const source_locationt &l=source_locationt::nil())
Create a function call instruction.
codet representation of a function call statement.
targett insert_before(const_targett target)
Insertion before the instruction pointed-to by the given instruction iterator target.
const code_typet & to_code_type(const typet &type)
Cast a typet to a code_typet.
const std::string & id2string(const irep_idt &d)
code_function_callt function_to_call(symbol_tablet &symbol_table, const irep_idt &id, const irep_idt &argument)
virtual std::pair< symbolt &, bool > insert(symbolt symbol) override
Author: Diffblue Ltd.
pointer_typet pointer_type(const typet &subtype)
void function_enter(goto_modelt &goto_model, const irep_idt &id)
const parameterst & parameters() const
#define Forall_goto_functions(it, functions)
bitvector_typet char_type()
instructionst instructions
The list of instructions in the goto program.
Function Entering and Exiting.
goto_functionst goto_functions
GOTO functions.
void set(const irep_namet &name, const irep_idt &value)
const symbolst & symbols
Read-only field, used to look up symbols given their names.
A generic container class for the GOTO intermediate representation of one function.
bool has_prefix(const std::string &s, const std::string &prefix)
void function_exit(goto_modelt &goto_model, const irep_idt &id)
void insert_before_swap(targett target)
Insertion that preserves jumps to "target".
This class represents an instruction in the GOTO intermediate representation.
API to expression classes.
symbol_tablet symbol_table
Symbol table.
irep_idt name
The unique identifier.
instructionst::iterator targett