Go to the documentation of this file.
26 const exprt &new_expr)
29 expr_map.insert(std::pair<irep_idt, exprt>(
48 s.
type() == it->second.type(),
49 "type of symbol to be replaced should match");
50 static_cast<exprt &>(s) = it->second;
61 const exprt &const_dest(dest);
71 if(dest.
id()==ID_member)
78 else if(dest.
id()==ID_index)
88 else if(dest.
id()==ID_address_of)
95 else if(dest.
id()==ID_symbol)
107 const typet &c_sizeof_type =
108 static_cast<const typet&>(dest.
find(ID_C_c_sizeof_type));
110 result &=
replace(static_cast<typet&>(dest.
add(ID_C_c_sizeof_type)));
112 const typet &va_arg_type =
113 static_cast<const typet&>(dest.
find(ID_C_va_arg_type));
115 result &=
replace(static_cast<typet&>(dest.
add(ID_C_va_arg_type)));
132 if(dest.
id()==ID_symbol)
142 const irept &c_sizeof_type=dest.
find(ID_C_c_sizeof_type);
148 const irept &va_arg_type=dest.
find(ID_C_va_arg_type);
172 if(dest.
id()==ID_struct ||
181 else if(dest.
id()==ID_code)
191 else if(dest.
id()==ID_array)
214 if(dest.
id()==ID_struct ||
220 for(
const auto &c : struct_union_type.
components())
224 else if(dest.
id()==ID_code)
234 else if(dest.
id()==ID_array)
242 const exprt &new_expr)
254 static_cast<exprt &>(s) = it->second;
261 const exprt &const_dest(dest);
280 if(dest.
id() == ID_index)
292 else if(dest.
id() == ID_address_of)
308 const typet &c_sizeof_type =
309 static_cast<const typet &>(dest.
find(ID_C_c_sizeof_type));
312 static_cast<typet &>(dest.
add(ID_C_c_sizeof_type)));
314 const typet &va_arg_type =
315 static_cast<const typet &>(dest.
find(ID_C_va_arg_type));
318 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.
#define PRECONDITION(CONDITION)
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)
#define DATA_INVARIANT(CONDITION, REASON)
This condition should be used to document that assumptions that are made on goto_functions,...
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.
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.
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
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)
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.
Base class for tree-like data structures with sharing.
bool replace_symbol_expr(symbol_exprt &dest) const override
Operator to return the address of an object.
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.