56 if(type.
id() == ID_symbol_type)
70 type.
id() == ID_c_enum_tag || type.
id() == ID_struct_tag ||
71 type.
id() == ID_union_tag)
84 else if(type.
id()==ID_array)
88 else if(type.
id()==ID_struct ||
97 else if(type.
id()==ID_pointer)
102 if(subtype.
id() == ID_symbol_type)
106 if(symb.find(
id) != symb.end())
116 subtype.
id() == ID_c_enum_tag || subtype.
id() == ID_struct_tag ||
117 subtype.
id() == ID_union_tag)
121 if(symb.find(
id)!=symb.end())
137 std::set<irep_idt> symb;
157 std::cout <<
"T1: " << type1.
pretty() <<
'\n';
158 std::cout <<
"T2: " << type2.
pretty() <<
'\n';
163 (type1.
id() == ID_symbol_type || type1.
id() == ID_c_enum_tag ||
164 type1.
id() == ID_struct_tag || type1.
id() == ID_union_tag) &&
165 type2.
id() == type1.
id())
169 type1.
get(ID_identifier),
170 type2.
get(ID_identifier)))
175 type1.
id() == ID_symbol_type || type1.
id() == ID_c_enum_tag ||
176 type1.
id() == ID_struct_tag || type1.
id() == ID_union_tag)
188 type2.
id() == ID_symbol_type || type2.
id() == ID_c_enum_tag ||
189 type2.
id() == ID_struct_tag || type2.
id() == ID_union_tag)
200 if(type1.
id()!=type2.
id())
203 if(type1.
id()==ID_struct ||
204 type1.
id()==ID_union)
212 if(components1.size()!=components2.size())
215 for(std::size_t i=0; i<components1.size(); i++)
217 const typet &subtype1=components1[i].type();
218 const typet &subtype2=components2[i].type();
221 if(components1[i].get_name()!=components2[i].get_name())
227 else if(type1.
id()==ID_incomplete_struct)
231 else if(type1.
id()==ID_incomplete_union)
235 else if(type1.
id()==ID_code)
243 if(parameters1.size()!=parameters2.size())
246 for(std::size_t i=0; i<parameters1.size(); i++)
248 const typet &subtype1=parameters1[i].type();
249 const typet &subtype2=parameters2[i].type();
262 else if(type1.
id()==ID_pointer)
267 else if(type1.
id()==ID_array)
278 else if(type1.
id()==ID_incomplete_array)
286 typet tmp1(type1), tmp2(type2);
298 if(expr1.
id()!=expr2.
id())
306 if(expr1_op.size()!=expr2_op.size())
309 for(exprt::operandst::const_iterator
310 it1=expr1_op.begin(), it2=expr2_op.begin();
311 it1!=expr1_op.end() && it2!=expr2_op.end();
316 if(expr1.
id()==ID_constant)
317 if(expr1.
get(ID_value)!=expr2.
get(ID_value))
The type of an expression, extends irept.
const irep_idt & get_identifier() const
std::string pretty(unsigned indent=0, unsigned max_indent=0) const
bool base_type_eq(const typet &type1, const typet &type2, const namespacet &ns)
Check types for equality across all levels of hierarchy.
const code_typet & to_code_type(const typet &type)
Cast a typet to a code_typet.
auto component(T &struct_expr, const irep_idt &name, const namespacet &ns) -> decltype(struct_expr.op0())
const tag_typet & to_tag_type(const typet &type)
Cast a typet to a tag_typet.
std::vector< componentt > componentst
const symbol_typet & to_symbol_type(const typet &type)
Cast a typet to a symbol_typet.
std::vector< parametert > parameterst
const componentst & components() const
typet & type()
Return the type of the expression.
const irep_idt & id() const
virtual bool base_type_eq_rec(const typet &type1, const typet &type2)
const irep_idt & get(const irep_namet &name) const
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
const exprt & size() const
void base_type_rec(typet &type, const namespacet &ns, std::set< irep_idt > &symb)
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
std::vector< exprt > operandst
const incomplete_array_typet & to_incomplete_array_type(const typet &type)
Cast a typet to an incomplete_array_typet.
base_type_eqt(const namespacet &_ns)
typet type
Type of symbol.
const array_typet & to_array_type(const typet &type)
Cast a typet to an array_typet.
Base class for all expressions.
const parameterst & parameters() const
const struct_union_typet & to_struct_union_type(const typet &type)
Cast a typet to a struct_union_typet.
bool base_type_eq(const exprt &expr1, const exprt &expr2)
void base_type(typet &type, const namespacet &ns)
bool base_type_eq(const typet &type1, const typet &type2)
#define Forall_operands(it, expr)
bool make_union(const T &a, const T &b)
const pointer_typet & to_pointer_type(const typet &type)
Cast a typet to a pointer_typet.
const typet & subtype() const
union_find< irep_idt > identifierst
const typet & return_type() const
bool lookup(const irep_idt &name, const symbolt *&symbol) const override
See documentation for namespace_baset::lookup().
const irep_idt & get_identifier() const