[07/10] Use COMPLETE_TYPE_P instead of TYPE_SIZE

Richard Sandiford richard.sandiford@arm.com
Mon Oct 15 14:37:00 GMT 2018


This patch makes a couple of c-family macros use COMPLETE_TYPE_P instead
of TYPE_SIZE, so that the definitions more clearly correspond to the
names of the macros.

2018-10-15  Richard Sandiford  <richard.sandiford@arm.com>

gcc/c-family/
	* c-common.h (C_TYPE_OBJECT_P, C_TYPE_INCOMPLETE_P): Test
	COMPLETE_TYPE_P instead of TYPE_SIZE.

Index: gcc/c-family/c-common.h
===================================================================
--- gcc/c-family/c-common.h	2018-10-15 14:13:18.280352163 +0100
+++ gcc/c-family/c-common.h	2018-10-15 14:13:22.880314033 +0100
@@ -732,10 +732,10 @@ #define COMPLETE_TYPE_P(NODE) (TYPE_SIZE
 /* C types are partitioned into three subsets: object, function, and
    incomplete types.  */
 #define C_TYPE_OBJECT_P(type) \
-  (TREE_CODE (type) != FUNCTION_TYPE && TYPE_SIZE (type))
+  (TREE_CODE (type) != FUNCTION_TYPE && COMPLETE_TYPE_P (type))
 
 #define C_TYPE_INCOMPLETE_P(type) \
-  (TREE_CODE (type) != FUNCTION_TYPE && TYPE_SIZE (type) == 0)
+  (TREE_CODE (type) != FUNCTION_TYPE && !COMPLETE_TYPE_P (type))
 
 #define C_TYPE_FUNCTION_P(type) \
   (TREE_CODE (type) == FUNCTION_TYPE)



More information about the Gcc-patches mailing list