Go to the documentation of this file.
15 #ifndef CPROVER_GOTO_INSTRUMENT_CONTRACTS_CFG_INFO_H
16 #define CPROVER_GOTO_INSTRUMENT_CONTRACTS_CFG_INFO_H
53 if(expr.
id() == ID_symbol)
57 else if(expr.
id() == ID_index)
61 else if(expr.
id() == ID_member)
65 type.
id() == ID_struct || type.
id() == ID_struct_tag ||
66 type.
id() == ID_union || type.
id() == ID_union_tag)
73 "is_local_composite_access: unexpected assignment to member of '" +
77 else if(expr.
id() == ID_if)
82 else if(expr.
id() == ID_typecast)
87 expr.
id() == ID_byte_extract_little_endian ||
88 expr.
id() == ID_byte_extract_big_endian)
92 else if(expr.
id() == ID_complex_real)
96 else if(expr.
id() == ID_complex_imag)
147 for(
const auto &t : loop)
150 locals.insert(t->decl_symbol().get_identifier());
172 auto it = exprs.begin();
173 while(it != exprs.end())
178 it = exprs.erase(it);
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Stores information about a goto function computed from its CFG.
Dirty variables are ones which have their address taken so we can't reliably work out where they may ...
bool is_local(const irep_idt &ident) const override
Returns true iff ident is a loop local.
The type of an expression, extends irept.
const byte_extract_exprt & to_byte_extract_expr(const exprt &expr)
const index_exprt & to_index_expr(const exprt &expr)
Cast an exprt to an index_exprt.
const if_exprt & to_if_expr(const exprt &expr)
Cast an exprt to an if_exprt.
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.
Thrown when we encounter an instruction, parameters to an instruction etc.
Base class for all expressions.
const complex_real_exprt & to_complex_real_expr(const exprt &expr)
Cast an exprt to a complex_real_exprt.
function_cfg_infot(const goto_functiont &_goto_function)
typet & type()
Return the type of the expression.
Expression classes for byte-level operators.
static optionalt< smt_termt > get_identifier(const exprt &expr, const std::unordered_map< exprt, smt_identifier_termt, irep_hash > &expression_handle_identifiers, const std::unordered_map< exprt, smt_identifier_termt, irep_hash > &expression_identifiers)
const exprt & struct_op() const
const irep_idt & get_identifier() const
const std::string & id_string() const
A loop, specified as a set of instructions.
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...
bool is_local(const irep_idt &identifier) const
const symbol_exprt & to_symbol_expr(const exprt &expr)
Cast an exprt to a symbol_exprt.
const irep_idt & id() const
A goto function, consisting of function body (see body) and parameter identifiers (see parameter_iden...
const complex_imag_exprt & to_complex_imag_expr(const exprt &expr)
Cast an exprt to a complex_imag_exprt.
loop_cfg_infot(goto_functiont &_goto_function, const loopt &loop)
bool is_local(const irep_idt &ident) const override
Returns true iff ident is a local or parameter of the goto_function.
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.
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.
const typecast_exprt & to_typecast_expr(const exprt &expr)
Cast an exprt to a typecast_exprt.
Templated functions to cast to specific exprt-derived classes.
parameter_identifierst parameter_identifiers
The identifiers of the parameters of this function.
const member_exprt & to_member_expr(const exprt &expr)
Cast an exprt to a member_exprt.
void erase_locals(std::set< exprt > &exprs)
std::unordered_set< irep_idt > parameters
std::unordered_set< irep_idt > locals
virtual bool is_local(const irep_idt &ident) const =0
Returns true iff ident is locally declared.