Skip to content

remove symbol_type support from C front-end #3024

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions src/ansi-c/c_typecast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ bool check_c_implicit_typecast(
typet c_typecastt::follow_with_qualifiers(const typet &src_type)
{
if(
src_type.id() != ID_symbol_type &&
src_type.id() != ID_struct_tag &&
src_type.id() != ID_union_tag)
{
Expand All @@ -265,9 +264,7 @@ typet c_typecastt::follow_with_qualifiers(const typet &src_type)
// collect qualifiers
c_qualifierst qualifiers(src_type);

while(result_type.id() == ID_symbol_type ||
result_type.id() == ID_struct_tag ||
result_type.id() == ID_union_tag)
while(result_type.id() == ID_struct_tag || result_type.id() == ID_union_tag)
{
const typet &followed_type = ns.follow(result_type);
result_type = followed_type;
Expand Down Expand Up @@ -350,8 +347,6 @@ c_typecastt::c_typet c_typecastt::get_c_type(
{
return INT;
}
else if(type.id() == ID_symbol_type)
return get_c_type(ns.follow(type));
else if(type.id()==ID_rational)
return RATIONAL;
else if(type.id()==ID_real)
Expand Down
1 change: 0 additions & 1 deletion src/ansi-c/c_typecheck_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ class c_typecheck_baset:
virtual void typecheck_c_enum_type(typet &type);
virtual void typecheck_c_enum_tag_type(c_enum_tag_typet &type);
virtual void typecheck_code_type(code_typet &type);
virtual void typecheck_symbol_type(symbol_typet &type);
virtual void typecheck_typedef_type(typet &type);
virtual void typecheck_c_bit_field_type(c_bit_field_typet &type);
virtual void typecheck_typeof_type(typet &type);
Expand Down
4 changes: 1 addition & 3 deletions src/ansi-c/c_typecheck_code.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,9 +383,7 @@ bool c_typecheck_baset::is_complete_type(const typet &type) const
}
else if(type.id()==ID_vector)
return is_complete_type(type.subtype());
else if(
type.id() == ID_symbol_type || type.id() == ID_struct_tag ||
type.id() == ID_union_tag)
else if(type.id() == ID_struct_tag || type.id() == ID_union_tag)
{
return is_complete_type(follow(type));
}
Expand Down
8 changes: 0 additions & 8 deletions src/ansi-c/c_typecheck_expr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,6 @@ bool c_typecheck_baset::gcc_types_compatible_p(
// read
// http://gcc.gnu.org/onlinedocs/gcc-3.3.6/gcc/Other-Builtins.html

if(type1.id() == ID_symbol_type)
return gcc_types_compatible_p(follow(type1), type2);
else if(type2.id() == ID_symbol_type)
return gcc_types_compatible_p(type1, follow(type2));

// check qualifiers first
if(c_qualifierst(type1)!=c_qualifierst(type2))
return false;
Expand Down Expand Up @@ -3158,9 +3153,6 @@ void c_typecheck_baset::typecheck_arithmetic_pointer(const exprt &expr)

typet subtype=type.subtype();

if(subtype.id() == ID_symbol_type)
subtype = follow(to_symbol_type(subtype));

if(subtype.id()==ID_incomplete_struct)
{
err_location(expr);
Expand Down
28 changes: 0 additions & 28 deletions src/ansi-c/c_typecheck_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ void c_typecheck_baset::typecheck_type(typet &type)
typecheck_c_bit_field_type(to_c_bit_field_type(type));
else if(type.id()==ID_typeof)
typecheck_typeof_type(type);
else if(type.id() == ID_symbol_type)
typecheck_symbol_type(to_symbol_type(type));
else if(type.id() == ID_typedef_type)
typecheck_typedef_type(type);
else if(type.id() == ID_struct_tag ||
Expand Down Expand Up @@ -1458,32 +1456,6 @@ void c_typecheck_baset::typecheck_typeof_type(typet &type)
c_qualifiers.write(type);
}

void c_typecheck_baset::typecheck_symbol_type(symbol_typet &type)
{
// we do some consistency checking only
const irep_idt &identifier = type.get_identifier();

symbol_tablet::symbolst::const_iterator s_it=
symbol_table.symbols.find(identifier);

if(s_it==symbol_table.symbols.end())
{
error().source_location=type.source_location();
error() << "type symbol `" << identifier << "' not found"
<< eom;
throw 0;
}

const symbolt &symbol=s_it->second;

if(!symbol.is_type)
{
error().source_location=type.source_location();
error() << "expected type symbol" << eom;
throw 0;
}
}

void c_typecheck_baset::typecheck_typedef_type(typet &type)
{
const irep_idt &identifier = to_typedef_type(type).get_identifier();
Expand Down
2 changes: 0 additions & 2 deletions src/ansi-c/padding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ mp_integer alignment(const typet &type, const namespacet &ns)
result = alignment(ns.follow_tag(to_struct_tag_type(type)), ns);
else if(type.id() == ID_union_tag)
result = alignment(ns.follow_tag(to_union_tag_type(type)), ns);
else if(type.id() == ID_symbol_type)
result = alignment(ns.follow(to_symbol_type(type)), ns);
else if(type.id()==ID_c_bit_field)
{
// we align these according to the 'underlying type'
Expand Down