24 const exprt &new_expr)
26 expr_map.insert(std::pair<irep_idt, exprt>(
32 const bool replace_with_const)
const 38 const exprt &const_dest(dest);
48 if(dest.
id()==ID_member)
55 else if(dest.
id()==ID_index)
65 else if(dest.
id()==ID_address_of)
72 else if(dest.
id()==ID_symbol)
76 expr_mapt::const_iterator it=
81 const exprt &e=it->second;
98 const typet &c_sizeof_type =
99 static_cast<const typet&
>(dest.
find(ID_C_c_sizeof_type));
101 result &=
replace(static_cast<typet&>(dest.
add(ID_C_c_sizeof_type)));
103 const typet &type_arg =
static_cast<const typet &
>(dest.
find(ID_type_arg));
105 result &=
replace(static_cast<typet &>(dest.
add(ID_type_arg)));
107 const typet &va_arg_type =
108 static_cast<const typet&
>(dest.
find(ID_C_va_arg_type));
110 result &=
replace(static_cast<typet&>(dest.
add(ID_C_va_arg_type)));
127 if(dest.
id()==ID_symbol)
137 const irept &c_sizeof_type=dest.
find(ID_C_c_sizeof_type);
143 const irept &type_arg = dest.
find(ID_type_arg);
149 const irept &va_arg_type=dest.
find(ID_C_va_arg_type);
173 if(dest.
id()==ID_struct ||
180 for(struct_union_typet::componentst::iterator
181 it=components.begin();
182 it!=components.end();
187 else if(dest.
id()==ID_code)
192 for(code_typet::parameterst::iterator it = parameters.begin();
193 it!=parameters.end();
198 else if(dest.
id()==ID_symbol)
200 type_mapt::const_iterator it =
209 else if(dest.
id()==ID_array)
232 if(dest.
id()==ID_struct ||
241 for(struct_union_typet::componentst::const_iterator
242 it=components.begin();
243 it!=components.end();
248 else if(dest.
id()==ID_code)
256 for(code_typet::parameterst::const_iterator
257 it=parameters.begin();
258 it!=parameters.end();
263 else if(dest.
id()==ID_symbol)
268 else if(dest.
id()==ID_array)
The type of an expression.
#define forall_subtypes(it, type)
const code_typet & to_code_type(const typet &type)
Cast a generic typet to a code_typet.
const irep_idt & get_identifier() const
std::vector< componentt > componentst
const symbol_typet & to_symbol_type(const typet &type)
Cast a generic typet to a symbol_typet.
std::vector< parametert > parameterst
const componentst & components() const
const address_of_exprt & to_address_of_expr(const exprt &expr)
Cast a generic exprt to an address_of_exprt.
Extract member of struct or union.
const irep_idt & id() const
API to expression classes.
bool have_to_replace(const exprt &dest) const
const member_exprt & to_member_expr(const exprt &expr)
Cast a generic 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 a generic exprt to a symbol_exprt.
Operator to return the address of an object.
virtual ~replace_symbolt()
virtual bool replace(exprt &dest, const bool replace_with_const=true) const
Replaces a symbol with a constant If you are replacing symbols with constants in an l-value...
Base type of C structs and unions, and C++ classes.
const array_typet & to_array_type(const typet &type)
Cast a generic 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 generic typet to a struct_union_typet.
irept & add(const irep_namet &name)
#define Forall_subtypes(it, type)
#define Forall_operands(it, expr)
void insert(const irep_idt &identifier, const exprt &expr)
Expression to hold a symbol (variable)
const typet & subtype() const
const index_exprt & to_index_expr(const exprt &expr)
Cast a generic exprt to an index_exprt.
const irept & find(const irep_namet &name) const
const typet & return_type() const
const irep_idt & get_identifier() const