c-ada-spec.c (dump_ada_template): Use RECORD_OR_UNION_TYPE_P.
authorMarek Polacek <polacek@redhat.com>
Mon, 16 Nov 2015 17:58:39 +0000 (17:58 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Mon, 16 Nov 2015 17:58:39 +0000 (17:58 +0000)
* 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

gcc/c-family/ChangeLog
gcc/c-family/c-ada-spec.c
gcc/c-family/c-common.c

index 518c5ef229bee4a84318da0736dc5bd95fc5f80e..e9851aa6ddd7f8c49dbe34e66dcb724eeb2bc7aa 100644 (file)
@@ -1,3 +1,9 @@
+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>
 
        * c-common.c (handle_simd_attribute): New.
index 216bd6fa809bcaa76e46b75906a6f092029d33ce..e85c1a9a7d5b2d5ced6ff3fb7d7c5996de52849f 100644 (file)
@@ -1758,8 +1758,7 @@ dump_ada_template (pretty_printer *buffer, tree t, int spc)
 
       /* We are interested in concrete template instantiations only: skip
         partially specialized nodes.  */
-      if ((TREE_CODE (instance) == RECORD_TYPE
-          || TREE_CODE (instance) == UNION_TYPE)
+      if (RECORD_OR_UNION_TYPE_P (instance)
          && cpp_check && cpp_check (instance, HAS_DEPENDENT_TEMPLATE_ARGS))
        continue;
 
index f8ccb6d62c0b3c2b53d3ec345feff7b9341689da..a062f81a1c35a8ca6b9fb8c692a55082a02a3884 100644 (file)
@@ -5344,19 +5344,15 @@ c_common_get_alias_set (tree t)
           TREE_CODE (t2) == POINTER_TYPE;
           t2 = TREE_TYPE (t2))
        ;
-      if (TREE_CODE (t2) != RECORD_TYPE
-         && TREE_CODE (t2) != ENUMERAL_TYPE
-         && TREE_CODE (t2) != QUAL_UNION_TYPE
-         && TREE_CODE (t2) != UNION_TYPE)
+      if (!RECORD_OR_UNION_TYPE_P (t2)
+         && TREE_CODE (t2) != ENUMERAL_TYPE)
        return -1;
       if (TYPE_SIZE (t2) == 0)
        return -1;
     }
   /* 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) != QUAL_UNION_TYPE
-      && TREE_CODE (t) != UNION_TYPE
       && TREE_CODE (t) != POINTER_TYPE)
     return -1;
   /* Undefined? */
@@ -8644,7 +8640,7 @@ handle_visibility_attribute (tree *node, tree name, tree args,
     {
       if (TREE_CODE (*node) == ENUMERAL_TYPE)
        /* 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",
                   name);