24 if(type.
id()==ID_symbol ||
25 type.
id()==ID_c_enum_tag ||
26 type.
id()==ID_struct_tag ||
27 type.
id()==ID_union_tag)
31 if(!ns.
lookup(type.
get(ID_identifier), symbol) &&
40 else if(type.
id()==ID_array)
44 else if(type.
id()==ID_struct ||
50 for(
auto &component : components)
53 else if(type.
id()==ID_pointer)
58 if(subtype.
id()==ID_symbol ||
59 subtype.
id()==ID_c_enum_tag ||
60 subtype.
id()==ID_struct_tag ||
61 subtype.
id()==ID_union_tag)
65 if(symb.find(
id)!=symb.end())
81 std::set<irep_idt> symb;
101 std::cout <<
"T1: " << type1.
pretty() <<
'\n';
102 std::cout <<
"T2: " << type2.
pretty() <<
'\n';
106 if((type1.
id()==ID_symbol ||
107 type1.
id()==ID_c_enum_tag ||
108 type1.
id()==ID_struct_tag ||
109 type1.
id()==ID_union_tag) &&
110 type2.
id()==type1.
id())
114 type1.
get(ID_identifier),
115 type2.
get(ID_identifier)))
119 if(type1.
id()==ID_symbol ||
120 type1.
id()==ID_c_enum_tag ||
121 type1.
id()==ID_struct_tag ||
122 type1.
id()==ID_union_tag)
133 if(type2.
id()==ID_symbol ||
134 type2.
id()==ID_c_enum_tag ||
135 type2.
id()==ID_struct_tag ||
136 type2.
id()==ID_union_tag)
147 if(type1.
id()!=type2.
id())
150 if(type1.
id()==ID_struct ||
151 type1.
id()==ID_union)
159 if(components1.size()!=components2.size())
162 for(
unsigned i=0; i<components1.size(); i++)
164 const typet &subtype1=components1[i].type();
165 const typet &subtype2=components2[i].type();
168 if(components1[i].get_name()!=components2[i].get_name())
174 else if(type1.
id()==ID_incomplete_struct)
178 else if(type1.
id()==ID_incomplete_union)
182 else if(type1.
id()==ID_code)
190 if(parameters1.size()!=parameters2.size())
193 for(
unsigned i=0; i<parameters1.size(); i++)
195 const typet &subtype1=parameters1[i].type();
196 const typet &subtype2=parameters2[i].type();
209 else if(type1.
id()==ID_pointer)
214 else if(type1.
id()==ID_array)
225 else if(type1.
id()==ID_incomplete_array)
233 typet tmp1(type1), tmp2(type2);
245 if(expr1.
id()!=expr2.
id())
253 if(expr1_op.size()!=expr2_op.size())
256 for(exprt::operandst::const_iterator
257 it1=expr1_op.begin(), it2=expr2_op.begin();
258 it1!=expr1_op.end() && it2!=expr2_op.end();
263 if(expr1.
id()==ID_constant)
264 if(expr1.
get(ID_value)!=expr2.
get(ID_value))
The type of an expression.
virtual bool lookup(const irep_idt &name, const symbolt *&symbol) const
std::string pretty(unsigned indent=0, unsigned max_indent=0) const
std::vector< componentt > componentst
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 struct_union_typet & to_struct_union_type(const typet &type)
Cast a generic typet to a struct_union_typet.
const irep_idt & id() const
const array_typet & to_array_type(const typet &type)
Cast a generic typet to an array_typet.
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 pointer_typet & to_pointer_type(const typet &type)
Cast a generic typet to a pointer_typet.
typet type
Type of symbol.
const incomplete_array_typet & to_incomplete_array_type(const typet &type)
Cast a generic typet to an incomplete_array_typet.
Base class for all expressions.
const parameterst & parameters() const
void base_type(typet &type, const namespacet &ns)
bool base_type_eq(const typet &type1, const typet &type2)
const code_typet & to_code_type(const typet &type)
Cast a generic typet to a code_typet.
#define Forall_operands(it, expr)
bool make_union(const T &a, const T &b)
const typet & subtype() const
const typet & return_type() const