diff options
author | Neil Booth <neilb@earthling.net> | 2000-11-27 08:00:04 +0000 |
---|---|---|
committer | Neil Booth <neil@gcc.gnu.org> | 2000-11-27 08:00:04 +0000 |
commit | 27e2564ac886bee1a7552df98dcab17a4bf06e26 (patch) | |
tree | 6ecb94c4e9edb0c2004142e389531669ea20c416 /gcc/cpphash.h | |
parent | 9ccb25d582aba15db6bb27944085c7478d532ade (diff) | |
download | gcc-27e2564ac886bee1a7552df98dcab17a4bf06e26.zip gcc-27e2564ac886bee1a7552df98dcab17a4bf06e26.tar.gz gcc-27e2564ac886bee1a7552df98dcab17a4bf06e26.tar.bz2 |
c-lex.c (cb_enter_file, [...]): Combine into the new function cb_change_file.
* c-lex.c (cb_enter_file, cb_leave_file, cb_rename_file):
Combine into the new function cb_change_file.
(init_c_lex): Update.
* cppfiles.c (stack_include_file): Use _cpp_do_file_change.
(cpp_syshdr_flags): Delete.
* cpphash.h (_cpp_do_file_change): New prototype.
Move struct cpp_buffer here from...
* cpplib.h (struct cpp_buffer): ... here.
(enum cpp_fc_reason, struct cpp_file_loc,
struct_cpp_file_change, change_file): New.
(enter_file, leave_file, rename_file, cpp_syshdr_flags): Delete.
* cpplib.c (do_line): Update for new cb_change_file callback.
(_cpp_do_file_change): New function.
(_cpp_pop_buffer): Update to use it.
* cppmain.c (move_printer): Delete.
(main): Set up single callback cb_change_file.
(cb_enter_file, cb_leave_file, cb_rename_file): Delete.
(cb_change_file): New.
* fix-header.c (cur_file, cb_change_file): New.
(recognized_function, read_scan_file): Update.
* scan-decls.c (scan_decls): Update.
* scan.h (recognized_function): Update prototype.
From-SVN: r37784
Diffstat (limited to 'gcc/cpphash.h')
-rw-r--r-- | gcc/cpphash.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/gcc/cpphash.h b/gcc/cpphash.h index 500c0c2..698f545 100644 --- a/gcc/cpphash.h +++ b/gcc/cpphash.h @@ -98,6 +98,58 @@ struct include_file ((inc)->cmacro && ((inc)->cmacro == NEVER_REREAD \ || ((inc)->cmacro->type == NT_MACRO) == (inc)->defined)) +struct cpp_buffer +{ + const unsigned char *cur; /* current position */ + const unsigned char *rlimit; /* end of valid data */ + const unsigned char *line_base; /* start of current line */ + cppchar_t read_ahead; /* read ahead character */ + cppchar_t extra_char; /* extra read-ahead for long tokens. */ + + struct cpp_reader *pfile; /* Owns this buffer. */ + struct cpp_buffer *prev; + + const unsigned char *buf; /* entire buffer */ + + /* Filename specified with #line command. */ + const char *nominal_fname; + + /* Actual directory of this file, used only for "" includes */ + struct file_name_list *actual_dir; + + /* Pointer into the include table. Used for include_next and + to record control macros. */ + struct include_file *inc; + + /* Value of if_stack at start of this file. + Used to prohibit unmatched #endif (etc) in an include file. */ + struct if_stack *if_stack; + + /* Token column position adjustment owing to tabs in whitespace. */ + unsigned int col_adjust; + + /* Line number at line_base (above). */ + unsigned int lineno; + + /* Because of the way the lexer works, -Wtrigraphs can sometimes + warn twice for the same trigraph. This helps prevent that. */ + const unsigned char *last_Wtrigraphs; + + /* True if we have already warned about C++ comments in this file. + The warning happens only for C89 extended mode with -pedantic on, + or for -Wtraditional, and only once per file (otherwise it would + be far too noisy). */ + unsigned char warned_cplusplus_comments; + + /* True if we don't process trigraphs and escaped newlines. True + for preprocessed input, command line directives, and _Pragma + buffers. */ + unsigned char from_stage3; + + /* Temporary storage for pfile->skipping whilst in a directive. */ + unsigned char was_skipping; +}; + /* Character classes. If the definition of `numchar' looks odd to you, please look up the definition of a pp-number in the C standard [section 6.4.8 of C99]. @@ -208,6 +260,8 @@ extern void _cpp_do__Pragma PARAMS ((cpp_reader *)); 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 *)); +extern void _cpp_do_file_change PARAMS ((cpp_reader *, enum cpp_fc_reason, + const char *, unsigned int)); /* Utility routines and macros. */ #define DSC(str) (const U_CHAR *)str, sizeof str - 1 |