diff options
author | Neil Booth <neil@daikokuya.co.uk> | 2003-04-19 00:22:51 +0000 |
---|---|---|
committer | Neil Booth <neil@gcc.gnu.org> | 2003-04-19 00:22:51 +0000 |
commit | 26aea0737b2d0c4ee328d547555ae25ab5de9a0a (patch) | |
tree | 6e2502497aefe03b070107d7b41bbe6be454b727 /gcc/cppinit.c | |
parent | 606c99912372a1fd5354765992eaef014ab78ce2 (diff) | |
download | gcc-26aea0737b2d0c4ee328d547555ae25ab5de9a0a.zip gcc-26aea0737b2d0c4ee328d547555ae25ab5de9a0a.tar.gz gcc-26aea0737b2d0c4ee328d547555ae25ab5de9a0a.tar.bz2 |
cppfiles.c (ENABLE_VALGRIND_CHECKING, [...]): Remove.
* cppfiles.c (ENABLE_VALGRIND_CHECKING, VALGRIND_DISCARD,
MMAP_THRESHOLD, TEST_THRESHOLD, SHOULD_MMAP): Remove.
(struct include_file): Remove fefcnt, mapped members.
(open_file, stack_include_file, _cpp_pop_file_buffer): Disable caching.
(read_include_file): Don't use mmap, terminate buffers in '\r'.
(purge_cache): Don't use munmap.
* cpphash.h (CPP_BUF_COLUMN): Update.
(lexer_state): Remove lexing_comment.
(struct _cpp_line_note): New.
(struct cpp_buffer): New members cur_note, notes_used, notes_cap,
next_line and need_line. Remove col_adjust and saved_flags.
(_cpp_process_line_notes, _cpp_clean_line, _cpp_get_fresh_line,
_cpp_skip_block_comment, scan_out_logical_line): New.
(_cpp_init_mbchar): Remove.
* cppinit.c (init_library): Remove call to _cpp_init_mbchar.
(cpp_read_main_file): Set line to 1 earlier.
(post_options): -traditional-cpp doesn't want trigraphs.
* cpplex.c (MULTIBYTE_CHARS): Remove code predicated on this.
(add_line_note, _cpp_clean_line, _cpp_process_line_notes,
_cpp_get_fresh_line): New.
(handle_newline, skip_escaped_newlines, trigraph_p,
continue_after_nul, _cpp_init_mbchar): Remove.
(get_effective_char): Update.
(_cpp_skip_block_comment): Rename from skip_block_comment, simplify.
(skip_line_comment): Simplify.
(skip_whitespace, parse_identifier, parse_slow, parse_number,
parse_string): Update.
(cpp_lex_direct): Use clean lines and process line notes. Update.
(cpp_interpret_charconst): No MULTIBYTE_CHARS.
* cpplib.c (prepare_directive_trad): Call scan_out_logical_line
directly.
(_cpp_handle_directive): Don't set saved_flags.
(run_directive, destringize_and_run, cpp_define, cpp_define_builtin,
cpp_undef, handle_assertion, cpp_push_buffer): Update.
(_cpp_pop_buffer): Free notes.
* cppmacro.c (builtin_macro, paste_tokens): \n terminate buffer.
* cpppch.c (cpp_read_state): \n terminate buffer.
* cpptrad.c (skip_escaped_newlines, handle_newline): Remove.
(copy_comment): Use _cpp_skip_block_comment.
(skip_whitespace, lex_identifier, _cpp_read_logical_line_trad):
Simplify.
(_cpp_overlay_buffer, _cpp_remove_overlay, push_replacement_text,
save_replacement_text): Update.
(scan_out_logical_line): Update to use clean lines and process
line notes.
* fix-header.c (read_scan_file): Update.
testsuite:
* gcc.dg/cpp/_Pragma4.c: Remove stray space.
* gcc.dg/cpp/trad/escaped-eof.c: Correct line number.
From-SVN: r65808
Diffstat (limited to 'gcc/cppinit.c')
-rw-r--r-- | gcc/cppinit.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/gcc/cppinit.c b/gcc/cppinit.c index 376d72e..74679c0 100644 --- a/gcc/cppinit.c +++ b/gcc/cppinit.c @@ -125,8 +125,6 @@ init_library () we were compiled with a compiler that supports C99 designated initializers. */ init_trigraph_map (); - - _cpp_init_mbchar (); } } @@ -167,7 +165,6 @@ cpp_create_reader (lang, table) /* Initialize the line map. Start at logical line 1, so we can use a line number of zero for special states. */ init_line_maps (&pfile->line_maps); - pfile->line = 1; /* Initialize lexer state. */ pfile->state.save_comments = ! CPP_OPTION (pfile, discard_comments); @@ -454,6 +451,7 @@ cpp_read_main_file (pfile, fname) } /* Open the main input file. */ + pfile->line = 1; if (!_cpp_read_file (pfile, fname)) return NULL; @@ -556,7 +554,11 @@ post_options (pfile) CPP_OPTION (pfile, traditional) = 0; } - /* Traditional CPP does not accurately track column information. */ if (CPP_OPTION (pfile, traditional)) - CPP_OPTION (pfile, show_column) = 0; + { + /* Traditional CPP does not accurately track column information. */ + CPP_OPTION (pfile, show_column) = 0; + CPP_OPTION (pfile, trigraphs) = 0; + CPP_OPTION (pfile, warn_trigraphs) = 0; + } } |