* class.c (contains_empty_class_p): Remove.
authorGerald Pfeifer <gerald@pfeifer.com>
Tue, 19 Aug 2014 05:13:38 +0000 (05:13 +0000)
committerGerald Pfeifer <gerald@gcc.gnu.org>
Tue, 19 Aug 2014 05:13:38 +0000 (05:13 +0000)
From-SVN: r214130

gcc/cp/ChangeLog
gcc/cp/class.c

index 6987609..b366a4f 100644 (file)
@@ -1,3 +1,7 @@
+2014-08-19  Gerald Pfeifer  <gerald@pfeifer.com>
+
+       * class.c (contains_empty_class_p): Remove.
+
 2014-08-18  Paolo Carlini  <paolo.carlini@oracle.com>
 
        * parser.c (cp_parser_expression): Add default arguments.
index 7f6952a..c7ecf70 100644 (file)
@@ -208,7 +208,6 @@ static int splay_tree_compare_integer_csts (splay_tree_key k1,
                                            splay_tree_key k2);
 static void warn_about_ambiguous_bases (tree);
 static bool type_requires_array_cookie (tree);
-static bool contains_empty_class_p (tree);
 static bool base_derived_from (tree, tree);
 static int empty_base_at_nonzero_offset_p (tree, tree, splay_tree);
 static tree end_of_base (tree);
@@ -7796,35 +7795,6 @@ is_empty_class (tree type)
   return CLASSTYPE_EMPTY_P (type);
 }
 
-/* Returns true if TYPE contains an empty class.  */
-
-static bool
-contains_empty_class_p (tree type)
-{
-  if (is_empty_class (type))
-    return true;
-  if (CLASS_TYPE_P (type))
-    {
-      tree field;
-      tree binfo;
-      tree base_binfo;
-      int i;
-
-      for (binfo = TYPE_BINFO (type), i = 0;
-          BINFO_BASE_ITERATE (binfo, i, base_binfo); ++i)
-       if (contains_empty_class_p (BINFO_TYPE (base_binfo)))
-         return true;
-      for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
-       if (TREE_CODE (field) == FIELD_DECL
-           && !DECL_ARTIFICIAL (field)
-           && is_empty_class (TREE_TYPE (field)))
-         return true;
-    }
-  else if (TREE_CODE (type) == ARRAY_TYPE)
-    return contains_empty_class_p (TREE_TYPE (type));
-  return false;
-}
-
 /* Returns true if TYPE contains no actual data, just various
    possible combinations of empty classes and possibly a vptr.  */