diff options
author | zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-08-02 01:13:45 +0000 |
---|---|---|
committer | zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-08-02 01:13:45 +0000 |
commit | 6cae25044a92709544cf8f84d01bfce8c39799ad (patch) | |
tree | af945d1943c9c6b458fec03b961f8f0d523896bf /gcc/cpphash.h | |
parent | efc2922d7c58278878cd89408050d4c7a9c0df4c (diff) | |
download | gcc-6cae25044a92709544cf8f84d01bfce8c39799ad.tar.gz |
* cpperror.c (v_message): Split into _cpp_begin_message and
v_message macro. All callers updated.
(_cpp_begin_message): Do inhibit_errors/inhibit_warnings
checks here.
* cppfiles.c (cpp_syshdr_flags): New function.
(read_include_file): Don't call cpp_output_tokens. Call
enter_file hook.
* cppinit.c (dump_macros_helper): Moved to cppmain.c.
(cpp_reader_init): Don't initialize token_buffer. Call
_cpp_init_internal_pragmas.
(cpp_cleanup): Don't clear token_buffer.
(cpp_start_read): Don't worry about output from -D processing.
Don't call cpp_output_tokens.
(cpp_finish): Don't dump macros here. Don't call
cpp_output_tokens.
* cppmacro.c (_cpp_dump_definition): Rename
cpp_dump_definition. Write directly to a FILE *.
(dump_funlike_macro): Delete.
(dump_macro_args): New.
* cpplex.c (TOKEN_LEN): Convert to inline function.
(_cpp_grow_token_buffer, safe_fwrite, cpp_output_tokens,
cpp_scan_line, _cpp_dump_list): Delete.
(cpp_printf, cpp_output_list): New.
(output_line_command): Don't worry about entering or leaving files.
(cpp_scan_buffer): Just output each token as we hit it.
(process_directive): Don't call cpp_output_tokens.
(_cpp_glue_header_name): Don't use token_buffer.
(output_token, dump_param_spelling): Write directly to a FILE *.
* cpplib.c (pass_thru_directive, dump_macro_name,
pragma_dispatch, do_pragma_gcc): Delete.
(do_define, do_undef, parse_include, do_line, do_ident, do_pragma,
do_pragma_poison, cpp_pop_buffer): Call the appropriate hook
functions.
(do_error, do_warning, pragma_dependency): Call
_cpp_begin_message, then cpp_output_list.
(cpp_register_pragma, cpp_register_pragma_space,
_cpp_init_internal_pragmas): New.
(do_pragma): Walk the pragmas table here.
(do_pragma_once, do_pragma_poison, do_pragma_system_header,
do_pragma_dependency): Return void.
(do_pragma_implementation): Moved to cppmain.c.
* cpplib.h: Update prototypes.
(struct cpp_reader): Remove printer, token_buffer,
token_buffer_size, and limit. Add struct cb, and pragmas.
(struct cpp_printer): Remove last_id and written.
(CPP_WRITTEN, CPP_PWRITTEN, CPP_SET_WRITTEN,
CPP_ADJUST_WRITTEN): Delete.
* cpphash.h: Update prototypes.
(ufputs): New wrapper.
* cppmain.c (cb_define, cb_undef, cb_include, cb_ident,
cb_enter_file, cb_leave_file, cb_def_pragma): New functions.
(main): Set up callbacks. Register #pragma implementation.
Dump macros from here.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@35415 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cpphash.h')
-rw-r--r-- | gcc/cpphash.h | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/gcc/cpphash.h b/gcc/cpphash.h index c6c3f0a0b65..c5b024427ec 100644 --- a/gcc/cpphash.h +++ b/gcc/cpphash.h @@ -210,10 +210,15 @@ extern unsigned char _cpp_IStable[256]; #define DUMMY_TOKEN 0 #define NO_DUMMY_TOKEN 1 +/* In cpperror.c */ +enum error_type { WARNING = 0, PEDWARN, ERROR, FATAL, ICE }; +extern int _cpp_begin_message PARAMS ((cpp_reader *, enum error_type, + const char *, unsigned int, + unsigned int)); + /* In cppmacro.c */ extern void _cpp_free_definition PARAMS ((cpp_hashnode *)); extern int _cpp_create_definition PARAMS ((cpp_reader *, cpp_hashnode *)); -extern void _cpp_dump_definition PARAMS ((cpp_reader *, cpp_hashnode *)); /* In cpphash.c */ extern void _cpp_init_macros PARAMS ((cpp_reader *)); @@ -253,9 +258,6 @@ extern int _cpp_equiv_toklists PARAMS ((const cpp_toklist *, extern void _cpp_expand_token_space PARAMS ((cpp_toklist *, unsigned int)); extern void _cpp_reserve_name_space PARAMS ((cpp_toklist *, unsigned int)); extern void _cpp_expand_name_space PARAMS ((cpp_toklist *, unsigned int)); -extern void _cpp_dump_list PARAMS ((cpp_reader *, - const cpp_toklist *, - const cpp_token *, int)); extern int _cpp_equiv_tokens PARAMS ((const cpp_token *, const cpp_token *)); extern void _cpp_run_directive PARAMS ((cpp_reader *, @@ -279,6 +281,7 @@ extern struct answer **_cpp_find_answer PARAMS ((cpp_hashnode *, const cpp_toklist *)); extern void _cpp_init_stacks PARAMS ((cpp_reader *)); extern void _cpp_cleanup_stacks PARAMS ((cpp_reader *)); +extern void _cpp_init_internal_pragmas PARAMS ((cpp_reader *)); /* Utility routines and macros. */ #define xnew(T) (T *) xmalloc (sizeof(T)) @@ -295,6 +298,7 @@ static inline int ustrncmp PARAMS ((const U_CHAR *, const U_CHAR *, static inline size_t ustrlen PARAMS ((const U_CHAR *)); static inline U_CHAR *uxstrdup PARAMS ((const U_CHAR *)); static inline U_CHAR *ustrchr PARAMS ((const U_CHAR *, int)); +static inline int ufputs PARAMS ((const U_CHAR *, FILE *)); static inline int ustrcmp (s1, s2) @@ -333,4 +337,12 @@ ustrchr (s1, c) return (U_CHAR *) strchr ((const char *)s1, c); } +static inline int +ufputs (s, f) + const U_CHAR *s; + FILE *f; +{ + return fputs ((const char *)s, f); +} + #endif |