diff --git a/src/ansi-c/c_typecast.cpp b/src/ansi-c/c_typecast.cpp index 0bb7fa0da08..85541711fab 100644 --- a/src/ansi-c/c_typecast.cpp +++ b/src/ansi-c/c_typecast.cpp @@ -13,7 +13,6 @@ Author: Daniel Kroening, kroening@kroening.com #include #include -#include #include #include #include @@ -551,7 +550,7 @@ void c_typecastt::implicit_typecast_followed( // very generous: // between any two function pointers it's ok } - else if(base_type_eq(src_sub, dest_sub, ns)) + else if(src_sub == dest_sub) { // ok } @@ -565,9 +564,9 @@ void c_typecastt::implicit_typecast_followed( // Also generous: between any to scalar types it's ok. // We should probably check the size. } - else if(src_sub.id()==ID_array && - dest_sub.id()==ID_array && - base_type_eq(src_sub.subtype(), dest_sub.subtype(), ns)) + else if( + src_sub.id() == ID_array && dest_sub.id() == ID_array && + src_sub.subtype() == dest_sub.subtype()) { // we ignore the size of the top-level array // in the case of pointers to arrays diff --git a/src/ansi-c/c_typecheck_expr.cpp b/src/ansi-c/c_typecheck_expr.cpp index be6cba22c55..b852bb16100 100644 --- a/src/ansi-c/c_typecheck_expr.cpp +++ b/src/ansi-c/c_typecheck_expr.cpp @@ -14,7 +14,6 @@ Author: Daniel Kroening, kroening@kroening.com #include #include -#include #include #include #include @@ -1064,9 +1063,9 @@ void c_typecheck_baset::typecheck_expr_typecast(exprt &expr) const typet expr_type=follow(expr.type()); - if(expr_type.id()==ID_union && - !base_type_eq(expr_type, op.type(), *this) && - op.id()!=ID_initializer_list) + if( + expr_type.id() == ID_union && expr_type != op.type() && + op.id() != ID_initializer_list) { // This is a GCC extension. It's either a 'temporary union', // where the argument is one of the member types. @@ -1080,7 +1079,7 @@ void c_typecheck_baset::typecheck_expr_typecast(exprt &expr) // we need to find a member with the right type for(const auto &c : to_union_type(expr_type).components()) { - if(base_type_eq(c.type(), op.type(), *this)) + if(c.type() == op.type()) { // found! build union constructor union_exprt union_expr(c.get_name(), op, expr.type()); @@ -1131,7 +1130,7 @@ void c_typecheck_baset::typecheck_expr_typecast(exprt &expr) const typet op_type = op.type(); // cast to same type? - if(base_type_eq(expr_type, op_type, *this)) + if(expr_type == op_type) return; // it's ok // vectors? @@ -2516,8 +2515,7 @@ exprt c_typecheck_baset::do_special_functions( expr.arguments().front(), expr.arguments().back()); equality_expr.add_source_location()=source_location; - if(!base_type_eq(equality_expr.lhs().type(), - equality_expr.rhs().type(), *this)) + if(equality_expr.lhs().type() != equality_expr.rhs().type()) { error().source_location = f_op.source_location(); error() << "equal expects two operands of same type" << eom; diff --git a/src/ansi-c/c_typecheck_initializer.cpp b/src/ansi-c/c_typecheck_initializer.cpp index 91b79107fb7..bed63ec7de9 100644 --- a/src/ansi-c/c_typecheck_initializer.cpp +++ b/src/ansi-c/c_typecheck_initializer.cpp @@ -19,7 +19,6 @@ Author: Daniel Kroening, kroening@kroening.com #include #include #include -#include #include "anonymous_member.h" diff --git a/src/cpp/cpp_typecheck_expr.cpp b/src/cpp/cpp_typecheck_expr.cpp index db7ee51e955..3bf0da62939 100644 --- a/src/cpp/cpp_typecheck_expr.cpp +++ b/src/cpp/cpp_typecheck_expr.cpp @@ -16,7 +16,6 @@ Author: Daniel Kroening, kroening@cs.cmu.edu #endif #include -#include #include #include #include @@ -2373,9 +2372,9 @@ void cpp_typecheckt::typecheck_method_application( if(expr.arguments().size()==func_type.parameters().size()) { // this might be set up for base-class initialisation - if(!base_type_eq(expr.arguments().front().type(), - func_type.parameters().front().type(), - *this)) + if( + expr.arguments().front().type() != + func_type.parameters().front().type()) { implicit_typecast(expr.arguments().front(), this_type); assert(is_reference(expr.arguments().front().type()));