diff options
author | Geoffrey Keating <geoffk@apple.com> | 2004-06-09 20:10:13 +0000 |
---|---|---|
committer | Geoffrey Keating <geoffk@gcc.gnu.org> | 2004-06-09 20:10:13 +0000 |
commit | d8044160b7047642e312fb5f713fe0db46171dd8 (patch) | |
tree | 1238be7fc80d74d8323d5f6c4344a6bb2be0f854 /libcpp/internal.h | |
parent | 293155b099b94b81fa0147f2719f3da23c859f7e (diff) | |
download | gcc-d8044160b7047642e312fb5f713fe0db46171dd8.zip gcc-d8044160b7047642e312fb5f713fe0db46171dd8.tar.gz gcc-d8044160b7047642e312fb5f713fe0db46171dd8.tar.bz2 |
Index: gcc/ChangeLog
2004-06-09 Geoffrey Keating <geoffk@apple.com>
* Makefile.in (CPPLIB_H): Put files in order of inclusion.
(CPP_ID_DATA_H): New.
(gtype-desc.o): Update dependencies.
(GTFILES): Use CPP_ID_DATA_H.
Index: gcc/testsuite/ChangeLog
2004-06-09 Geoffrey Keating <geoffk@apple.com>
* gcc.dg/pch/macro-4.c: New.
* gcc.dg/pch/macro-4.hs: New.
Index: libcpp/ChangeLog
2004-06-09 Geoffrey Keating <geoffk@apple.com>
* traditional.c (push_replacement_text): Set macro->traditional.
(save_replacement_text): Likewise.
* pch.c (cpp_write_pch_state): Don't write list of defined macros.
(struct save_macro_item): Delete.
(struct save_macro_data): Use a character array not the previous
structured format.
(save_macros): Save macro as text not as internal structures.
(cpp_prepare_state): Update for changes to save_macro_data.
(cpp_read_state): Don't read macros defined in PCH. Restore
-D macros as text.
* macro.c (create_iso_definition): Honour alloc_subobject.
Clear traditional flag.
(_cpp_create_definition): Honour alloc_subobject.
* lex.c (cpp_token_val_index): New.
* internal.h: Include cpp-id-data.h.
(uchar): Move definition to cpp-id-data.h.
(U): Likewise.
(cpp_macro): Likewise.
* directives.c (struct answer): Move to cpp-id-data.h.
(do_assert): Honour alloc_subobject.
Index: libcpp/include/ChangeLog
2004-06-09 Geoffrey Keating <geoffk@apple.com>
* symtab.h (struct ht): Add field 'alloc_subobject'.
* cpplib.h (struct cpp_string): Add GTY marker.
(enum cpp_token_fld_kind): New.
(struct cpp_token): Add GTY markers.
(cpp_token_val_index): Prototype.
(CPP_HASHNODE_VALUE_IDX): New.
(struct cpp_hashnode): Don't skip fields of 'value' when marking.
* cpp-id-data.h: New file.
From-SVN: r82851
Diffstat (limited to 'libcpp/internal.h')
-rw-r--r-- | libcpp/internal.h | 44 |
1 files changed, 1 insertions, 43 deletions
diff --git a/libcpp/internal.h b/libcpp/internal.h index 3608201..fd3facf 100644 --- a/libcpp/internal.h +++ b/libcpp/internal.h @@ -24,6 +24,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define LIBCPP_INTERNAL_H #include "symtab.h" +#include "cpp-id-data.h" #if defined HAVE_ICONV_H && defined HAVE_ICONV #include <iconv.h> @@ -45,11 +46,6 @@ struct cset_converter iconv_t cd; }; -#ifndef HAVE_UCHAR -typedef unsigned char uchar; -#endif -#define U (const uchar *) /* Intended use: U"string" */ - #define BITS_PER_CPPCHAR_T (CHAR_BIT * sizeof (cppchar_t)) /* Test if a sign is valid within a preprocessing number. */ @@ -90,44 +86,6 @@ struct dummy #define CPP_ALIGN2(size, align) (((size) + ((align) - 1)) & ~((align) - 1)) #define CPP_ALIGN(size) CPP_ALIGN2 (size, DEFAULT_ALIGNMENT) -/* Each macro definition is recorded in a cpp_macro structure. - Variadic macros cannot occur with traditional cpp. */ -struct cpp_macro -{ - /* Parameters, if any. */ - cpp_hashnode **params; - - /* Replacement tokens (ISO) or replacement text (traditional). See - comment at top of cpptrad.c for how traditional function-like - macros are encoded. */ - union - { - cpp_token *tokens; - const uchar *text; - } exp; - - /* Definition line number. */ - fileline line; - - /* Number of tokens in expansion, or bytes for traditional macros. */ - unsigned int count; - - /* Number of parameters. */ - unsigned short paramc; - - /* 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; -}; - #define _cpp_mark_macro_used(NODE) do { \ if ((NODE)->type == NT_MACRO && !((NODE)->flags & NODE_BUILTIN)) \ (NODE)->value.macro->used = 1; } while (0) |