29 symbol_table_baset::symbolst::const_iterator s_it =
32 if(s_it==symbol_table.
symbols.end())
41 p.base_type().set(ID_C_constant,
true);
46 new_symbol.base_name=id;
48 symbol_table.
insert(std::move(new_symbol));
50 s_it=symbol_table.
symbols.find(
id);
57 if(s_it->second.type.id()!=ID_code ||
61 std::string error =
"function '" +
id2string(
id) +
"' has wrong signature";
71 index_exprt(function_id_string, from_integer(0, c_index_type()))),
72 to_code_type(s_it->second.type).parameters()[0].type())});
89 if(gf_entry.first ==
id)
114 if(gf_entry.first ==
id)
129 if(i_it->is_set_return_value())
143 DATA_INVARIANT(last->is_end_function(),
"must be end of function");
146 bool has_set_return_value =
false;
152 if(before_last->is_set_return_value())
153 has_set_return_value =
true;
156 if(!has_set_return_value)
pointer_typet pointer_type(const typet &subtype)
bitvector_typet char_type()
goto_instruction_codet representation of a function call statement.
const parameterst & parameters() const
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
function_mapt function_map
symbol_tablet symbol_table
Symbol table.
goto_functionst goto_functions
GOTO functions.
This class represents an instruction in the GOTO intermediate representation.
A generic container class for the GOTO intermediate representation of one function.
instructionst instructions
The list of instructions in the goto program.
void insert_before_swap(targett target)
Insertion that preserves jumps to "target".
static instructiont make_end_function(const source_locationt &l=source_locationt::nil())
instructionst::iterator targett
static instructiont make_function_call(const code_function_callt &_code, const source_locationt &l=source_locationt::nil())
Create a function call instruction.
targett add(instructiont &&instruction)
Adds a given instruction at the end.
targett insert_before(const_targett target)
Insertion before the instruction pointed-to by the given instruction iterator target.
Expression to hold a symbol (variable)
The symbol table base class interface.
const symbolst & symbols
Read-only field, used to look up symbols given their names.
virtual std::pair< symbolt &, bool > insert(symbolt symbol)=0
Move or copy a new symbol to the symbol table.
void function_exit(goto_modelt &goto_model, const irep_idt &id)
void function_enter(goto_modelt &goto_model, const irep_idt &id)
code_function_callt function_to_call(symbol_table_baset &symbol_table, const irep_idt &id, const irep_idt &argument)
Function Entering and Exiting.
#define Forall_goto_program_instructions(it, program)
const std::string & id2string(const irep_idt &d)
API to expression classes for Pointers.
#define UNREACHABLE
This should be used to mark dead code.
#define DATA_INVARIANT(CONDITION, REASON)
This condition should be used to document that assumptions that are made on goto_functions,...
const code_typet & to_code_type(const typet &type)
Cast a typet to a code_typet.