37 typedef std::list<value_set_fit::entryt> entry_listt;
48 typedef std::unordered_map<irep_idt, entry_listt> entry_cachet;
49 entry_cachet entry_cache;
53 for(goto_programt::instructionst::const_iterator
60 for(goto_programt::decl_identifierst::const_iterator
66 entry_cachet::const_iterator e_it=entry_cache.find(*l_it);
68 if(e_it==entry_cache.end())
72 std::list<value_set_fit::entryt> &entries=entry_cache[*l_it];
84 std::list<value_set_fit::entryt> &dest)
91 const std::string &suffix,
93 std::list<value_set_fit::entryt> &dest)
95 if(type.
id() == ID_struct_tag || type.
id() == ID_union_tag)
97 const auto &components =
99 for(
const auto &c : components)
102 identifier, suffix +
"." +
id2string(c.get_name()), c.type(), dest);
105 else if(type.
id() == ID_struct || type.
id() == ID_union)
108 for(
const auto &c : components)
111 identifier, suffix +
"." +
id2string(c.get_name()), c.type(), dest);
114 else if(type.
id() == ID_array)
117 identifier, suffix +
"[]",
to_array_type(type).element_type(), dest);
129 std::list<value_set_fit::entryt> globals;
138 std::set<irep_idt> locals;
145 std::list<value_set_fit::entryt> entries;
153 std::list<value_set_fit::entryt> &dest)
158 if(symbol_pair.second.is_lvalue && symbol_pair.second.is_static_lifetime)
167 if(type.
id()==ID_pointer)
172 {
return true;
break; }
175 if(type.
id()==ID_pointer)
177 const typet *t = &type;
178 while(t->
id() == ID_pointer)
181 return (t->
id()==ID_code);
190 else if(type.
id()==ID_struct ||
199 else if(type.
id()==ID_array)
201 else if(type.
id() == ID_struct_tag)
203 else if(type.
id() == ID_union_tag)
const union_tag_typet & to_union_tag_type(const typet &type)
Cast a typet to a union_tag_typet.
const typet & element_type() const
The type of the elements of the array.
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Base class for all expressions.
goto_programt::const_targett locationt
virtual void initialize(const goto_programt &)
value_set_domain_fit state
A collection of goto functions.
function_mapt function_map
A generic container class for the GOTO intermediate representation of one function.
instructionst instructions
The list of instructions in the goto program.
std::set< irep_idt > decl_identifierst
void get_decl_identifiers(decl_identifierst &decl_identifiers) const
get the variables in decl statements
const irep_idt & id() const
const union_typet & follow_tag(const union_tag_typet &) const
Follow type tag of union type.
bool lookup(const irep_idt &name, const symbolt *&symbol) const override
See documentation for namespace_baset::lookup().
const symbol_table_baset & get_symbol_table() const
Return first symbol table registered with the namespace.
number_type number(const key_type &a)
const typet & base_type() const
The type of the data what we point to.
const componentst & components() const
const symbolst & symbols
Read-only field, used to look up symbols given their names.
typet type
Type of symbol.
irep_idt name
The unique identifier.
The type of an expression, extends irept.
bool check_type(const typet &type)
std::vector< exprt > get_values(const irep_idt &function_id, locationt l, const exprt &expr) override
void get_entries(const symbolt &symbol, std::list< value_set_fit::entryt > &dest)
void add_vars(const goto_functionst &goto_functions)
void get_entries_rec(const irep_idt &identifier, const std::string &suffix, const typet &type, std::list< value_set_fit::entryt > &dest)
void get_globals(std::list< value_set_fit::entryt > &dest)
@ TRACK_FUNCTION_POINTERS
track_optionst track_options
void initialize(const goto_programt &goto_program) override
static numberingt< irep_idt > function_numbering
void add_vars(const std::list< entryt > &vars)
std::vector< exprt > get_value_set(const exprt &expr, const namespacet &ns) const
unsigned from_target_index
void get_local_identifiers(const goto_functiont &goto_function, std::set< irep_idt > &dest)
Return in dest the identifiers of the local variables declared in the goto_function and the identifie...
const std::string & id2string(const irep_idt &d)
API to expression classes for Pointers.
const pointer_typet & to_pointer_type(const typet &type)
Cast a typet to a pointer_typet.
const array_typet & to_array_type(const typet &type)
Cast a typet to an array_typet.
const struct_union_typet & to_struct_union_type(const typet &type)
Cast a typet to a struct_union_typet.
const struct_tag_typet & to_struct_tag_type(const typet &type)
Cast a typet to a struct_tag_typet.
const struct_or_union_tag_typet & to_struct_or_union_tag_type(const typet &type)
Cast a typet to a struct_or_union_tag_typet.
Value Set Propagation (flow insensitive)