22 return ptr.
id()==ID_address_of
32 const typet &target_type,
35 assert(ptr.
type().
id()==ID_pointer);
40 if(ptr_base.
id()!=ID_struct)
48 const typet &first_field_type=
57 if(first_field_type==target_type)
67 if(in.
id()==ID_typecast)
69 assert(in.
type().
id()==ID_pointer);
83 const typet &target_type,
87 target_type.
id()==ID_pointer &&
88 "Non-pointer target in make_clean_pointer_cast?");
92 if(ptr.type()==target_type)
102 while(bare_ptr.
id()==ID_typecast)
105 bare_ptr.
type().
id()==ID_pointer &&
106 "Non-pointer in make_clean_pointer_cast?");
108 bare_ptr=bare_ptr.
op0();
112 bare_ptr.
type().
id()==ID_pointer &&
113 "Non-pointer in make_clean_pointer_cast?");
115 if(bare_ptr.
type()==target_type)
118 exprt superclass_ptr=bare_ptr;
120 return superclass_ptr;
The type of an expression.
const typet & follow(const typet &src) const
const componentst & components() const
Extract member of struct or union.
bool find_superclass_with_type(exprt &ptr, const typet &target_type, const namespacet &ns)
const irep_idt & id() const
Operator to dereference a pointer.
API to expression classes.
Operator to return the address of an object.
const struct_typet & to_struct_type(const typet &type)
Cast a generic typet to a struct_typet.
Base class for all expressions.
static exprt clean_deref(const exprt &ptr)
dereference pointer expression
static const exprt & look_through_casts(const exprt &in)
const typet & subtype() const
exprt make_clean_pointer_cast(const exprt &rawptr, const typet &target_type, const namespacet &ns)