15 #ifndef CPROVER_GOTO_INSTRUMENT_CONTRACTS_CFG_INFO_H
16 #define CPROVER_GOTO_INSTRUMENT_CONTRACTS_CFG_INFO_H
54 if(expr.
id() == ID_symbol)
58 else if(expr.
id() == ID_index)
62 else if(expr.
id() == ID_member)
66 type.
id() == ID_struct || type.
id() == ID_struct_tag ||
67 type.
id() == ID_union || type.
id() == ID_union_tag)
74 "is_local_composite_access: unexpected assignment to member of '" +
78 else if(expr.
id() == ID_if)
83 else if(expr.
id() == ID_typecast)
88 expr.
id() == ID_byte_extract_little_endian ||
89 expr.
id() == ID_byte_extract_big_endian)
93 else if(expr.
id() == ID_complex_real)
97 else if(expr.
id() == ID_complex_imag)
148 for(
const auto &t : loop)
151 locals.insert(t->decl_symbol().get_identifier());
173 auto it = exprs.begin();
174 while(it != exprs.end())
179 std::find_if(symbols.begin(), symbols.end(), [
this](
const irep_idt &s) {
183 it = exprs.erase(it);
211 dirtyt is_dirty(goto_function);
213 dirty.insert(dirty_ids.begin(), dirty_ids.end());
Expression classes for byte-level operators.
const byte_extract_exprt & to_byte_extract_expr(const exprt &expr)
Stores information about a goto function computed from its CFG.
virtual bool is_not_local_or_dirty_local(const irep_idt &ident) const =0
Returns true iff the given ident is either non-locally declared or is locally-declared but dirty.
virtual bool is_local(const irep_idt &ident) const =0
Returns true iff ident is locally declared.
bool is_local_composite_access(const exprt &expr) const
Returns true iff expr is an access to a locally declared symbol and does not contain dereference or a...
Dirty variables are ones which have their address taken so we can't reliably work out where they may ...
const std::unordered_set< irep_idt > & get_dirty_ids() const
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Base class for all expressions.
typet & type()
Return the type of the expression.
bool is_local(const irep_idt &ident) const override
Returns true iff ident is a local or parameter of the goto_function.
std::unordered_set< irep_idt > parameters
bool is_not_local_or_dirty_local(const irep_idt &ident) const override
Returns true iff the given ident is either not a goto_function local or is a local that is dirty.
function_cfg_infot(const goto_functiont &_goto_function)
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.
goto_program_cfg_infot(const goto_programt &goto_program)
bool is_local(const irep_idt &ident) const override
Returns true iff ident is a loop local.
std::set< irep_idt > dirty
bool is_not_local_or_dirty_local(const irep_idt &ident) const override
Returns true iff the given ident is either not a loop local or is a loop local that is dirty.
std::set< irep_idt > locals
A generic container class for the GOTO intermediate representation of one function.
void copy_from(const goto_programt &src)
Copy a full goto program, preserving targets.
void get_decl_identifiers(decl_identifierst &decl_identifiers) const
get the variables in decl statements
const std::string & id_string() const
const irep_idt & id() const
bool is_local(const irep_idt &identifier) const
bool is_not_local_or_dirty_local(const irep_idt &ident) const override
Returns true iff the given ident is either not a loop local or is a loop local that is dirty.
bool is_local(const irep_idt &ident) const override
Returns true iff ident is a loop local.
void erase_locals(std::set< exprt > &exprs)
std::unordered_set< irep_idt > locals
loop_cfg_infot(goto_functiont &_goto_function, const loopt &loop)
const exprt & struct_op() const
The type of an expression, extends irept.
Thrown when we encounter an instruction, parameters to an instruction etc.
Variables whose address is taken.
Templated functions to cast to specific exprt-derived classes.
find_symbols_sett find_symbol_identifiers(const exprt &src)
Find identifiers of the sub expressions with id ID_symbol, considering both free and bound variables.
Utilities for building havoc code for expressions.
Local variables whose address is taken.
Helper functions for k-induction and loop invariants.
natural_loops_mutablet::natural_loopt loopt
const if_exprt & to_if_expr(const exprt &expr)
Cast an exprt to an if_exprt.
const symbol_exprt & to_symbol_expr(const exprt &expr)
Cast an exprt to a symbol_exprt.
const typecast_exprt & to_typecast_expr(const exprt &expr)
Cast an exprt to a typecast_exprt.
const complex_real_exprt & to_complex_real_expr(const exprt &expr)
Cast an exprt to a complex_real_exprt.
const member_exprt & to_member_expr(const exprt &expr)
Cast an exprt to a member_exprt.
const complex_imag_exprt & to_complex_imag_expr(const exprt &expr)
Cast an exprt to a complex_imag_exprt.
const index_exprt & to_index_expr(const exprt &expr)
Cast an exprt to an index_exprt.