summaryrefslogtreecommitdiff
path: root/gcc/cppfiles.c
diff options
context:
space:
mode:
authorneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2000-11-27 08:00:04 +0000
committerneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2000-11-27 08:00:04 +0000
commitd7503801e5662ff8d132df1e21bdfcbeaa3a5174 (patch)
tree6ecb94c4e9edb0c2004142e389531669ea20c416 /gcc/cppfiles.c
parent15155f829e7ddc1a5dd4a45cecdcf9d173c74380 (diff)
downloadgcc-d7503801e5662ff8d132df1e21bdfcbeaa3a5174.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37784 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cppfiles.c')
-rw-r--r--gcc/cppfiles.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/gcc/cppfiles.c b/gcc/cppfiles.c
index 47bf43f211f..9af0c396cd7 100644
--- a/gcc/cppfiles.c
+++ b/gcc/cppfiles.c
@@ -212,8 +212,16 @@ stack_include_file (pfile, inc)
cpp_reader *pfile;
struct include_file *inc;
{
+ const char *filename = 0;
+ unsigned int lineno = 0;
cpp_buffer *fp;
+ if (pfile->buffer)
+ {
+ filename = pfile->buffer->nominal_fname;
+ lineno = pfile->buffer->lineno;
+ }
+
if (pfile->context->prev)
cpp_ice (pfile, "attempt to push file buffer with contexts stacked");
@@ -237,7 +245,7 @@ stack_include_file (pfile, inc)
fp->buf = inc->buffer;
fp->rlimit = fp->buf + inc->st.st_size;
fp->cur = fp->buf;
- fp->lineno = 1;
+ fp->lineno = 0;
fp->line_base = fp->buf;
/* The ->actual_dir field is only used when ignore_srcdir is not in effect;
@@ -249,9 +257,9 @@ stack_include_file (pfile, inc)
pfile->include_depth++;
pfile->input_stack_listing_current = 0;
- if (pfile->cb.enter_file)
- (*pfile->cb.enter_file) (pfile);
+ _cpp_do_file_change (pfile, FC_ENTER, filename, lineno);
+ fp->lineno = 1;
return 1;
}
@@ -531,20 +539,6 @@ cpp_make_system_header (pfile, pbuf, flag)
pbuf->inc->sysp = flag;
}
-const char *
-cpp_syshdr_flags (pfile, pbuf)
- cpp_reader *pfile ATTRIBUTE_UNUSED;
- cpp_buffer *pbuf;
-{
-#ifndef NO_IMPLICIT_EXTERN_C
- if (CPP_OPTION (pfile, cplusplus) && pbuf->inc->sysp == 2)
- return " 3 4";
-#endif
- if (pbuf->inc->sysp)
- return " 3";
- return "";
-}
-
/* Report on all files that might benefit from a multiple include guard.
Triggered by -H. */
void