]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fold cpp-id-data.h into cpplib.h
authorNathan Sidwell <nathan@acm.org>
Wed, 8 Aug 2018 20:53:00 +0000 (20:53 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Wed, 8 Aug 2018 20:53:00 +0000 (20:53 +0000)
Fold cpp-id-data.h into cpplib.h
libcpp/
* internal.h: Include cpplib.h, not cpp-id-data.h.
(uchar, UC): From cpp-id-data.h.
* include/cpplib.h (cpp_macro_kind, cpp_macro): From cpp-id-data.h.
* include.cpp-id-data.h: Delete.
* Makefile.in (TAGS_SOURCES): Drop cpp-id-data.h.
gcc/
* Makefile.in (CPP_ID_DATA_H): Delete.
(CPP_INTERNAL_H): Drop CPP_ID_DATA_H.
(GT_FILES): Replace CPP_ID_DATA_H with CPPLIB_H.
* cppbuiltin.c: Include cpplib.h instead of cpp-id-data.h.
gcc/c-family
* c-ada-spec.c: Don't include cpp-id-data.h.
* c-cppbuiltin.h: Likewise.

From-SVN: r263434

ChangeLog.name-lookup
gcc/Makefile.in
gcc/c-family/c-ada-spec.c
gcc/c-family/c-cppbuiltin.c
gcc/cppbuiltin.c
gcc/gengtype.c
libcpp/Makefile.in
libcpp/include/cpp-id-data.h
libcpp/include/cpplib.h
libcpp/internal.h

index 1b5ad7695021007d183006679a2396e1037f1d40..0642783247ea0c2f6fffef7d5634a1560f7bcfdf 100644 (file)
@@ -1,5 +1,21 @@
 2018-08-08  Nathan Sidwell  <nathan@acm.org>
 
+       Fold cpp-id-data.h into cpplib.h
+       libcpp/
+       * internal.h: Include cpplib.h, not cpp-id-data.h.
+       (uchar, UC): From cpp-id-data.h.
+       * include/cpplib.h (cpp_macro_kind, cpp_macro): From cpp-id-data.h.
+       * include.cpp-id-data.h: Delete.
+       * Makefile.in (TAGS_SOURCES): Drop cpp-id-data.h.
+       gcc/
+       * Makefile.in (CPP_ID_DATA_H): Delete.
+       (CPP_INTERNAL_H): Drop CPP_ID_DATA_H.
+       (GT_FILES): Replace CPP_ID_DATA_H with CPPLIB_H.
+       * cppbuiltin.c: Include cpplib.h instead of cpp-id-data.h.
+       gcc/c-family
+       * c-ada-spec.c: Don't include cpp-id-data.h.
+       * c-cppbuiltin.h: Likewise.
+
        libcpp/
        * include/cpplib.h (enum node_type): Rename to NT_USER_MACR,
        NT_BUILTIN_MACRO.
index e7d818d174c8ec05a89c50942550765a18876a1a..e8697816a975d5baa46e3072c6cc4e910306fa58 100644 (file)
@@ -978,8 +978,7 @@ CPPLIB_H = $(srcdir)/../libcpp/include/line-map.h \
 INPUT_H = $(srcdir)/../libcpp/include/line-map.h input.h
 OPTS_H = $(INPUT_H) $(VEC_H) opts.h $(OBSTACK_H)
 SYMTAB_H = $(srcdir)/../libcpp/include/symtab.h $(OBSTACK_H)
-CPP_ID_DATA_H = $(CPPLIB_H) $(srcdir)/../libcpp/include/cpp-id-data.h
-CPP_INTERNAL_H = $(srcdir)/../libcpp/internal.h $(CPP_ID_DATA_H)
+CPP_INTERNAL_H = $(srcdir)/../libcpp/internal.h
 TREE_DUMP_H = tree-dump.h $(SPLAY_TREE_H) $(DUMPFILE_H)
 TREE_PASS_H = tree-pass.h $(TIMEVAR_H) $(DUMPFILE_H)
 TREE_SSA_H = tree-ssa.h tree-ssa-operands.h \
@@ -2522,7 +2521,7 @@ s-match: build/genmatch$(build_exeext) $(srcdir)/match.pd cfn-operators.pd
                                                generic-match.c
        $(STAMP) s-match
 
-GTFILES = $(CPP_ID_DATA_H) $(srcdir)/input.h $(srcdir)/coretypes.h \
+GTFILES = $(CPPLIB_H) $(srcdir)/input.h $(srcdir)/coretypes.h \
   $(host_xm_file_list) \
   $(tm_file_list) $(HASHTAB_H) $(SPLAY_TREE_H) $(srcdir)/bitmap.h \
   $(srcdir)/wide-int.h $(srcdir)/alias.h \
index d987effe72b8df55cc189c4f176d32519207b84d..3fe8138796e7deba3bca3b882ebb0c2dd119007b 100644 (file)
@@ -27,7 +27,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "c-ada-spec.h"
 #include "fold-const.h"
 #include "c-pragma.h"
-#include "cpp-id-data.h"
 #include "stringpool.h"
 #include "attribs.h"
 
index 54d9c8996bab24eca502c9233c4ea82038ad8d65..96a6b4dfd2b9e898567aeb9e9586e5738fdeb15d 100644 (file)
@@ -31,7 +31,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "output.h"            /* For user_label_prefix.  */
 #include "debug.h"             /* For dwarf2out_do_cfi_asm.  */
 #include "common/common-target.h"
-#include "cpp-id-data.h"
 #include "cppbuiltin.h"
 
 #ifndef TARGET_OS_CPP_BUILTINS
index de8cd339404f1724d5d2c2f774d187b4847a2eeb..8b9ec5de912da65e42aeb60492de2e15e6cc5690 100644 (file)
@@ -25,7 +25,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree.h"
 #include "version.h"
 #include "flags.h"
-#include "cpp-id-data.h"
+#include "cpplib.h"
 #include "cppbuiltin.h"
 
 
index 0db5528e632300b2deaf86a2a4859b6d28e018d9..4339456e9c67ec053afac4209bf5ed032f7d5993 100644 (file)
@@ -1721,7 +1721,7 @@ open_base_files (void)
       "tree-vrp.h", "tree-phinodes.h", "ssa-iterators.h", "stringpool.h",
       "tree-ssanames.h", "tree-ssa-loop.h", "tree-ssa-loop-ivopts.h",
       "tree-ssa-loop-manip.h", "tree-ssa-loop-niter.h", "tree-into-ssa.h",
-      "tree-dfa.h", "tree-ssa.h", "reload.h", "cpp-id-data.h", "tree-chrec.h",
+      "tree-dfa.h", "tree-ssa.h", "reload.h", "cpplib.h", "tree-chrec.h",
       "except.h", "output.h",  "cfgloop.h", "target.h", "lto-streamer.h",
       "target-globals.h", "ipa-ref.h", "cgraph.h", "symbol-summary.h",
       "ipa-prop.h", "ipa-fnsummary.h", "dwarf2out.h", "omp-offload.h", NULL
index bfd6069c25061f52cd0634544060d76c6a41601f..835c835183fe52d99fab310512915b8c08a11a32 100644 (file)
@@ -261,9 +261,8 @@ po/$(PACKAGE).pot: $(libcpp_a_SOURCES)
        sed 's:$(srcdir)/::g' <po/$(PACKAGE).pot.tmp >po/$(PACKAGE).pot
        rm po/$(PACKAGE).pot.tmp
 
-TAGS_SOURCES = $(libcpp_a_SOURCES) internal.h ucnid.h \
-    include/line-map.h include/symtab.h include/cpp-id-data.h \
-    include/cpplib.h include/mkdeps.h system.h
+TAGS_SOURCES = $(libcpp_a_SOURCES) internal.h system.h ucnid.h \
+    include/cpplib.h include/line-map.h include/mkdeps.h include/symtab.h
 
 TAGS: $(TAGS_SOURCES)
        cd $(srcdir) && etags $(TAGS_SOURCES)
index 24572d2cd67d950d5691ad29cd5f4a4440983f7e..d2fc4b6d6fd3f2639a7fd97f75901ff1abb4c724 100644 (file)
@@ -16,81 +16,3 @@ along with this program; see the file COPYING3.  If not see
 <http://www.gnu.org/licenses/>.  */
 
 #include "cpplib.h"
-
-#if !defined (HAVE_UCHAR) && !defined (IN_GCC)
-typedef unsigned char uchar;
-#endif
-
-#define UC (const unsigned char *)  /* Intended use: UC"string" */
-
-/* The kind of the cpp_macro.  */
-enum cpp_macro_kind {
-  cmk_macro,   /* An ISO macro (token expansion).  */
-  cmk_assert,   /* An assertion.  */
-  cmk_traditional,     /* A traditional macro (text expansion).  */
-};
-
-/* Each macro definition is recorded in a cpp_macro structure.
-   Variadic macros cannot occur with traditional cpp.  */
-struct GTY(()) cpp_macro {
-  union cpp_parm_u 
-  {
-    /* Parameters, if any.  If parameter names use extended identifiers,
-       the original spelling of those identifiers, not the canonical
-       UTF-8 spelling, goes here.  */
-    cpp_hashnode ** GTY ((tag ("false"),
-                         nested_ptr (union tree_node,
-       "%h ? CPP_HASHNODE (GCC_IDENT_TO_HT_IDENT (%h)) : NULL",
-       "%h ? HT_IDENT_TO_GCC_IDENT (HT_NODE (%h)) : NULL"),
-                         length ("%1.paramc"))) params;
-
-    /* If this is an assertion, the next one in the chain.  */
-    cpp_macro *GTY ((tag ("true"))) next;
-  } GTY ((desc ("%1.kind == cmk_assert"))) parm;
-
-  /* Definition line number.  */
-  source_location line;
-
-  /* Number of tokens in body, or bytes for traditional macros.  */
-  /* Do we really need 2^32-1 range here?  */
-  unsigned int count;
-
-  /* Number of parameters.  */
-  unsigned short paramc;
-
-  /* Non-zero if this is a user-lazy macro, value provided by user.  */
-  unsigned char lazy;
-
-  /* The kind of this macro (ISO, trad or assert) */
-  unsigned kind : 2;
-
-  /* If a function-like macro.  */
-  unsigned int fun_like : 1;
-
-  /* If a variadic macro.  */
-  unsigned int variadic : 1;
-
-  /* If macro defined in system header.  */
-  unsigned int syshdr   : 1;
-
-  /* Nonzero if it has been expanded or had its existence tested.  */
-  unsigned int used     : 1;
-
-  /* Indicate whether the tokens include extra CPP_PASTE tokens at the
-     end to track invalid redefinitions with consecutive CPP_PASTE
-     tokens.  */
-  unsigned int extra_tokens : 1;
-
-  /* 1 bits spare (32-bit). 33 on 64-bit target.  */
-
-  union cpp_exp_u
-  {
-    /* Trailing array of replacement tokens (ISO), or assertion body value.  */
-    cpp_token GTY ((tag ("false"), length ("%1.count"))) tokens[1];
-
-    /* Pointer to replacement text (traditional).  See comment at top
-       of cpptrad.c for how traditional function-like macros are
-       encoded.  */
-    const unsigned char *GTY ((tag ("true"))) text;
-  } GTY ((desc ("%1.kind == cmk_traditional"))) exp;
-};
index 8630475995ecc55d195f49f765ebfd829e7be5b4..8fd2e4c1b692d902fecac48728cf01f60a3a878b 100644 (file)
@@ -671,6 +671,78 @@ struct cpp_dir
   dev_t dev;
 };
 
