tree rhstype = TREE_TYPE (rhs);
if (POINTER_TYPE_P (rhstype))
rhstype = TREE_TYPE (rhstype);
- if (TYPE_EMPTY_P (rhstype)
- || (RECORD_OR_UNION_TYPE_P (rhstype)
- && (!first_field (rhstype)
- || default_is_empty_record (rhstype))))
+ if (is_empty_type (rhstype))
return NULL_TREE;
bool warned = false;
/* Returns true if TYPE is a type where it and all of its subobjects
(recursively) are of structure, union, or array type. */
-static bool
-default_is_empty_type (tree type)
+bool
+is_empty_type (const_tree type)
{
if (RECORD_OR_UNION_TYPE_P (type))
{
for (tree field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
if (TREE_CODE (field) == FIELD_DECL
&& !DECL_PADDING_P (field)
- && !default_is_empty_type (TREE_TYPE (field)))
+ && !is_empty_type (TREE_TYPE (field)))
return false;
return true;
}
else if (TREE_CODE (type) == ARRAY_TYPE)
return (integer_minus_onep (array_type_nelts (type))
|| TYPE_DOMAIN (type) == NULL_TREE
- || default_is_empty_type (TREE_TYPE (type)));
+ || is_empty_type (TREE_TYPE (type)));
return false;
}
if (TREE_ADDRESSABLE (type))
return false;
- return default_is_empty_type (TYPE_MAIN_VARIANT (type));
+ return is_empty_type (TYPE_MAIN_VARIANT (type));
}
/* Determine whether TYPE is a structure with a flexible array member,
extern void gt_pch_nx (tree &, gt_pointer_operator, void *);
extern bool nonnull_arg_p (const_tree);
+extern bool is_empty_type (const_tree);
extern bool default_is_empty_record (const_tree);
extern bool flexible_array_type_p (const_tree);
extern HOST_WIDE_INT arg_int_size_in_bytes (const_tree);