PATCH to defer cpp_read_main_file and related changes
Neil Booth
neil@daikokuya.co.uk
Thu Sep 25 20:27:00 GMT 2003
Per Bothner wrote:-
> This patch does a couple of related things.
> It's more "cleanups" to bring the structure of the trunk
> closer to the compile-server, and I think make things
> a little more consistent.
[...]
> 2003-09-24 Per Bothner <pbothner@apple.com>
>
> * cpplib.c (_cpp_pop_buffer): Do generate a _cpp_do_file_change
> callback even when popping the main file.
> * c-lex.c (fe_file_change): Handle a NULL new_map.
> * fix-header.c (cb_file_change): Likewise.
> * c-ppoutput.c (pp_file_change): Likewise.
> * c-opts.c (c_common_post_options): Don't call cpp_read_main_file yet.
> (c_common_parse_file): No longer need to call cpp_read_main_file
> when file_index > 0 (as in multi-file or server compiation).
> (finish_options): Change to <built-in> is an LC_ENTER, not LC_RENAME
> as this now happens before cpp_read_main_file. Add a matching
> closing LC_LEAVE, with magic to defer push_command_line_include.
> Then call cpp_read_main_file when we're done with options.
> (push_command_line_include): The LC_RENAME here is no longer needed.
> (fe_file_change): Handle NULL new_map, and simplify.
> * cpplex.c (_cpp_get_fresh_line): Revert my no-longer-needed
> 08-28 change, since we're never called with a NULL buffer.
> (_cpp_lex_direct): Likewise.
> * cpptrad.c (_cpp_read_logical_line_trad): Likewise.
> Return false if buffer is NULL at end.
I'm happy with this if you are; it does seem to improve some things.
If you haven't already, could you document clearly somewhere what a
NULL map means?
Thanks,
Neil.
More information about the Gcc-patches
mailing list