diff mbox

Use a couple of macros in stor-layout.c

Message ID 15239017.UiYMmV4jq7@polaris
State New
Headers show

Commit Message

Eric Botcazou May 19, 2015, 6:02 p.m. UTC
Self-explanatory, tested on x86_64-suse-linux, applied as obvious.


2015-05-19  Eric Botcazou  <ebotcazou@adacore.com>

	* stor-layout.c (finalize_type_size): Use AGGREGATE_TYPE_P.
	(layout_type): Use RECORD_OR_UNION_TYPE_P.
diff mbox

Patch

Index: stor-layout.c
===================================================================
--- stor-layout.c	(revision 223349)
+++ stor-layout.c	(working copy)
@@ -1757,12 +1757,9 @@  finalize_type_size (tree type)
      However, where strict alignment is not required, avoid
      over-aligning structures, since most compilers do not do this
      alignment.  */
-
-  if (TYPE_MODE (type) != BLKmode && TYPE_MODE (type) != VOIDmode
-      && (STRICT_ALIGNMENT
-	  || (TREE_CODE (type) != RECORD_TYPE && TREE_CODE (type) != UNION_TYPE
-	      && TREE_CODE (type) != QUAL_UNION_TYPE
-	      && TREE_CODE (type) != ARRAY_TYPE)))
+  if (TYPE_MODE (type) != BLKmode
+      && TYPE_MODE (type) != VOIDmode
+      && (STRICT_ALIGNMENT || !AGGREGATE_TYPE_P (type)))
     {
       unsigned mode_align = GET_MODE_ALIGNMENT (TYPE_MODE (type));
 
@@ -2431,9 +2428,7 @@  layout_type (tree type)
   /* Compute the final TYPE_SIZE, TYPE_ALIGN, etc. for TYPE.  For
      records and unions, finish_record_layout already called this
      function.  */
-  if (TREE_CODE (type) != RECORD_TYPE
-      && TREE_CODE (type) != UNION_TYPE
-      && TREE_CODE (type) != QUAL_UNION_TYPE)
+  if (!RECORD_OR_UNION_TYPE_P (type))
     finalize_type_size (type);
 
   /* We should never see alias sets on incomplete aggregates.  And we