Skip to content

Commit 09160a1

Browse files
author
Daniel Kroening
committed
type symbols now use ID_symbol_type
1 parent 2382f27 commit 09160a1

11 files changed

+23
-22
lines changed

src/ansi-c/c_typecast.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -252,15 +252,15 @@ bool check_c_implicit_typecast(
252252

253253
typet c_typecastt::follow_with_qualifiers(const typet &src_type)
254254
{
255-
if(src_type.id()!=ID_symbol)
255+
if(src_type.id()!=ID_symbol_type)
256256
return src_type;
257257

258258
typet result_type=src_type;
259259

260260
// collect qualifiers
261261
c_qualifierst qualifiers(src_type);
262262

263-
while(result_type.id()==ID_symbol)
263+
while(result_type.id()==ID_symbol_type)
264264
{
265265
const symbolt &followed_type_symbol=
266266
ns.lookup(result_type.get(ID_identifier));
@@ -345,7 +345,7 @@ c_typecastt::c_typet c_typecastt::get_c_type(
345345
{
346346
return INT;
347347
}
348-
else if(type.id()==ID_symbol)
348+
else if(type.id()==ID_symbol_type)
349349
return get_c_type(ns.follow(type));
350350
else if(type.id()==ID_rational)
351351
return RATIONAL;

src/ansi-c/c_typecheck_base.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ void c_typecheck_baset::typecheck_redefinition_non_type(
404404
final_old.subtype()==final_new.subtype())
405405
{
406406
// we don't do symbol types for arrays anymore
407-
PRECONDITION(old_symbol.type.id()!=ID_symbol);
407+
PRECONDITION(old_symbol.type.id()!=ID_symbol_type);
408408
old_symbol.type=new_symbol.type;
409409
}
410410
else if((final_old.id()==ID_incomplete_c_enum ||

src/ansi-c/c_typecheck_code.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ bool c_typecheck_baset::is_complete_type(const typet &type) const
384384
}
385385
else if(type.id()==ID_vector)
386386
return is_complete_type(type.subtype());
387-
else if(type.id()==ID_symbol)
387+
else if(type.id()==ID_symbol_type)
388388
return is_complete_type(follow(type));
389389

390390
return true;

src/ansi-c/c_typecheck_expr.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ bool c_typecheck_baset::gcc_types_compatible_p(
8888
// read
8989
// http://gcc.gnu.org/onlinedocs/gcc-3.3.6/gcc/Other-Builtins.html
9090

91-
if(type1.id()==ID_symbol)
91+
if(type1.id()==ID_symbol_type)
9292
return gcc_types_compatible_p(follow(type1), type2);
93-
else if(type2.id()==ID_symbol)
93+
else if(type2.id()==ID_symbol_type)
9494
return gcc_types_compatible_p(type1, follow(type2));
9595

9696
// check qualifiers first
@@ -523,8 +523,8 @@ void c_typecheck_baset::typecheck_expr_builtin_offsetof(exprt &expr)
523523

524524
forall_operands(m_it, member)
525525
{
526-
if(type.id()==ID_symbol)
527-
type=follow(type);
526+
if(type.id()==ID_symbol_type)
527+
type=follow(to_symbol_type(type));
528528

529529
if(m_it->id()==ID_member)
530530
{
@@ -2956,8 +2956,8 @@ void c_typecheck_baset::typecheck_arithmetic_pointer(const exprt &expr)
29562956

29572957
typet subtype=type.subtype();
29582958

2959-
if(subtype.id()==ID_symbol)
2960-
subtype=follow(subtype);
2959+
if(subtype.id()==ID_symbol_type)
2960+
subtype=follow(to_symbol_type(subtype));
29612961

29622962
if(subtype.id()==ID_incomplete_struct)
29632963
{

src/ansi-c/expr2c.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ std::string expr2ct::convert_rec(
446446
return convert_rec(
447447
src.subtype(), qualifiers, declarator+"[]");
448448
}
449-
else if(src.id()==ID_symbol)
449+
else if(src.id()==ID_symbol_type)
450450
{
451451
symbol_typet symbolic_type=to_symbol_type(src);
452452
const irep_idt &typedef_identifer=symbolic_type.get(ID_typedef);

src/ansi-c/padding.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ mp_integer alignment(const typet &type, const namespacet &ns)
8282
result=alignment(type.subtype(), ns);
8383
else if(type.id()==ID_c_enum_tag)
8484
result=alignment(ns.follow_tag(to_c_enum_tag_type(type)), ns);
85-
else if(type.id()==ID_symbol)
86-
result=alignment(ns.follow(type), ns);
85+
else if(type.id()==ID_symbol_type)
86+
result=alignment(ns.follow(to_symbol_type(type)), ns);
8787
else if(type.id()==ID_c_bit_field)
8888
{
8989
// we align these according to the 'underlying type'

src/ansi-c/type2name.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ static std::string type2name(
186186
else
187187
result+="ARR"+integer2string(size);
188188
}
189-
else if(type.id()==ID_symbol ||
189+
else if(type.id()==ID_symbol_type ||
190190
type.id()==ID_c_enum_tag ||
191191
type.id()==ID_struct_tag ||
192192
type.id()==ID_union_tag)

src/cpp/cpp_convert_type.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ void cpp_convert_plain_type(typet &type)
574574
type.id()==ID_bool ||
575575
type.id()==ID_floatbv ||
576576
type.id()==ID_empty ||
577-
type.id()==ID_symbol ||
577+
type.id()==ID_symbol_type ||
578578
type.id()==ID_constructor ||
579579
type.id()==ID_destructor)
580580
{

src/util/irep_ids.def

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ IREP_ID_ONE(bitxnor)
5858
IREP_ID_ONE(notequal)
5959
IREP_ID_ONE(if)
6060
IREP_ID_ONE(symbol)
61+
IREP_ID_ONE(symbol_type)
6162
IREP_ID_ONE(next_symbol)
6263
IREP_ID_ONE(nondet_symbol)
6364
IREP_ID_ONE(predicate_symbol)

src/util/namespace.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ void namespace_baset::follow_symbol(irept &irep) const
6969

7070
const typet &namespace_baset::follow(const typet &src) const
7171
{
72-
if(src.id()!=ID_symbol)
72+
if(src.id()!=ID_symbol_type)
7373
return src;
7474

7575
const symbolt *symbol=&lookup(src);
@@ -78,7 +78,7 @@ const typet &namespace_baset::follow(const typet &src) const
7878
while(true)
7979
{
8080
assert(symbol->is_type);
81-
if(symbol->type.id()!=ID_symbol)
81+
if(symbol->type.id()!=ID_symbol_type)
8282
return symbol->type;
8383
symbol=&lookup(symbol->type);
8484
}

src/util/std_types.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,11 @@ class real_typet:public typet
110110
class symbol_typet:public typet
111111
{
112112
public:
113-
symbol_typet():typet(ID_symbol)
113+
symbol_typet():typet(ID_symbol_type)
114114
{
115115
}
116116

117-
explicit symbol_typet(const irep_idt &identifier):typet(ID_symbol)
117+
explicit symbol_typet(const irep_idt &identifier):typet(ID_symbol_type)
118118
{
119119
set_identifier(identifier);
120120
}
@@ -142,7 +142,7 @@ class symbol_typet:public typet
142142
*/
143143
inline const symbol_typet &to_symbol_type(const typet &type)
144144
{
145-
PRECONDITION(type.id()==ID_symbol);
145+
PRECONDITION(type.id()==ID_symbol_type);
146146
return static_cast<const symbol_typet &>(type);
147147
}
148148

@@ -151,7 +151,7 @@ inline const symbol_typet &to_symbol_type(const typet &type)
151151
*/
152152
inline symbol_typet &to_symbol_type(typet &type)
153153
{
154-
PRECONDITION(type.id()==ID_symbol);
154+
PRECONDITION(type.id()==ID_symbol_type);
155155
return static_cast<symbol_typet &>(type);
156156
}
157157

0 commit comments

Comments
 (0)