summaryrefslogtreecommitdiff
path: root/gcc/cpphash.h
diff options
context:
space:
mode:
authorneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2001-08-11 07:33:39 +0000
committerneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2001-08-11 07:33:39 +0000
commitf85fcf2bb8dc7f1d1535a653d1e484e6fb06e2da (patch)
treec6597f82b6f803c65532fe99e5912e516912053f /gcc/cpphash.h
parent4d0a576dd54fdd609039752499175699e117563c (diff)
downloadgcc-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/cpphash.h')
-rw-r--r--gcc/cpphash.h18
1 files changed, 5 insertions, 13 deletions
diff --git a/gcc/cpphash.h b/gcc/cpphash.h
index 5409e070569..366655b71e9 100644
--- a/gcc/cpphash.h
+++ b/gcc/cpphash.h
@@ -66,7 +66,7 @@ struct cpp_chunk
typedef struct cpp_pool cpp_pool;
struct cpp_pool
{
- struct cpp_chunk *cur, *locked;
+ struct cpp_chunk *cur, *locked, *first;
unsigned char *pos; /* Current position. */
unsigned int align;
unsigned int locks;
@@ -190,11 +190,6 @@ struct cpp_buffer
/* Token column position adjustment owing to tabs in whitespace. */
unsigned int col_adjust;
- /* The line of the buffer that we return to after a #include.
- Strictly this is redundant, since it can be calculated from the
- line maps, but it is clearest to save it here. */
- unsigned int return_to_line;
-
/* Contains PREV_WHITE and/or AVOID_LPASTE. */
unsigned char saved_flags;
@@ -213,9 +208,6 @@ struct cpp_buffer
buffers. */
unsigned char from_stage3;
- /* 1 = system header file, 2 = C system header file used for C++. */
- unsigned char sysp;
-
/* Nonzero means that the directory to start searching for ""
include files has been calculated and stored in "dir" below. */
unsigned char search_cached;
@@ -247,7 +239,7 @@ struct cpp_reader
/* Source line tracking. */
struct line_maps line_maps;
- struct line_map *map;
+ const struct line_map *map;
unsigned int line;
/* The position of the last lexed token and last lexed directive. */
@@ -376,8 +368,7 @@ extern unsigned char _cpp_trigraph_map[UCHAR_MAX + 1];
/* Macros. */
#define CPP_PRINT_DEPS(PFILE) CPP_OPTION (PFILE, print_deps)
-#define CPP_IN_SYSTEM_HEADER(PFILE) \
- (CPP_BUFFER (PFILE) && CPP_BUFFER (PFILE)->sysp)
+#define CPP_IN_SYSTEM_HEADER(PFILE) (pfile->map && pfile->map->sysp)
#define CPP_PEDANTIC(PF) CPP_OPTION (PF, pedantic)
#define CPP_WTRADITIONAL(PF) CPP_OPTION (PF, warn_traditional)
@@ -439,7 +430,8 @@ extern void _cpp_do__Pragma PARAMS ((cpp_reader *));
extern void _cpp_init_directives PARAMS ((cpp_reader *));
extern void _cpp_init_internal_pragmas PARAMS ((cpp_reader *));
extern void _cpp_do_file_change PARAMS ((cpp_reader *, enum lc_reason,
- unsigned int));
+ const char *,
+ unsigned int, unsigned int));
extern void _cpp_pop_buffer PARAMS ((cpp_reader *));
/* Utility routines and macros. */