+/* The kind of the cpp_macro.  */
+enum cpp_macro_kind {
+  cmk_macro,   /* An ISO macro (token expansion).  */
+  cmk_assert,   /* An assertion.  */
+  cmk_traditional,     /* A traditional macro (text expansion).  */
+};
+
+/* Each macro definition is recorded in a cpp_macro structure.
+   Variadic macros cannot occur with traditional cpp.  */
+struct GTY(()) cpp_macro {
+  union cpp_parm_u 
+  {
+    /* Parameters, if any.  If parameter names use extended identifiers,
+       the original spelling of those identifiers, not the canonical
+       UTF-8 spelling, goes here.  */
+    cpp_hashnode ** GTY ((tag ("false"),
+                         nested_ptr (union tree_node,
+       "%h ? CPP_HASHNODE (GCC_IDENT_TO_HT_IDENT (%h)) : NULL",
+       "%h ? HT_IDENT_TO_GCC_IDENT (HT_NODE (%h)) : NULL"),
+                         length ("%1.paramc"))) params;
+
+    /* If this is an assertion, the next one in the chain.  */
+    cpp_macro *GTY ((tag ("true"))) next;
+  } GTY ((desc ("%1.kind == cmk_assert"))) parm;
+
+  /* Definition line number.  */
+  source_location line;
+
+  /* Number of tokens in body, or bytes for traditional macros.  */
+  /* Do we really need 2^32-1 range here?  */
+  unsigned int count;
+
+  /* Number of parameters.  */
+  unsigned short paramc;
+
+  /* Non-zero if this is a user-lazy macro, value provided by user.  */
+  unsigned char lazy;
+
+  /* The kind of this macro (ISO, trad or assert) */
+  unsigned kind : 2;
+
+  /* If a function-like macro.  */
+  unsigned int fun_like : 1;
+
+  /* If a variadic macro.  */
+  unsigned int variadic : 1;
+
+  /* If macro defined in system header.  */
+  unsigned int syshdr   : 1;
+
+  /* Nonzero if it has been expanded or had its existence tested.  */
+  unsigned int used     : 1;
+
+  /* Indicate whether the tokens include extra CPP_PASTE tokens at the
+     end to track invalid redefinitions with consecutive CPP_PASTE
+     tokens.  */
+  unsigned int extra_tokens : 1;
+
+  /* 1 bits spare (32-bit). 33 on 64-bit target.  */
+
+  union cpp_exp_u
+  {
+    /* Trailing array of replacement tokens (ISO), or assertion body value.  */
+    cpp_token GTY ((tag ("false"), length ("%1.count"))) tokens[1];
+
+    /* Pointer to replacement text (traditional).  See comment at top
+       of cpptrad.c for how traditional function-like macros are
+       encoded.  */
+    const unsigned char *GTY ((tag ("true"))) text;
+  } GTY ((desc ("%1.kind == cmk_traditional"))) exp;
+};
+
 /* The structure of a node in the hash table.  The hash table has
    entries for all identifiers: either macros defined by #define
    commands (type NT_MACRO), assertions created with #assert
index d63a3db9a3c5e7a57247c8862b37f9bb2a7f010e..59f830c6a8e5753335de87ca2eb2e3715d13b03f 100644 (file)
@@ -23,7 +23,7 @@ along with this program; see the file COPYING3.  If not see
 #define LIBCPP_INTERNAL_H
 
 #include "symtab.h"
-#include "cpp-id-data.h"
+#include "cpplib.h"
 
 #if HAVE_ICONV
 #include <iconv.h>
@@ -602,6 +602,12 @@ extern const unsigned char _cpp_trigraph_map[UCHAR_MAX + 1];
 extern unsigned char _cpp_trigraph_map[UCHAR_MAX + 1];
 #endif
 
+#if !defined (HAVE_UCHAR) && !defined (IN_GCC)
+typedef unsigned char uchar;
+#endif
+
+#define UC (const uchar *)  /* Intended use: UC"string" */
+
 /* Macros.  */
 
 static inline int cpp_in_system_header (cpp_reader *);