summaryrefslogtreecommitdiff
path: root/gcc/cpplib.h
diff options
context:
space:
mode:
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2000-02-10 23:47:04 +0000
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2000-02-10 23:47:04 +0000
commiteb3948d14fb48860754f84cdc8c0d507d89899fa (patch)
tree62eef5d947b8384b8147ec6d6b0b4aecba2485ac /gcc/cpplib.h
parent36cf37bea77749a21754b4de93aa6a3f317605a6 (diff)
downloadgcc-eb3948d14fb48860754f84cdc8c0d507d89899fa.tar.gz
* cppexp.c: Don't include cpphash.h.
(parse_charconst, cpp_lex): Use cpp_defined. (cpp_lex): Use get_directive_token throughout. Remove unnecessary cases from switch. Move assertion-handling code down to OTHER case. (cpp_parse_expr): If we see '+' or '-', check the context to determine if they are unary or binary operators. Streamline the jumps a bit. Do not call skip_rest_of_line. * cpplib.c: Make skip_rest_of_line and cpp_skip_hspace static. Export get_directive_token. Update commentary. (cpp_defined): New function. (do_define): Remove reference to T_PCSTRING. Call free_definition to release memory for old definition, when redefining a macro. (eval_if_expression): Set only_seen_white to 0 before calling cpp_parse_expr. Call skip_rest_of_line after it returns. (cpp_read_check_assertion): Don't preserve a pointer into the token buffer across a call to cpp_get_token. * Makefile.in (cppexp.o): Don't depend on cpphash.h. * cppfiles.c (redundant_include_p): Use cpp_defined. * cpphash.c (free_definition): New function. (delete_macro): Use it. Update commentary. * cpphash.h: Typedef HASHNODE here. Prototype cpp_lookup and free_definition. * cpplib.h: Don't typedef HASHNODE here. Delete T_PCSTRING from enum node_type. Prototype cpp_defined and get_directive_token. Don't prototype cpp_lookup, skip_rest_of_line, or cpp_skip_hspace. * fix-header.c (check_macro_names): Use cpp_defined. (read_scan_file): Set inhibit_warnings and inhibit_errors in the options structure. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@31908 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cpplib.h')
-rw-r--r--gcc/cpplib.h11
1 files changed, 3 insertions, 8 deletions
diff --git a/gcc/cpplib.h b/gcc/cpplib.h
index 266b90305ab..82eb55c44b9 100644
--- a/gcc/cpplib.h
+++ b/gcc/cpplib.h
@@ -61,8 +61,8 @@ typedef int (*parse_cleanup_t) PARAMS((cpp_buffer *, cpp_reader *));
extern int cpp_handle_option PARAMS ((cpp_reader *, int, char **));
extern int cpp_handle_options PARAMS ((cpp_reader *, int, char **));
extern enum cpp_token cpp_get_token PARAMS ((cpp_reader *));
-extern void cpp_skip_hspace PARAMS((cpp_reader *));
extern enum cpp_token cpp_get_non_space_token PARAMS ((cpp_reader *));
+extern enum cpp_token get_directive_token PARAMS ((cpp_reader *));
/* This frees resources used by PFILE. */
extern void cpp_cleanup PARAMS ((cpp_reader *PFILE));
@@ -139,9 +139,6 @@ struct file_name_map_list;
Applying cpp_get_token repeatedly yields a stream of pre-processor
tokens. Usually, there is only one cpp_reader object active. */
-struct hashnode;
-typedef struct hashnode HASHNODE;
-
struct cpp_reader
{
parse_underflow_t get_token;
@@ -169,7 +166,7 @@ struct cpp_reader
/* Hash table of macros and assertions. See cpphash.c */
#define HASHSIZE 1403
- HASHNODE **hashtab;
+ struct hashnode **hashtab;
/* Hash table of other included files. See cppfiles.c */
#define ALL_INCLUDE_HASHSIZE 71
@@ -600,7 +597,6 @@ enum node_type {
T_CONST, /* Constant string, used by `__SIZE_TYPE__' etc */
T_MACRO, /* macro defined by `#define' */
T_DISABLED, /* macro temporarily turned off for rescan */
- T_PCSTRING, /* precompiled string (hashval is KEYDEF *) */
T_POISON, /* defined with `#pragma poison' */
T_UNUSED /* Used for something not defined. */
};
@@ -686,13 +682,12 @@ extern void cpp_grow_buffer PARAMS ((cpp_reader *, long));
extern cpp_buffer *cpp_push_buffer PARAMS ((cpp_reader *,
unsigned char *, long));
extern cpp_buffer *cpp_pop_buffer PARAMS ((cpp_reader *));
-extern HASHNODE *cpp_lookup PARAMS ((cpp_reader *, const U_CHAR *, int));
+extern int cpp_defined PARAMS ((cpp_reader *, const U_CHAR *, int));
extern void cpp_reader_init PARAMS ((cpp_reader *));
extern void cpp_options_init PARAMS ((cpp_options *));
extern int cpp_start_read PARAMS ((cpp_reader *, char *));
extern int cpp_read_check_assertion PARAMS ((cpp_reader *));
-extern void skip_rest_of_line PARAMS ((cpp_reader *));
extern void cpp_finish PARAMS ((cpp_reader *));
extern void quote_string PARAMS ((cpp_reader *, const char *));