aboutsummaryrefslogtreecommitdiff
path: root/gcc/line-map.c
AgeCommit message (Collapse)AuthorFilesLines
2001-08-21cppfiles.c (stack_include_file): line-map.c now handles include depth.Neil Booth1-10/+15
* cppfiles.c (stack_include_file): line-map.c now handles include depth. (handle_missing_handler): Similarly. (_cpp_execute_include): Similarly. (_cpp_pop_file_buffer): Similarly. * cpphash.h (struct cpp_reader): Remove system_include_depth, buffer_stack_depth and include_depth. * cpplib.c (do_include_common): line-map.c now handles include depth. (cpp_push_buffer): Similarly. (_cpp_pop_buffer): Similarly. * cppmacro.c (builtin_macro): Update. * line-map.c (init_line_maps): Set depth. (add_line_map): Increment "used" earlier. Update and use the include depth. (trace_include): Use the include depth. * line-map.h (struct line_maps): New member depth. From-SVN: r45085
2001-08-21cppfiles.c (stack_include_file): Don't handle -H here.Neil Booth1-1/+22
* cppfiles.c (stack_include_file): Don't handle -H here. * cppinit.c (cpp_start_read): Set include tracing after cpp_post_options and after stacking the main file. * line-map.c (trace_include): New. (init_line_maps, add_line_map): Update. * line-map.h (struct line_maps): New member trace_includes. From-SVN: r45084
2001-08-11c-lex.c (map): Make const.Neil Booth1-15/+39
* 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. From-SVN: r44789
2001-08-06cpperror.c (print_containing_files): Moved to line-map.c.Neil Booth1-9/+73
* cpperror.c (print_containing_files): Moved to line-map.c. (print_location): line-map.c handles re-listing or otherwise. * cpphash.h (struct lexer_state): Remove next_bol. (struct cpp_buffer): Remove include_stack_listed. * cpplib.c (do_line, cpp_push_buffer, _cpp_pop_buffer): Remove faked buffer handling. (_cpp_do_file_change): Tweak. * cpplib.h (enum cpp_buffer_type): Remove BUF_FAKE. * cppmain.c (struct printer): Remove filename. (print_line, cb_file_change): Update accordingly. * line-map.c: Include intl.h. (init_line_maps): Initialize last_listed. (free_line_maps): Sanity check, warn if ENABLED_CHECKING. (add_line_map): Sanity check inputs, warn if ENABLED_CHECKING. (print_containing_files): New. * line-map.h (struct line_maps): New member last_listed. (print_containing_files, INCLUDED_FROM): New. * Makefile.in: Update. * po/POTFILES.in: Add line-map.c. From-SVN: r44670
2001-08-05re PR preprocessor/3824 (With -traditional, CPP 0xffffffff > 0 but C ↵Neil Booth1-1/+4
0xffffffff < 0) PR preprocessor/3824 * line-map.c: Update comments. * line-map.h: Update comments. * tradcif.y: Don't consider large numbers unsigned. * gcc.dg/cpp/tr-sign.c: New testcase. From-SVN: r44651
2001-08-02line-map.c: New.Neil Booth1-0/+118
* line-map.c: New. * line-map.h: New. * Makefile.in (line-map.o): New. (LIBCPP_OBJS, LIBCPP_DEPS): Update. * c-lex.c (cb_file_change): Update for new cpp_file_change structure. * cpperror.c (print_containing_files): Similarly. (print_location): Update. Don't output a space before _Pragma. * cppfiles.c (stack_include_file): Set to line 1 immediately. (stack_include_filee, cpp_make_system_header): Update. (_cpp_execute_include): Get logical line number right for calling as-yet-unterminated #include. * cpphash.h (struct cpp_reader): Add line_maps. (_cpp_do_file_change): Update. * cppinit.c (cpp_create_reader): Initialize line maps. (cpp_destroy): Destroy line maps. (cpp_start_read): Get logical line number right. * cpplex.c (parse_string): Only warn once for multi-line strings. Use boolean variable for null warning. * cpplib.c (_cpp_handle_directive): End the directive if it isn't already. (do_include_common): End the directive early. (do_line): Don't warn about out-of-range lines in preprocessed source. Update. Remove unused variables. (_cpp_do_file_change): Update for new line mapping. (pragma_cb): New typedef. (cpp_register_pragma): Stop looking ahead before calling the handler. Clean up. (do_pragma_system_header): End directive early. (cpp_get_line_maps): New. (cpp_pop_buffer): Fudge logical line. Update. * cpplib.h: Include line-map.h (enum cpp_fc_reason): Remove. (struct cpp_file_change): Update. (cpp_get_line_maps): New. * cppmain.c (struct_printer): New member map. (cb_file_change): Update for new mappings. * fix-header.c (cb_file_change): Similarly. testsuite: * gcc.dg/cpp/19951025-1.c: Update. From-SVN: r44584