Go to the documentation of this file.
57 type.
id() == ID_c_enum_tag || type.
id() == ID_struct_tag ||
58 type.
id() == ID_union_tag)
71 else if(type.
id()==ID_array)
75 else if(type.
id()==ID_struct ||
84 else if(type.
id()==ID_pointer)
90 subtype.
id() == ID_c_enum_tag || subtype.
id() == ID_struct_tag ||
91 subtype.
id() == ID_union_tag)
95 if(symb.find(
id)!=symb.end())
111 std::set<irep_idt> symb;
131 std::cout <<
"T1: " << type1.
pretty() <<
'\n';
132 std::cout <<
"T2: " << type2.
pretty() <<
'\n';
137 (type1.
id() == ID_c_enum_tag || type1.
id() == ID_struct_tag ||
138 type1.
id() == ID_union_tag) &&
139 type2.
id() == type1.
id())
143 type1.
get(ID_identifier),
144 type2.
get(ID_identifier)))
149 type1.
id() == ID_c_enum_tag || type1.
id() == ID_struct_tag ||
150 type1.
id() == ID_union_tag)
162 type2.
id() == ID_c_enum_tag || type2.
id() == ID_struct_tag ||
163 type2.
id() == ID_union_tag)
174 if(type1.
id()!=type2.
id())
177 if(type1.
id()==ID_struct ||
178 type1.
id()==ID_union)
186 if(components1.size()!=components2.size())
189 for(std::size_t i=0; i<components1.size(); i++)
191 const typet &subtype1=components1[i].type();
192 const typet &subtype2=components2[i].type();
195 if(components1[i].get_name()!=components2[i].get_name())
201 else if(type1.
id()==ID_code)
209 if(parameters1.size()!=parameters2.size())
212 for(std::size_t i=0; i<parameters1.size(); i++)
214 const typet &subtype1=parameters1[i].type();
215 const typet &subtype2=parameters2[i].type();
228 else if(type1.
id()==ID_pointer)
233 else if(type1.
id()==ID_array)
246 typet tmp1(type1), tmp2(type2);
258 if(expr1.
id()!=expr2.
id())
266 if(expr1_op.size()!=expr2_op.size())
269 for(exprt::operandst::const_iterator
270 it1=expr1_op.begin(), it2=expr2_op.begin();
271 it1!=expr1_op.end() && it2!=expr2_op.end();
276 if(expr1.
id()==ID_constant)
277 if(expr1.
get(ID_value)!=expr2.
get(ID_value))
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.
const typet & subtype() const
#define Forall_operands(it, expr)
bool base_type_eq(const exprt &expr1, const exprt &expr2)
const struct_union_typet & to_struct_union_type(const typet &type)
Cast a typet to a struct_union_typet.
The type of an expression, extends irept.
std::vector< parametert > parameterst
std::string pretty(unsigned indent=0, unsigned max_indent=0) const
typet type
Type of symbol.
void base_type_rec(typet &type, const namespacet &ns, std::set< irep_idt > &symb)
Base class for all expressions.
std::vector< componentt > componentst
union_find< irep_idt > identifierst
auto component(T &struct_expr, const irep_idt &name, const namespacet &ns) -> decltype(struct_expr.op0())
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
typet & type()
Return the type of the expression.
bool lookup(const irep_idt &name, const symbolt *&symbol) const override
See documentation for namespace_baset::lookup().
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.
void base_type(typet &type, const namespacet &ns)
bool base_type_eq(const typet &type1, const typet &type2, const namespacet &ns)
Check types for equality across all levels of hierarchy.
virtual bool base_type_eq_rec(const typet &type1, const typet &type2)
bool base_type_eq(const typet &type1, const typet &type2)
const irep_idt & id() const
std::vector< exprt > operandst
const parameterst & parameters() const
const pointer_typet & to_pointer_type(const typet &type)
Cast a typet to a pointer_typet.
bool make_union(const T &a, const T &b)
base_type_eqt(const namespacet &_ns)
const irep_idt & get(const irep_namet &name) const
const array_typet & to_array_type(const typet &type)
Cast a typet to an array_typet.
const typet & return_type() const