Go to the documentation of this file.
26 const exprt &new_expr)
30 "types to be replaced should match. old type:\n" +
32 expr_map.insert(std::pair<irep_idt, exprt>(
51 s.
type() == it->second.type(),
52 "types to be replaced should match. s.type:\n" + s.
type().
pretty() +
53 "\nit->second.type:\n" + it->second.type().pretty());
54 static_cast<exprt &
>(s) = it->second;
65 const exprt &const_dest(dest);
75 if(dest.
id()==ID_member)
82 else if(dest.
id()==ID_index)
92 else if(dest.
id()==ID_address_of)
99 else if(dest.
id()==ID_symbol)
111 const typet &c_sizeof_type =
112 static_cast<const typet&
>(dest.
find(ID_C_c_sizeof_type));
116 const typet &va_arg_type =
117 static_cast<const typet&
>(dest.
find(ID_C_va_arg_type));
136 if(dest.
id()==ID_symbol)
146 const irept &c_sizeof_type=dest.
find(ID_C_c_sizeof_type);
152 const irept &va_arg_type=dest.
find(ID_C_va_arg_type);
176 if(dest.
id()==ID_struct ||
185 else if(dest.
id()==ID_code)
195 else if(dest.
id()==ID_array)
218 if(dest.
id()==ID_struct ||
224 for(
const auto &c : struct_union_type.
components())
228 else if(dest.
id()==ID_code)
238 else if(dest.
id()==ID_array)
246 const exprt &new_expr)
258 static_cast<exprt &
>(s) = it->second;
265 const exprt &const_dest(dest);
284 if(dest.
id() == ID_index)
296 else if(dest.
id() == ID_address_of)
312 const typet &c_sizeof_type =
313 static_cast<const typet &
>(dest.
find(ID_C_c_sizeof_type));
316 static_cast<typet &
>(dest.
add(ID_C_c_sizeof_type)));
318 const typet &va_arg_type =
319 static_cast<const typet &
>(dest.
find(ID_C_va_arg_type));
322 static_cast<typet &
>(dest.
add(ID_C_va_arg_type)));
const componentst & components() const
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
virtual ~replace_symbolt()
const typet & subtype() const
bool have_to_replace(const exprt &dest) const
bool replaces_symbol(const irep_idt &id) const
#define Forall_operands(it, expr)
const struct_union_typet & to_struct_union_type(const typet &type)
Cast a typet to a struct_union_typet.
The type of an expression, extends irept.
std::string pretty(unsigned indent=0, unsigned max_indent=0) const
const index_exprt & to_index_expr(const exprt &expr)
Cast an exprt to an index_exprt.
Base type for structs and unions.
irept & add(const irep_namet &name)
const irept & find(const irep_namet &name) const
Base class for all expressions.
Expression to hold a symbol (variable)
const exprt & size() const
typet & type()
Return the type of the expression.
virtual bool replace_symbol_expr(symbol_exprt &dest) const
const code_typet & to_code_type(const typet &type)
Cast a typet to a code_typet.
#define DATA_INVARIANT(CONDITION, REASON)
This condition should be used to document that assumptions that are made on goto_functions,...
const address_of_exprt & to_address_of_expr(const exprt &expr)
Cast an exprt to an address_of_exprt.
#define forall_operands(it, expr)
const exprt & struct_op() const
#define PRECONDITION(CONDITION)
const irep_idt & get_identifier() const
bool replace(exprt &dest) const override
#define Forall_subtypes(it, type)
virtual bool replace(exprt &dest) const
const symbol_exprt & to_symbol_expr(const exprt &expr)
Cast an exprt to a symbol_exprt.
const irep_idt & id() const
void insert(const class symbol_exprt &old_expr, const exprt &new_expr)
Sets old_expr to be replaced by new_expr if we don't already have a replacement; otherwise does nothi...
const parameterst & parameters() const
#define forall_subtypes(it, type)
Extract member of struct or union.
Deprecated expression utility functions.
void insert(const symbol_exprt &old_expr, const exprt &new_expr)
#define PRECONDITION_WITH_DIAGNOSTICS(CONDITION,...)
const array_typet & to_array_type(const typet &type)
Cast a typet to an array_typet.
const typet & return_type() const
const member_exprt & to_member_expr(const exprt &expr)
Cast an exprt to a member_exprt.
There are a large number of kinds of tree structured or tree-like data in CPROVER.
bool replace_symbol_expr(symbol_exprt &dest) const override
Operator to return the address of an object.
API to expression classes.
bool replace_symbol_expr(symbol_exprt &dest) const override
void set(const class symbol_exprt &old_expr, const exprt &new_expr)
Sets old_expr to be replaced by new_expr.
bool is_lvalue(const exprt &expr)
Returns true iff the argument is (syntactically) an lvalue.