Go to the documentation of this file.
35 exprt * modifiable_expr =
nullptr;
40 modifiable_expr = &it.mutate();
45 if(it->id()==ID_symbol)
47 expr_mapt::const_iterator entry =
53 modifiable_expr = &it.mutate();
59 const typet &c_sizeof_type =
60 static_cast<const typet&
>(it->find(ID_C_c_sizeof_type));
64 modifiable_expr = &it.mutate();
66 rename(
static_cast<typet&
>(modifiable_expr->
add(ID_C_c_sizeof_type)));
69 const typet &va_arg_type =
70 static_cast<const typet&
>(it->find(ID_C_va_arg_type));
74 modifiable_expr = &it.mutate();
76 rename(
static_cast<typet&
>(modifiable_expr->
add(ID_C_va_arg_type)));
95 if(dest.
id()==ID_symbol)
105 const irept &c_sizeof_type=dest.
find(ID_C_c_sizeof_type);
111 const irept &va_arg_type=dest.
find(ID_C_va_arg_type);
137 if(dest.
id()==ID_struct ||
146 else if(dest.
id()==ID_code)
157 expr_mapt::const_iterator e_it =
expr_map.find(p.get_identifier());
161 p.set_identifier(e_it->second);
166 const exprt &spec_assigns =
167 static_cast<const exprt &
>(dest.
find(ID_C_spec_assigns));
174 const exprt &spec_ensures =
175 static_cast<const exprt &
>(dest.
find(ID_C_spec_ensures));
182 const exprt &spec_ensures_contract =
183 static_cast<const exprt &
>(dest.
find(ID_C_spec_ensures_contract));
188 rename(
static_cast<exprt &
>(dest.
add(ID_C_spec_ensures_contract)));
192 const exprt &spec_requires =
193 static_cast<const exprt &
>(dest.
find(ID_C_spec_requires));
200 const exprt &spec_requires_contract =
201 static_cast<const exprt &
>(dest.
find(ID_C_spec_requires_contract));
206 rename(
static_cast<exprt &
>(dest.
add(ID_C_spec_requires_contract)));
210 else if(dest.
id()==ID_c_enum_tag ||
211 dest.
id()==ID_struct_tag ||
212 dest.
id()==ID_union_tag)
214 type_mapt::const_iterator it=
223 else if(dest.
id()==ID_array)
248 if(dest.
id()==ID_struct ||
254 for(
const auto &c : struct_union_type.
components())
258 else if(dest.
id()==ID_code)
273 const exprt &spec_assigns =
274 static_cast<const exprt &
>(dest.
find(ID_C_spec_assigns));
278 const exprt &spec_ensures =
279 static_cast<const exprt &
>(dest.
find(ID_C_spec_ensures));
283 const exprt &spec_ensures_contract =
284 static_cast<const exprt &
>(dest.
find(ID_C_spec_ensures_contract));
292 const exprt &spec_requires =
293 static_cast<const exprt &
>(dest.
find(ID_C_spec_requires));
297 const exprt &spec_requires_contract =
298 static_cast<const exprt &
>(dest.
find(ID_C_spec_requires_contract));
306 else if(dest.
id()==ID_c_enum_tag ||
307 dest.
id()==ID_struct_tag ||
308 dest.
id()==ID_union_tag)
310 else if(dest.
id()==ID_array)
const irep_idt & get_identifier() const
const componentst & components() const
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
void set_identifier(const irep_idt &identifier)
depth_iteratort depth_end()
const struct_union_typet & to_struct_union_type(const typet &type)
Cast a typet to a struct_union_typet.
bool have_to_rename(const exprt &dest) const
The type of an expression, extends irept.
const irept & find(const irep_idt &name) const
Base type for structs and unions.
const type_with_subtypet & to_type_with_subtype(const typet &type)
const type_with_subtypest & to_type_with_subtypes(const typet &type)
Base class for all expressions.
Expression to hold a symbol (variable)
const exprt & size() const
typet & type()
Return the type of the expression.
const code_typet & to_code_type(const typet &type)
Cast a typet to a code_typet.
const tag_typet & to_tag_type(const typet &type)
Cast a typet to a tag_typet.
static optionalt< smt_termt > get_identifier(const exprt &expr, const std::unordered_map< exprt, smt_identifier_termt, irep_hash > &expression_handle_identifiers, const std::unordered_map< exprt, smt_identifier_termt, irep_hash > &expression_identifiers)
void insert(const class symbol_exprt &old_expr, const class symbol_exprt &new_expr)
#define forall_operands(it, expr)
const irep_idt & get_identifier() const
const symbol_exprt & to_symbol_expr(const exprt &expr)
Cast an exprt to a symbol_exprt.
const irep_idt & id() const
const parameterst & parameters() const
virtual ~rename_symbolt()
irept & add(const irep_idt &name)
depth_iteratort depth_begin()
void insert_expr(const irep_idt &old_id, const irep_idt &new_id)
const array_typet & to_array_type(const typet &type)
Cast a typet to an array_typet.
const typet & return_type() const
There are a large number of kinds of tree structured or tree-like data in CPROVER.
bool rename(exprt &dest) const
void set_identifier(const irep_idt &identifier)