Skip to content

Commit 60a1235

Browse files
authored
Merge pull request #3024 from diffblue/ansi-c-symbol-type
remove symbol_type support from C front-end
2 parents 79f7030 + 7cfb9f8 commit 60a1235

File tree

6 files changed

+2
-48
lines changed

6 files changed

+2
-48
lines changed

src/ansi-c/c_typecast.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,6 @@ bool check_c_implicit_typecast(
253253
typet c_typecastt::follow_with_qualifiers(const typet &src_type)
254254
{
255255
if(
256-
src_type.id() != ID_symbol_type &&
257256
src_type.id() != ID_struct_tag &&
258257
src_type.id() != ID_union_tag)
259258
{
@@ -265,9 +264,7 @@ typet c_typecastt::follow_with_qualifiers(const typet &src_type)
265264
// collect qualifiers
266265
c_qualifierst qualifiers(src_type);
267266

268-
while(result_type.id() == ID_symbol_type ||
269-
result_type.id() == ID_struct_tag ||
270-
result_type.id() == ID_union_tag)
267+
while(result_type.id() == ID_struct_tag || result_type.id() == ID_union_tag)
271268
{
272269
const typet &followed_type = ns.follow(result_type);
273270
result_type = followed_type;
@@ -350,8 +347,6 @@ c_typecastt::c_typet c_typecastt::get_c_type(
350347
{
351348
return INT;
352349
}
353-
else if(type.id() == ID_symbol_type)
354-
return get_c_type(ns.follow(type));
355350
else if(type.id()==ID_rational)
356351
return RATIONAL;
357352
else if(type.id()==ID_real)

src/ansi-c/c_typecheck_base.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,6 @@ class c_typecheck_baset:
209209
virtual void typecheck_c_enum_type(typet &type);
210210
virtual void typecheck_c_enum_tag_type(c_enum_tag_typet &type);
211211
virtual void typecheck_code_type(code_typet &type);
212-
virtual void typecheck_symbol_type(symbol_typet &type);
213212
virtual void typecheck_typedef_type(typet &type);
214213
virtual void typecheck_c_bit_field_type(c_bit_field_typet &type);
215214
virtual void typecheck_typeof_type(typet &type);

src/ansi-c/c_typecheck_code.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -383,9 +383,7 @@ bool c_typecheck_baset::is_complete_type(const typet &type) const
383383
}
384384
else if(type.id()==ID_vector)
385385
return is_complete_type(type.subtype());
386-
else if(
387-
type.id() == ID_symbol_type || type.id() == ID_struct_tag ||
388-
type.id() == ID_union_tag)
386+
else if(type.id() == ID_struct_tag || type.id() == ID_union_tag)
389387
{
390388
return is_complete_type(follow(type));
391389
}

src/ansi-c/c_typecheck_expr.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,6 @@ bool c_typecheck_baset::gcc_types_compatible_p(
9191
// read
9292
// http://gcc.gnu.org/onlinedocs/gcc-3.3.6/gcc/Other-Builtins.html
9393

94-
if(type1.id() == ID_symbol_type)
95-
return gcc_types_compatible_p(follow(type1), type2);
96-
else if(type2.id() == ID_symbol_type)
97-
return gcc_types_compatible_p(type1, follow(type2));
98-
9994
// check qualifiers first
10095
if(c_qualifierst(type1)!=c_qualifierst(type2))
10196
return false;
@@ -3159,9 +3154,6 @@ void c_typecheck_baset::typecheck_arithmetic_pointer(const exprt &expr)
31593154

31603155
typet subtype=type.subtype();
31613156

3162-
if(subtype.id() == ID_symbol_type)
3163-
subtype = follow(to_symbol_type(subtype));
3164-
31653157
if(subtype.id()==ID_incomplete_struct)
31663158
{
31673159
err_location(expr);

src/ansi-c/c_typecheck_type.cpp

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,6 @@ void c_typecheck_baset::typecheck_type(typet &type)
8989
typecheck_c_bit_field_type(to_c_bit_field_type(type));
9090
else if(type.id()==ID_typeof)
9191
typecheck_typeof_type(type);
92-
else if(type.id() == ID_symbol_type)
93-
typecheck_symbol_type(to_symbol_type(type));
9492
else if(type.id() == ID_typedef_type)
9593
typecheck_typedef_type(type);
9694
else if(type.id() == ID_struct_tag ||
@@ -1458,32 +1456,6 @@ void c_typecheck_baset::typecheck_typeof_type(typet &type)
14581456
c_qualifiers.write(type);
14591457
}
14601458

1461-
void c_typecheck_baset::typecheck_symbol_type(symbol_typet &type)
1462-
{
1463-
// we do some consistency checking only
1464-
const irep_idt &identifier = type.get_identifier();
1465-
1466-
symbol_tablet::symbolst::const_iterator s_it=
1467-
symbol_table.symbols.find(identifier);
1468-
1469-
if(s_it==symbol_table.symbols.end())
1470-
{
1471-
error().source_location=type.source_location();
1472-
error() << "type symbol `" << identifier << "' not found"
1473-
<< eom;
1474-
throw 0;
1475-
}
1476-
1477-
const symbolt &symbol=s_it->second;
1478-
1479-
if(!symbol.is_type)
1480-
{
1481-
error().source_location=type.source_location();
1482-
error() << "expected type symbol" << eom;
1483-
throw 0;
1484-
}
1485-
}
1486-
14871459
void c_typecheck_baset::typecheck_typedef_type(typet &type)
14881460
{
14891461
const irep_idt &identifier = to_typedef_type(type).get_identifier();

src/ansi-c/padding.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,6 @@ mp_integer alignment(const typet &type, const namespacet &ns)
8686
result = alignment(ns.follow_tag(to_struct_tag_type(type)), ns);
8787
else if(type.id() == ID_union_tag)
8888
result = alignment(ns.follow_tag(to_union_tag_type(type)), ns);
89-
else if(type.id() == ID_symbol_type)
90-
result = alignment(ns.follow(to_symbol_type(type)), ns);
9189
else if(type.id()==ID_c_bit_field)
9290
{
9391
// we align these according to the 'underlying type'

0 commit comments

Comments
 (0)