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.
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 \
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 \
#include "c-ada-spec.h"
#include "fold-const.h"
#include "c-pragma.h"
-#include "cpp-id-data.h"
#include "stringpool.h"
#include "attribs.h"
#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
#include "tree.h"
#include "version.h"
#include "flags.h"
-#include "cpp-id-data.h"
+#include "cpplib.h"
#include "cppbuiltin.h"
"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
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)
<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;
-};
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
#define LIBCPP_INTERNAL_H
#include "symtab.h"
-#include "cpp-id-data.h"
+#include "cpplib.h"
#if HAVE_ICONV
#include <iconv.h>
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 *);