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 &va_arg_type =
104 static_cast<const typet&
>(dest.
find(ID_C_va_arg_type));
106 result &=
replace(static_cast<typet&>(dest.
add(ID_C_va_arg_type)));
123 if(dest.
id()==ID_symbol)
133 const irept &c_sizeof_type=dest.
find(ID_C_c_sizeof_type);
139 const irept &va_arg_type=dest.
find(ID_C_va_arg_type);
163 if(dest.
id()==ID_struct ||
170 for(struct_union_typet::componentst::iterator
171 it=components.begin();
172 it!=components.end();
177 else if(dest.
id()==ID_code)
183 for(code_typet::parameterst::iterator it = parameters.begin();
184 it!=parameters.end();
189 else if(dest.
id()==ID_symbol)
191 type_mapt::const_iterator it =
200 else if(dest.
id()==ID_array)
223 if(dest.
id()==ID_struct ||
232 for(struct_union_typet::componentst::const_iterator
233 it=components.begin();
234 it!=components.end();
239 else if(dest.
id()==ID_code)
247 for(code_typet::parameterst::const_iterator
248 it=parameters.begin();
249 it!=parameters.end();
254 else if(dest.
id()==ID_symbol)
259 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.
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()
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