56 if(type.
id() == ID_symbol)
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 ||
94 for(
auto &component : components)
97 else if(type.
id()==ID_pointer)
102 if(subtype.
id() == ID_symbol)
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';
162 if((type1.
id()==ID_symbol ||
163 type1.
id()==ID_c_enum_tag ||
164 type1.
id()==ID_struct_tag ||
165 type1.
id()==ID_union_tag) &&
166 type2.
id()==type1.
id())
170 type1.
get(ID_identifier),
171 type2.
get(ID_identifier)))
175 if(type1.
id()==ID_symbol ||
176 type1.
id()==ID_c_enum_tag ||
177 type1.
id()==ID_struct_tag ||
178 type1.
id()==ID_union_tag)
189 if(type2.
id()==ID_symbol ||
190 type2.
id()==ID_c_enum_tag ||
191 type2.
id()==ID_struct_tag ||
192 type2.
id()==ID_union_tag)
203 if(type1.
id()!=type2.
id())
206 if(type1.
id()==ID_struct ||
207 type1.
id()==ID_union)
215 if(components1.size()!=components2.size())
218 for(std::size_t i=0; i<components1.size(); i++)
220 const typet &subtype1=components1[i].type();
221 const typet &subtype2=components2[i].type();
224 if(components1[i].get_name()!=components2[i].get_name())
230 else if(type1.
id()==ID_incomplete_struct)
234 else if(type1.
id()==ID_incomplete_union)
238 else if(type1.
id()==ID_code)
246 if(parameters1.size()!=parameters2.size())
249 for(std::size_t i=0; i<parameters1.size(); i++)
251 const typet &subtype1=parameters1[i].type();
252 const typet &subtype2=parameters2[i].type();
265 else if(type1.
id()==ID_pointer)
270 else if(type1.
id()==ID_array)
281 else if(type1.
id()==ID_incomplete_array)
289 typet tmp1(type1), tmp2(type2);
301 if(expr1.
id()!=expr2.
id())
309 if(expr1_op.size()!=expr2_op.size())
312 for(exprt::operandst::const_iterator
313 it1=expr1_op.begin(), it2=expr2_op.begin();
314 it1!=expr1_op.end() && it2!=expr2_op.end();
319 if(expr1.
id()==ID_constant)
320 if(expr1.
get(ID_value)!=expr2.
get(ID_value))
The type of an expression.
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)
const code_typet & to_code_type(const typet &type)
Cast a generic typet to a code_typet.
const tag_typet & to_tag_type(const typet &type)
Cast a generic typet to a tag_typet.
std::vector< componentt > componentst
const symbol_typet & to_symbol_type(const typet &type)
Cast a generic typet to a symbol_typet.
std::vector< parametert > parameterst
const componentst & components() const
Symbol table entry.This is a symbol in the symbol table, stored in an object of type symbol_tablet...
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
const exprt & size() const
void base_type_rec(typet &type, const namespacet &ns, std::set< irep_idt > &symb)
std::vector< exprt > operandst
const incomplete_array_typet & to_incomplete_array_type(const typet &type)
Cast a generic 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 generic 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 generic 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 generic 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 namespace_baset::lookup().
const irep_idt & get_identifier() const