aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpplib.h
diff options
context:
space:
mode:
authorZack Weinberg <zack@wolery.cumb.org>2000-04-21 17:18:50 +0000
committerZack Weinberg <zack@gcc.gnu.org>2000-04-21 17:18:50 +0000
commit9e62c8114f04116b2107809c51bf33ef1a2993c9 (patch)
tree21832fd028eb53eea53190faa67b40ac42811fbf /gcc/cpplib.h
parent152897b1529264336677bc782f882a5b09041ac3 (diff)
downloadgcc-9e62c8114f04116b2107809c51bf33ef1a2993c9.zip
gcc-9e62c8114f04116b2107809c51bf33ef1a2993c9.tar.gz
gcc-9e62c8114f04116b2107809c51bf33ef1a2993c9.tar.bz2
cpphash.c (struct arg, [...]): Const-ify strings.
* cpphash.c (struct arg, struct arglist): Const-ify strings. (warn_trad_stringify, duplicate_arg_p): New helper functions. (collect_expansion): Rewrite to scan over a token list. Remove -traditional support. (collect_formal_parameters): Rename to collect_params; rewrite to scan over a token list. (_cpp_create_definition): Adjust to scan a token list. (_cpp_macroexpand): Remove -traditional support. (_cpp_compare_defs): Whitespace is now canonicalized. (comp_def_part): Delete function. * cpphash.h: Update prototypes. * cpplex.c (init_token_list): Don't set lineno if there is no buffer. (pedantic_whitespace): New function. (_cpp_scan_line): Mark tokens that had hspace before. Don't consume a newline. Use pedantic_whitespace. (_cpp_lex_token): Remove support for -traditional macros. (_cpp_get_define_token): Delete. (_cpp_get_directive_token): Do the real work here. Use pedantic_whitespace. (_cpp_init_input_buffer): Initialize pfile->directbuf. * cpplib.c (get_macro_name): Delete. (do_define): Read the entire line into pfile->directbuf, then feed the token list to _cpp_create_definition. * cpplib.h (HSPACE_BEFORE): new define. (struct cpp_reader): Add a toklist member, "directbuf". From-SVN: r33309
Diffstat (limited to 'gcc/cpplib.h')
-rw-r--r--gcc/cpplib.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/cpplib.h b/gcc/cpplib.h
index 6e3561a..764d8e6 100644
--- a/gcc/cpplib.h
+++ b/gcc/cpplib.h
@@ -135,6 +135,9 @@ struct cpp_name
unsigned int offset; /* from list->namebuf */
};
+/* Per token flags. */
+#define HSPACE_BEFORE (1 << 0) /* token preceded by hspace */
+
/* A preprocessing token.
This has been carefully packed and should occupy 16 bytes on
both 32- and 64-bit hosts. */
@@ -146,7 +149,7 @@ struct cpp_token
#else
unsigned char type;
#endif
- unsigned char flags; /* flags - not presently used */
+ unsigned char flags; /* flags - see above */
unsigned int aux; /* hash of a NAME, or something -
see uses in the code */
union
@@ -435,8 +438,12 @@ struct cpp_options
struct cpp_reader
{
+ /* Top of buffer stack. */
cpp_buffer *buffer;
+ /* Token list used by get_directive_token. */
+ cpp_toklist directbuf;
+
/* A buffer used for both for cpp_get_token's output, and also internally. */
unsigned char *token_buffer;
/* Allocated size of token_buffer. CPP_RESERVE allocates space. */