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)
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)
247 typet tmp1(type1), tmp2(type2);
259 if(expr1.
id()!=expr2.
id())
267 if(expr1_op.size()!=expr2_op.size())
270 for(exprt::operandst::const_iterator
271 it1=expr1_op.begin(), it2=expr2_op.begin();
272 it1!=expr1_op.end() && it2!=expr2_op.end();
277 if(expr1.
id()==ID_constant)
278 if(expr1.
get(ID_value)!=expr2.
get(ID_value))
void base_type(typet &type, const namespacet &ns)
void base_type_rec(typet &type, const namespacet &ns, std::set< irep_idt > &symb)
bool base_type_eq(const typet &type1, const typet &type2, const namespacet &ns)
Check types for equality across all levels of hierarchy.
base_type_eqt(const namespacet &_ns)
virtual bool base_type_eq_rec(const typet &type1, const typet &type2)
bool base_type_eq(const typet &type1, const typet &type2)
union_find< irep_idt > identifierst
bool base_type_eq(const exprt &expr1, const exprt &expr2)
std::vector< parametert > parameterst
const parameterst & parameters() const
const typet & return_type() const
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Base class for all expressions.
std::vector< exprt > operandst
typet & type()
Return the type of the expression.
std::string pretty(unsigned indent=0, unsigned max_indent=0) const
const irep_idt & get(const irep_idt &name) const
const irep_idt & id() const
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
bool lookup(const irep_idt &name, const symbolt *&symbol) const override
See documentation for namespace_baset::lookup().
const typet & base_type() const
The type of the data what we point to.
const componentst & components() const
std::vector< componentt > componentst
typet type
Type of symbol.
const irep_idt & get_identifier() const
The type of an expression, extends irept.
bool make_union(const T &a, const T &b)
#define Forall_operands(it, expr)
API to expression classes for Pointers.
const pointer_typet & to_pointer_type(const typet &type)
Cast a typet to a pointer_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)
auto component(T &struct_expr, const irep_idt &name, const namespacet &ns) -> decltype(struct_expr.op0())
const code_typet & to_code_type(const typet &type)
Cast a typet to a code_typet.
const array_typet & to_array_type(const typet &type)
Cast a typet to an array_typet.
const struct_union_typet & to_struct_union_type(const typet &type)
Cast a typet to a struct_union_typet.
const tag_typet & to_tag_type(const typet &type)
Cast a typet to a tag_typet.