43 func.second.body.compute_incoming_edges();
51 func.second.body.compute_target_numbers();
59 func.second.body.compute_loop_numbers();
64 std::vector<goto_functionst::function_mapt::const_iterator>
67 std::vector<function_mapt::const_iterator> result;
77 [](function_mapt::const_iterator a, function_mapt::const_iterator b) {
78 return id2string(a->first) < id2string(b->first);
87 std::vector<function_mapt::iterator> result;
97 [](function_mapt::iterator a, function_mapt::iterator b) {
98 return id2string(a->first) < id2string(b->first);
110 const auto &function_name = entry.first;
118 id2string(function_name) +
" parameter count inconsistency\n" +
124 for(
const auto ¶meter : parameters)
128 it->empty() || ns.
lookup(*it).type == parameter.type(),
129 id2string(function_name) +
" parameter type inconsistency\n" +
130 "goto program: " + ns.
lookup(*it).type.id_string() +
131 "\nsymbol table: " + parameter.type().id_string());
144 !instruction.is_set_return_value(),
145 "void function should not return a value");
std::vector< parametert > parameterst
const typet & return_type() const
const parameterst & parameters() const
void compute_incoming_edges()
void compute_loop_numbers()
unsigned unused_location_number
A location number such that numbers in the interval [unused_location_number, MAX_UINT] are all unused...
function_mapt function_map
void compute_location_numbers()
void validate(const namespacet &, validation_modet) const
Check that the goto functions are well-formed.
std::vector< function_mapt::const_iterator > sorted() const
returns a vector of the iterators in alphabetical order
void compute_target_numbers()
A goto function, consisting of function body (see body) and parameter identifiers (see parameter_iden...
parameter_identifierst parameter_identifiers
The identifiers of the parameters of this function.
void validate(const namespacet &ns, const validation_modet vm) const
Check that the goto function is well-formed.
A generic container class for the GOTO intermediate representation of one function.
instructionst instructions
The list of instructions in the goto program.
void compute_location_numbers(unsigned &nr)
Compute location numbers.
const irep_idt & id() const
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
bool lookup(const irep_idt &name, const symbolt *&symbol) const override
See documentation for namespace_baset::lookup().
typet type
Type of symbol.
Goto Programs with Functions.
const std::string & id2string(const irep_idt &d)
const code_typet & to_code_type(const typet &type)
Cast a typet to a code_typet.
std::string to_string(const string_not_contains_constraintt &expr)
Used for debug printing.
#define DATA_CHECK(vm, condition, message)
This macro takes a condition which denotes a well-formedness criterion on goto programs,...