diff options
author | neil <neil@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-08-11 07:33:39 +0000 |
---|---|---|
committer | neil <neil@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-08-11 07:33:39 +0000 |
commit | f85fcf2bb8dc7f1d1535a653d1e484e6fb06e2da (patch) | |
tree | c6597f82b6f803c65532fe99e5912e516912053f /gcc/cpplib.h | |
parent | 4d0a576dd54fdd609039752499175699e117563c (diff) | |
download | gcc-f85fcf2bb8dc7f1d1535a653d1e484e6fb06e2da.tar.gz |
* c-lex.c (map): Make const.
(cb_file_change): Update for callback passing a line map.
Don't assume we have a previous map. Remove sanity check
about popping too many files.
* cpperror.c (print_location): Make map const.
* cppfiles.c (stack_include_file): Update; line maps now hold sysp.
(cpp_make_system_header): Similarly.
(search_from): Similarly.
(_cpp_execute_include): Don't remember where we came from.
* cpphash.h (struct cpp_buffer): Remove return_to_line, sysp.
(struct cpp_reader): Make map const.
(CPP_IN_SYSTEM_HEADER, _cpp_do_file_change): Update.
* cpplib.c (do_line): Update; line maps now hold sysp.
(cpp_push_buffer): Similarly.
(_cpp_do_file_change): Similarly; callback with map instead.
(cpp_get_line_maps): Constify return value.
(_cpp_pop_buffer): Update.
* cpplib.h (struct cpp_file_change): Remove.
(struct cpp_callbacks): Update.
(cpp_get_line_maps): Constify return value.
* cppmacro.c (_cpp_create_definition): Update.
* cppmain.c (struct printer): Constify map.
(maybe_print_line): Similarly.
(print_line): Similarly. Deduce flags 1 and 2 here.
(cb_file_change): Update.
* line-map.c (free_line_maps): Warn regardless.
(add_line_map): Return pointer to const. When passed NULL to_file
with LC_LEAVE, use the obvious values for the return point so the
caller doesn't have to figure them out.
(lookup_line): Return pointer to const.
(print_containing_files): Take pointer to const.
* line-map.h (struct line_map): New members reason, sysp.
(add_line_map): Return pointer to const.
(lookup_line): Similarly.
(print_containing_files): Take pointer to const.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@44789 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cpplib.h')
-rw-r--r-- | gcc/cpplib.h | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/gcc/cpplib.h b/gcc/cpplib.h index 32b3d8905e3..acce60620fd 100644 --- a/gcc/cpplib.h +++ b/gcc/cpplib.h @@ -387,20 +387,10 @@ struct cpp_options unsigned char help_only; }; -typedef struct cpp_file_change cpp_file_change; -struct cpp_file_change -{ - struct line_map *map; /* Line map, valid until next callback. */ - unsigned int line; /* Logical line number of next line. */ - enum lc_reason reason; /* Reason for change. */ - unsigned char sysp; /* Nonzero if system header. */ - unsigned char externc; /* Nonzero if wrapper needed. */ -}; - /* Call backs. */ struct cpp_callbacks { - void (*file_change) PARAMS ((cpp_reader *, const cpp_file_change *)); + void (*file_change) PARAMS ((cpp_reader *, const struct line_map *)); void (*include) PARAMS ((cpp_reader *, unsigned int, const unsigned char *, const cpp_token *)); void (*define) PARAMS ((cpp_reader *, unsigned int, cpp_hashnode *)); @@ -501,7 +491,7 @@ extern int cpp_destroy PARAMS ((cpp_reader *)); through the pointer returned from cpp_get_callbacks, or set them with cpp_set_callbacks. */ extern cpp_options *cpp_get_options PARAMS ((cpp_reader *)); -extern struct line_maps *cpp_get_line_maps PARAMS ((cpp_reader *)); +extern const struct line_maps *cpp_get_line_maps PARAMS ((cpp_reader *)); extern cpp_callbacks *cpp_get_callbacks PARAMS ((cpp_reader *)); extern void cpp_set_callbacks PARAMS ((cpp_reader *, cpp_callbacks *)); |