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)));
The type of an expression, extends irept.
#define forall_subtypes(it, type)
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...
virtual bool replace_symbol_expr(symbol_exprt &dest) const
void insert(const symbol_exprt &old_expr, const exprt &new_expr)
Deprecated expression utility functions.
const code_typet & to_code_type(const typet &type)
Cast a typet to a code_typet.
const irep_idt & get_identifier() const
virtual bool replace(exprt &dest) const
const componentst & components() const
typet & type()
Return the type of the expression.
const address_of_exprt & to_address_of_expr(const exprt &expr)
Cast an exprt to an address_of_exprt.
Extract member of struct or union.
bool replace_symbol_expr(symbol_exprt &dest) const override
bool is_lvalue(const exprt &expr)
Returns true iff the argument is (syntactically) an lvalue.
const irep_idt & id() const
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.
API to expression classes.
bool have_to_replace(const exprt &dest) const
#define PRECONDITION(CONDITION)
const member_exprt & to_member_expr(const exprt &expr)
Cast an exprt to a member_exprt.
const exprt & size() const
Base class for tree-like data structures with sharing.
#define forall_operands(it, expr)
const symbol_exprt & to_symbol_expr(const exprt &expr)
Cast an exprt to a symbol_exprt.
dstringt has one field, an unsigned integer no which is an index into a static table of strings...
Operator to return the address of an object.
virtual ~replace_symbolt()
bool replaces_symbol(const irep_idt &id) const
Base type for structs and unions.
const array_typet & to_array_type(const typet &type)
Cast a typet to an array_typet.
Base class for all expressions.
const exprt & struct_op() const
const parameterst & parameters() const
const struct_union_typet & to_struct_union_type(const typet &type)
Cast a typet to a struct_union_typet.
irept & add(const irep_namet &name)
#define Forall_subtypes(it, type)
#define Forall_operands(it, expr)
Expression to hold a symbol (variable)
const typet & subtype() const
#define DATA_INVARIANT(CONDITION, REASON)
This condition should be used to document that assumptions that are made on goto_functions, goto_programs, exprts, etc.
bool replace(exprt &dest) const override
const index_exprt & to_index_expr(const exprt &expr)
Cast an exprt to an index_exprt.
const irept & find(const irep_namet &name) const
const typet & return_type() const