diff options
author | Neil Booth <neilb@earthling.net> | 2000-12-07 23:17:56 +0000 |
---|---|---|
committer | Neil Booth <neil@gcc.gnu.org> | 2000-12-07 23:17:56 +0000 |
commit | 642ce434645564d7f02c4acefe90b74a0eca5d09 (patch) | |
tree | 7d2a48752253e693dd73859fe4a6329bee0871f1 /gcc/cpphash.h | |
parent | 02428c5d54c4280b35d33dfbed45c035ea9b4a06 (diff) | |
download | gcc-642ce434645564d7f02c4acefe90b74a0eca5d09.zip gcc-642ce434645564d7f02c4acefe90b74a0eca5d09.tar.gz gcc-642ce434645564d7f02c4acefe90b74a0eca5d09.tar.bz2 |
cppfiles.c (struct include_file): Move from cpphash.h.
* cppfiles.c (struct include_file): Move from cpphash.h.
(_cpp_never_reread): New function.
(open_file, read_include_file): Use it.
(stack_include_file): Set the buffer's sysp according to the
path in which the file was found.
(find_include_file): Don't set sysp.
(cpp_make_system_header, actual_directory): Update.
(_cpp_execute_include): Do #include_next lookup handling here,
not in cpplib.c. Use _cpp_never_reread.
* cpphash.h (struct_include_file): Remove.
(struct cpp_buffer): New member sysp.
(CPP_IN_SYSTEM_HEADER, _cpp_execute_include): Update.
(_cpp_never_reread): New.
* cpplib.c (read_line_number): Rename read_flag. Rework slightly.
(end_directive): Clear line_extension flag.
(_cpp_handle_directive): Set line_extension flag for #number.
(do_include_next): Handle path lookup in _cpp_execute_include.
(do_line): Cleanup to use read_flag. Don't allow flags in #line.
(_cpp_do_file_change): Update.
(do_pragma_once): Use cpp_never_reread. Clean up.
* cpplib.h (struct lexer_state): New member line_extension.
From-SVN: r38120
Diffstat (limited to 'gcc/cpphash.h')
-rw-r--r-- | gcc/cpphash.h | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/gcc/cpphash.h b/gcc/cpphash.h index 433b665..1f4f985 100644 --- a/gcc/cpphash.h +++ b/gcc/cpphash.h @@ -70,24 +70,6 @@ struct file_name_list }; #define ABSOLUTE_PATH ((struct file_name_list *)-1) -/* This structure is used for the table of all includes. */ -struct include_file -{ - const char *name; /* actual path name of file */ - const cpp_hashnode *cmacro; /* macro, if any, preventing reinclusion. */ - const struct file_name_list *foundhere; - /* location in search path where file was - found, for #include_next */ - const unsigned char *buffer; /* pointer to cached file contents */ - struct stat st; /* copy of stat(2) data for file */ - int fd; /* fd open on file (short term storage only) */ - unsigned short include_count; /* number of times file has been read */ - unsigned short refcnt; /* number of stacked buffers using this file */ - unsigned char sysp; /* file is a system header */ - unsigned char mapped; /* file buffer is mmapped */ - unsigned char defined; /* cmacro prevents inclusion in this state */ -}; - /* The cmacro works like this: If it's NULL, the file is to be included again. If it's NEVER_REREAD, the file is never to be included again. Otherwise it is a macro hashnode, and the file is @@ -148,6 +130,9 @@ struct cpp_buffer /* Temporary storage for pfile->skipping whilst in a directive. */ unsigned char was_skipping; + + /* 1 = system header file, 2 = C system header file used for C++. */ + unsigned char sysp; }; /* Character classes. @@ -191,8 +176,7 @@ extern unsigned char _cpp_trigraph_map[UCHAR_MAX + 1]; #define CPP_PREV_BUFFER(BUFFER) ((BUFFER)->prev) #define CPP_PRINT_DEPS(PFILE) CPP_OPTION (PFILE, print_deps) #define CPP_IN_SYSTEM_HEADER(PFILE) \ - (CPP_BUFFER (PFILE) && CPP_BUFFER (PFILE)->inc \ - && CPP_BUFFER (PFILE)->inc->sysp) + (CPP_BUFFER (PFILE) && CPP_BUFFER (PFILE)->sysp) #define CPP_PEDANTIC(PF) \ CPP_OPTION (PF, pedantic) #define CPP_WTRADITIONAL(PF) \ @@ -223,11 +207,11 @@ extern cpp_hashnode *_cpp_lookup_with_hash PARAMS ((cpp_reader*, size_t, unsigned int)); /* In cppfiles.c */ +extern void _cpp_never_reread PARAMS ((struct include_file *)); extern void _cpp_simplify_pathname PARAMS ((char *)); extern int _cpp_read_file PARAMS ((cpp_reader *, const char *)); extern void _cpp_execute_include PARAMS ((cpp_reader *, - const cpp_token *, int, - struct file_name_list *)); + const cpp_token *, int, int)); extern int _cpp_compare_file_date PARAMS ((cpp_reader *, const cpp_token *)); extern void _cpp_report_missing_guards PARAMS ((cpp_reader *)); |