[06/10] Move COMPLETE_TYPE_P to the C and C++ frontends

Message ID 87k1mji8gr.fsf@arm.com
State New
Headers show
Series
  • Splitting the C and C++ concept of "complete type"
Related show

Commit Message

Richard Sandiford Oct. 15, 2018, 2:35 p.m.
After previous patches there are no more uses of COMPLETE_TYPE_P outside
the frontends.  This patch moves the definition to c-common.h.

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

gcc/
	* tree.h (COMPLETE_TYPE_P): Move to c-common.h.

gcc/c-family/
	* c-common.h (COMPLETE_TYPE_P): Moved from tree.h.
	* c-ada-spec.c: Include c-common.h.

Patch

Index: gcc/tree.h
===================================================================
--- gcc/tree.h	2018-10-15 14:13:13.584391090 +0100
+++ gcc/tree.h	2018-10-15 14:13:18.280352163 +0100
@@ -596,9 +596,6 @@  #define FUNCTION_POINTER_TYPE_P(TYPE) \
    to create objects of that type.  The type might be sized or sizeless.  */
 #define DEFINITE_TYPE_P(NODE) (TYPE_SIZE (NODE) != NULL_TREE)
 
-/* Nonzero if this type is a complete type.  */
-#define COMPLETE_TYPE_P(NODE) (TYPE_SIZE (NODE) != NULL_TREE)
-
 /* Nonzero if this type is the (possibly qualified) void type.  */
 #define VOID_TYPE_P(NODE) (TREE_CODE (NODE) == VOID_TYPE)
 
Index: gcc/c-family/c-common.h
===================================================================
--- gcc/c-family/c-common.h	2018-10-15 14:13:13.584391090 +0100
+++ gcc/c-family/c-common.h	2018-10-15 14:13:18.280352163 +0100
@@ -726,6 +726,9 @@  enum cxx_dialect {
 
 extern bool done_lexing;
 
+/* Nonzero if this type is a complete type.  */
+#define COMPLETE_TYPE_P(NODE) (TYPE_SIZE (NODE) != NULL_TREE)
+
 /* C types are partitioned into three subsets: object, function, and
    incomplete types.  */
 #define C_TYPE_OBJECT_P(type) \
Index: gcc/c-family/c-ada-spec.c
===================================================================
--- gcc/c-family/c-ada-spec.c	2018-10-05 13:46:08.287811117 +0100
+++ gcc/c-family/c-ada-spec.c	2018-10-15 14:13:18.280352163 +0100
@@ -27,6 +27,7 @@  Software Foundation; either version 3, o
 #include "c-ada-spec.h"
 #include "fold-const.h"
 #include "c-pragma.h"
+#include "c-common.h"
 #include "diagnostic.h"
 #include "stringpool.h"
 #include "attribs.h"