Commit a868811e by Marek Polacek Committed by Marek Polacek

c-ada-spec.c (dump_ada_template): Use RECORD_OR_UNION_TYPE_P.

	* c-ada-spec.c (dump_ada_template): Use RECORD_OR_UNION_TYPE_P.
	* c-common.c (c_common_get_alias_set): Likewise.
	(handle_visibility_attribute): Likewise.

From-SVN: r230432
parent 971f13d7
2015-11-16 Marek Polacek <polacek@redhat.com>
* c-ada-spec.c (dump_ada_template): Use RECORD_OR_UNION_TYPE_P.
* c-common.c (c_common_get_alias_set): Likewise.
(handle_visibility_attribute): Likewise.
2015-11-16 Kirill Yukhin <kirill.yukhin@intel.com> 2015-11-16 Kirill Yukhin <kirill.yukhin@intel.com>
* c-common.c (handle_simd_attribute): New. * c-common.c (handle_simd_attribute): New.
......
...@@ -1758,8 +1758,7 @@ dump_ada_template (pretty_printer *buffer, tree t, int spc) ...@@ -1758,8 +1758,7 @@ dump_ada_template (pretty_printer *buffer, tree t, int spc)
/* We are interested in concrete template instantiations only: skip /* We are interested in concrete template instantiations only: skip
partially specialized nodes. */ partially specialized nodes. */
if ((TREE_CODE (instance) == RECORD_TYPE if (RECORD_OR_UNION_TYPE_P (instance)
|| TREE_CODE (instance) == UNION_TYPE)
&& cpp_check && cpp_check (instance, HAS_DEPENDENT_TEMPLATE_ARGS)) && cpp_check && cpp_check (instance, HAS_DEPENDENT_TEMPLATE_ARGS))
continue; continue;
......
...@@ -5344,19 +5344,15 @@ c_common_get_alias_set (tree t) ...@@ -5344,19 +5344,15 @@ c_common_get_alias_set (tree t)
TREE_CODE (t2) == POINTER_TYPE; TREE_CODE (t2) == POINTER_TYPE;
t2 = TREE_TYPE (t2)) t2 = TREE_TYPE (t2))
; ;
if (TREE_CODE (t2) != RECORD_TYPE if (!RECORD_OR_UNION_TYPE_P (t2)
&& TREE_CODE (t2) != ENUMERAL_TYPE && TREE_CODE (t2) != ENUMERAL_TYPE)
&& TREE_CODE (t2) != QUAL_UNION_TYPE
&& TREE_CODE (t2) != UNION_TYPE)
return -1; return -1;
if (TYPE_SIZE (t2) == 0) if (TYPE_SIZE (t2) == 0)
return -1; return -1;
} }
/* These are the only cases that need special handling. */ /* These are the only cases that need special handling. */
if (TREE_CODE (t) != RECORD_TYPE if (!RECORD_OR_UNION_TYPE_P (t)
&& TREE_CODE (t) != ENUMERAL_TYPE && TREE_CODE (t) != ENUMERAL_TYPE
&& TREE_CODE (t) != QUAL_UNION_TYPE
&& TREE_CODE (t) != UNION_TYPE
&& TREE_CODE (t) != POINTER_TYPE) && TREE_CODE (t) != POINTER_TYPE)
return -1; return -1;
/* Undefined? */ /* Undefined? */
...@@ -8644,7 +8640,7 @@ handle_visibility_attribute (tree *node, tree name, tree args, ...@@ -8644,7 +8640,7 @@ handle_visibility_attribute (tree *node, tree name, tree args,
{ {
if (TREE_CODE (*node) == ENUMERAL_TYPE) if (TREE_CODE (*node) == ENUMERAL_TYPE)
/* OK */; /* OK */;
else if (TREE_CODE (*node) != RECORD_TYPE && TREE_CODE (*node) != UNION_TYPE) else if (!RECORD_OR_UNION_TYPE_P (*node))
{ {
warning (OPT_Wattributes, "%qE attribute ignored on non-class types", warning (OPT_Wattributes, "%qE attribute ignored on non-class types",
name); name);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment