gcc/cygwin-gcc.git
18 years ago * gcc.c (use_server): Default to off.heads/compile-server-branch
mrs [Sat, 24 Jan 2004 07:11:58 +0000 (24 07:11 +0000)]
* gcc.c (use_server): Default to off.
(main): Set use_server early from GCCSERVER.
(execute): Skip "@." earlier when compile server isn't in use.
(process_command): Only turn -pipe off when server is in use.

* opts.c (add_input_filename): Ensure input filenames are
allocated with malloc.

* toplev.c (server_loop): Remove code that handled 'I', as input
files are now processed normally.

* c-common.h (init_cmdline_fragment): Add.
(create_cmdline_fragment): Add.
(end_cmdline_fragment): Add.
(activate_cmdline_fragment): Add.

* config/darwin-c.c (reinit_frameworks): Add void to arglist.
* opts.c (reinit_opts): Likewise.
* c-common.c (init_cmdline_fragment): Likewise.
* opts.h (reinit_opts): Likewise.
* c-incpath.c (reinit_incpath): Likewise.
* c-opts.c (reinit_copts): Likewise.

cp:
* lex.c (lang_clear_identifier): Remove unneeded code.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@76485 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago Move options processing from server command line to client command
mrs [Thu, 22 Jan 2004 04:10:28 +0000 (22 04:10 +0000)]
Move options processing from server command line to client command
line, default server starting to on.

* c-pch.c (c_common_read_pch): Allow options to initialized more
than once.
(c_common_no_more_pch): Don't unmap more than once, as other
compilation units can reuse the PCH state as is.

* c-opts.c (max_deferred): Add.
(defer_opt): Add bounds check.
(c_common_init_options): Allow options to initialized more than
once.
(c_common_post_options): Likewise.
(reinit_copts): Likewise.
(init_c_common_once): Likewise.
(c_common_parse_file): Likewise.
(c_common_parse_file): Moved pch-init to here.
(finish_options): Allow options to initialized more than once.

* c-objc-common.c (init_c_objc_common_once): Allow options to
initialized more than once.

* c-incpath.h (reinit_incpath): Add.

* c-incpath.c (reinit_incpath): Add.

* c-decl.c (init_c_decl_processing_eachsrc): Don't
reset_cpp_hashnodes.
(init_c_decl_processing_once): Allow options to initialized more
than once.

* c-common.h (synthetic_exit_fragment): Add.

* c-common.c (create_builtins_fragment): Allow options to
initialized more than once.
(gather_fragment_statistics): Always output fragment stats, for now.
(reset_cpp_hashnodes): Allow options to initialized more than
once.
(synthetic_exit_fragment): Add.
(create_output_fragment): Only create output fragments when in
sever mode 2.
(end_output_fragment): Likewise.
(create_output_fragment): Set the name of the fragment.
(create_cmdline_fragment): Add.
(end_cmdline_fragment): Add.
(init_cmdline_fragment): Add.
(activate_cmdline_fragment): Add.

* toplev.c (wrapup_global_declarations): Call
DECL_NEWEST_DUPLICATE on decl.
(wrapup_global_declarations): Don't infinitely loop if the decl
has been written out already.
(lang_dependent_init): Move pch_init from here.
(init_compile_once): Allow options to initialized more than once.
(server_loop): Free asm_file_name and input filenames.
(server_loop): Allow options to initialized more than once.
(toplev_main): Allow options to initialized more than once.

* opts.c (reinit_opts): Add.
(decode_options): Allow options to initialized more than once.

* objc/lang-specs.h: Simplify and allow -server to be the default.

* Makefile.in (TEST_TARGET): Remove coverage.o, as it cannot be
processed twice.
(start-server): Remove unneeded arguments.

* gcc.c: Default server to on.
(write_input_request): Remove.
(write_input_requests): Remove.
(cpp_unique_options): Simplify and allow -server to be the default.
(cc1_options): Likewise.
(default_compilers): Likewise.
(execute): Add code to allow -server to be the default.
(start_server): Add.
(waitforgo): Add.
(get_server_socket): Add compile server starting.
(write_switch_fds_request): Use waitforgo.

(process_command): Don't -pipe, as it defeats snarf-n-barf of asm
for fragments.

(pexecute_server): Remove call to write_input_requests as we now
handle them normally.

* cpplib.h (cpp_notice_updates): Add.

* cppinit.c (cpp_push_main_file): We start a new fragment for C++
for the main file.

* cppfiles.c (struct _cpp_file_data): Add generation.
(generation): Add.
(file_modified): Add.
(cpp_notice_updates): Add.
(open_file): Notice when a file has been modified.
(_cpp_find_file): Don't reuse a PCH file that has been read once.
(_cpp_find_file): If we re-validate the PCH file, reuse the fd.
(read_file_guts): Track the generation number of file that are
read.
(file_changed): Add.
(read_file): Notice when a file has been modified.
(_cpp_stack_file): Remove fragment starting code, as it is now
redundant with normal fragment processing.
(purge_fragments): Use delete_fragment.
(_cpp_pop_file_buffer): Add code to allow C++ to reuse the main
file.

* config/darwin-c.c (reinit_frameworks): Add.
(darwin_register_frameworks_real): Use reinit_frameworks to
reinitialize framework processing.

* c-common.c (reset_hashnode): Also clear NODE_DIAGNOSTIC.

cp:
* lex.c (lang_clear_identifier): Don't clear symbol table as we
use a conditional symbol table.

* lang-specs.h: Simplify and allow -server to be the default.

* decl.c (init_cxx_decl_processing_once): Allow options to
initialized more than once.
(init_cxx_decl_processing_eachsrc): Likewise.
* lex.c (init_cxx_once): Likewise.
(init_cxx_eachsrc): Likewise.
(extract_interface_info): Likewise.

* cp-lang.c (LANG_HOOKS_FINISH_SERVER): Add.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@76336 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * c-decl.c (lang_clear_identifier): Clear the DECL_RTL of the id's
bothner [Thu, 18 Dec 2003 06:20:23 +0000 (18 06:20 +0000)]
* c-decl.c (lang_clear_identifier):  Clear the DECL_RTL of the id's
IDENTIFIER_SYMBOL_VALUE.  This is needed at least for Darwin, which
encodes in the rtx name whether the decl is defined.
(duplicate_decls):  Don't copy the rtl; we can't safely use it.
* config/darwin.c (machopic_classify_ident):  Using
maybe_get_identifier doesn't since it may get a name from previous
output file when using the compile server.
(machopic_finish):  Reset machopic_defined_list.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@74774 138bc75d-0d04-0410-961f-82ee72b054a4

18 years agoAdd FIXME commen t.
bothner [Mon, 15 Dec 2003 19:09:14 +0000 (15 19:09 +0000)]
Add FIXME commen t.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@74643 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * c-decl.c (lang_clear_identifier): Clear TREE_SYMBOL_REFERENCED too.
bothner [Mon, 15 Dec 2003 18:53:24 +0000 (15 18:53 +0000)]
* c-decl.c (lang_clear_identifier):  Clear TREE_SYMBOL_REFERENCED too.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@74640 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * decl.c (setup_globals): ANSI-fy function header.
bothner [Mon, 15 Dec 2003 18:40:16 +0000 (15 18:40 +0000)]
* decl.c (setup_globals):  ANSI-fy function header.
* lex.c (lang_clear_identifier):  Likewise.
* name-lookup.c (lookup_using_namespace_one):  Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@74639 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * tree.h (DECL_NEWEST_DUPLICATE): New macro.
bothner [Sun, 14 Dec 2003 03:03:52 +0000 (14 03:03 +0000)]
* tree.h (DECL_NEWEST_DUPLICATE):  New macro.
* tree.c (get_callee_fndecl):  Use DECL_NEWEST_DUPLICATE.
* expr.c (expand_expr):  Likewise.
* varasm.c (make_decl_rtl, assemble_variable):  Likewise.
(merge_weak):  Don't call mark_weak on olddecl.
* c-decl.c (pushdecl):  Call DECL_NEWEST_DUPLICATE on old decl.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@74613 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * function.c (init_function_once): Don't reset funcdef_no.
bothner [Sat, 13 Dec 2003 05:48:57 +0000 (13 05:48 +0000)]
* function.c (init_function_once):  Don't reset funcdef_no.
It doesn't work when RTL is reused across translation units.
This reverts a 10-29 change.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@74600 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * c-decl.c (finish_struct): Move C_TYPE_INCOMPLETE_VARS processing to
bothner [Sat, 13 Dec 2003 05:32:01 +0000 (13 05:32 +0000)]
* c-decl.c (finish_struct):  Move C_TYPE_INCOMPLETE_VARS processing to
(finish_incomplete_vars):  ... this new function.
(restore_fragment_bindings):  Call finish_incomplete_vars.  Needed if
one compilation defines a tag, and another restores it as an incomplete
structure-type-references, uses it for decls, and then restores the
tag definition, at which point we need to complete those decls.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@74598 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * cppfiles.c (validate_pch): Grab file->data after open_file, as
mrs [Fri, 12 Dec 2003 23:11:31 +0000 (12 23:11 +0000)]
* cppfiles.c (validate_pch): Grab file->data after open_file, as
it can set it.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@74585 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * c-common.c (register_decl_dependency, reserve_fragment_binding,
bothner [Fri, 12 Dec 2003 05:06:18 +0000 (12 05:06 +0000)]
* c-common.c (register_decl_dependency, reserve_fragment_binding,
reset_cpp_hashnodes, note_fragment_binding_1, note_fragment_binding_2,
note_fragment_binding_3, register_fragment_dependency, reset_hashnode,
dont_defeat_good_checking, save_fragment_bindings, cb_exit_fragment,
init_output_fragment):  Change function header to ISO prototypes.
* c-common.h (alloc_include_fragment):  Likewise.
* c-decl.c (lang_clear_identifier, init_c_decl_processing_eachsrc,
setup_globals):  Likewise.
* c-lex.c (register_cpp_callbacks):  Likewise.
* c-objc-common.c (init_c_objc_common_once):  Likewise.
* c-opts.c (init_c_common_once):  Likewise.
* cppfiles.c (_cpp_enter_fragment, _cpp_exit_fragment):  Likewise.
* cpplib.c (_cpp_start_fragment, _cpp_note_macro):  Likewise.
* toplev.c (compile_file_finish, server_loop):  Likewise.
* tree.c (get_next_decl_uid):  Likewise.

* c-decl.c (duplicate_decls):  Mark different_tu ATTRIBUTE_UNUSED.

* c-common.c (restore_fragment, cb_exit_fragment):  More statistics.
(warn_fragment_invalidation, gather_fragment_statistics): Move earlier.
* c-common.c (cb_enter_fragment):  Don't restore_fragment if empty.
* c-common.c (cb_exit_fragment):  Return never-executed loop.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@74561 138bc75d-0d04-0410-961f-82ee72b054a4

18 years agoCleanup merge bits
mrs [Thu, 11 Dec 2003 22:30:43 +0000 (11 22:30 +0000)]
Cleanup merge bits

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@74552 138bc75d-0d04-0410-961f-82ee72b054a4

18 years agoMerge in objc-improvements-merge-20030811->tree-ssa-20020619-merge-20031207 to compil...
mrs [Thu, 11 Dec 2003 22:26:58 +0000 (11 22:26 +0000)]
Merge in objc-improvements-merge-20030811->tree-ssa-20020619-merge-20031207 to compile-server-branch

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@74550 138bc75d-0d04-0410-961f-82ee72b054a4

18 years agoThis commit was manufactured by cvs2svn to create branch
(no author) [Thu, 11 Dec 2003 16:21:39 +0000 (11 16:21 +0000)]
This commit was manufactured by cvs2svn to create branch
'compile-server-branch'.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@74542 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * cppfiles.c (open_file): Tweak previous patch. Only do extra
bothner [Thu, 11 Dec 2003 00:12:40 +0000 (11 00:12 +0000)]
* cppfiles.c (open_file):  Tweak previous patch.  Only do extra
path lookup if file->data not set yet and not using global search dir.

* cppfiles.c: Fix 12-01 patch so we can re-compile same file.
(_cpp_pop_file_buffer):  Check buffer_valid flag to determine wether
to free the buffer and its fragments.
(_cpp_stack_file):  If we want to free the main file's buffer do
it here, by clearing buffer_valid.  But we probably don't.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@74516 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago Share buffer and fragments for files that have same path.
bothner [Wed, 10 Dec 2003 01:21:13 +0000 (10 01:21 +0000)]
Share buffer and fragments for files that have same path.
* cppfiles.c (struct _cpp_file_data):  New type.
(struct _cpp_file):  Move "buffer-related" fields to _cpp_file_data.
(open_file):  Look for path in file_hash.  If found, reuse its
_cpp_file_data.  Otherwise, if file found, enter path in file_hash.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@74484 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * emit-rtl.c: Partually revert yesterday's change - resetting
bothner [Wed, 10 Dec 2003 00:59:28 +0000 (10 00:59 +0000)]
* emit-rtl.c:  Partually revert yesterday's change - resetting
label_num causes problems if reload re-uses inline functions.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@74483 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * c-common.c (restore_fragment, cb_enter_fragment, cb_exit_fragment):
bothner [Tue, 9 Dec 2003 05:35:45 +0000 (9 05:35 +0000)]
* c-common.c (restore_fragment, cb_enter_fragment, cb_exit_fragment):
If C (!lang_hooks.uses_conditional_symtab), don't set/use asm_buf.

* c-common.c (gather_fragment_statistics):  Re-define as !quiet_flag.
(cb_enter_fragment):  Line number fix for warn_fragment_invalidation.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@74465 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago Reset some counters etc so compile-server output matches normal case.
bothner [Mon, 8 Dec 2003 20:27:15 +0000 (8 20:27 +0000)]
Reset some counters etc so compile-server output matches normal case.
* emit-rtl.c (init_emit_eachasm):  New function.
(label_num):  Initialization is now done in init_emit_eachasm.
* rtl.h  (init_emit_eachasm):  New declaration.
* toplev.c (backend_init):  Call init_emit_eachasm.
* varasm.c (init_varasm_once):  (Re-)init in_section here.
(in_section):  Remove initialization.
* config/darwin.c (darwin_file_end):  Reset current_pic_label_num.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@74431 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * c-incpath.c (add_path): Add final '/' if missing.
bothner [Mon, 8 Dec 2003 20:10:33 +0000 (8 20:10 +0000)]
* c-incpath.c (add_path):  Add final '/' if missing.
(add_dup_path):  New function - optimized xstrdup + add_path.
(add_env_var_paths):  Add final '/' after ".".
* c-incpath.h (add_dup_path):  New declaration.
* c-opts.c (c_common_handle_option):  Use add_dup_path.
(add_prefixed_path):  Add final '/' if missing.
* fix-header.c (read_scan_file):  Use add_dup_path.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@74430 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago Implement a cache for linemap_lookup.
bothner [Sun, 7 Dec 2003 00:15:54 +0000 (7 00:15 +0000)]
Implement a cache for linemap_lookup.
* line-map.h (struct_line_maps):  Add cache field.
* line-map.c (linemap_init):  Zero cache field.
(linemap_add):  Set cache field to offset of newly allocated map.
(linemap_lookup):  Use and set cache field.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@74374 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * cppfiles.c (file_hash_hash): New static function.
bothner [Fri, 5 Dec 2003 23:05:43 +0000 (5 23:05 +0000)]
* cppfiles.c (file_hash_hash):  New static function.
(hash_string_eq):  Renamed static function to file_hash_eq.
(_cpp_init_files):  Create file_hash table with above callbacks.
(cpp_included):  Must use htab_find_with_hash insead of htab_find.
(_cpp_find_find, make_cpp_dir):  Must use htab_find_slot_with_hash.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@74352 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * line-map.h (source_location): New typedef.
bothner [Fri, 5 Dec 2003 22:00:26 +0000 (5 22:00 +0000)]
* line-map.h (source_location):  New typedef.
(fileline):  Redefined as source_location.
(struct line_map, linemap_add, linemap_lookup):  Replace filefile
by source_location.
* line-map.c (linemap_add, linemap_lookup):  Use source_location.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@74347 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * c-common.h (nonempty_fragment_reused): New declaration.
bothner [Wed, 3 Dec 2003 06:30:17 +0000 (3 06:30 +0000)]
* c-common.h (nonempty_fragment_reused):  New declaration.
* c-common.c (nonempty_fragment_reused):  New variable.
(cb_enter_fragment):  Set it.
* c-objc-common.c (init_c_objc_common_eachsrc):  Clear it.
* c-parse.in (program):  Use it in checking for empty source file.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@74215 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * config/darwin-c.c: struct cpp_dir -> cpp_dir.
mrs [Wed, 3 Dec 2003 02:53:39 +0000 (3 02:53 +0000)]
* config/darwin-c.c: struct cpp_dir -> cpp_dir.

* c-lang.c: Add LANG_HOOKS_FINISH_SERVER.
* langhooks-def.h: Add LANG_HOOKS_FINISH_SERVER.
* langhooks.h (struct lang_hooks): Add finish_server.
* c-common.h (report_fragmemt_statistics): Add.

* cppfiles.c (delete_fragment): Add.
* cpplib.h (delete_fragment): Add.

* c-common.c (create_builtins_fragment): Free builtins_fragment.
(reset_hashnode): Handle resetting assertions.
(cb_enter_fragment): currently_nested < 0 means we are not nested as well.
(cb_exit_fragment): currently_nested < 0 means we are not nested as well.
(init_output_fragment): Don't need to clear output_fragment anymore.
(end_output_fragment): Clear output_fragment here instead.

* toplev.c (get_request_from_load_balancer): Default load balancer
for C++ to on and for C, to off.
(get_job): Exit gracfully if the load balnacer disappears.
(server_argv): constify.
(server_loop): constify argv.  Use a hook to print statistics so
that other non-C languages work better.

* opts.c (common_handle_option): Free asm_file_name, and allocate with xstrdup.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@74211 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * toplev.c (lang_dependent_init): Kludge to skip backend if only
bothner [Tue, 2 Dec 2003 18:05:10 +0000 (2 18:05 +0000)]
* toplev.c (lang_dependent_init):  Kludge to skip backend if only
pre-processing.  Needed for Mac OSX bootstrap, which otherwise
emits output from dbxout_init when processing an assembler file.
* Makefile.in (TEST_TARGET):  Leave out dwarfout.o, which doesn't
work on Mac OSX.  (vmsgdbout.o has same problem on GNU/Linux.)

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@74192 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * Makefile.in: New rules to help testing the compile-server by
bothner [Tue, 2 Dec 2003 07:51:08 +0000 (2 07:51 +0000)]
* Makefile.in:  New rules to help testing the compile-server by
using it to (re-)compile parts of gcc.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@74166 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * cppfiles.c (_cpp_pop_file_buffer): Free buffer if main file.
bothner [Tue, 2 Dec 2003 07:46:23 +0000 (2 07:46 +0000)]
* cppfiles.c (_cpp_pop_file_buffer):  Free buffer if main file.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@74165 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * dwarf2out.c (init_done): Move inside #ifdef DWARF2_DEBUGGING_INFO.
bothner [Tue, 2 Dec 2003 07:40:31 +0000 (2 07:40 +0000)]
* dwarf2out.c (init_done):  Move inside #ifdef DWARF2_DEBUGGING_INFO.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@74164 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * c-common.c (create_output_fragment): Do nothing unless C++, for now.
bothner [Tue, 2 Dec 2003 07:24:26 +0000 (2 07:24 +0000)]
* c-common.c (create_output_fragment):  Do nothing unless C++, for now.
(end_output_fragment):  Likewise.
(activate_output_fragment):  Likewise.
* toplev.c (finalize):  Zero asm_out_file.

* toplev.c (server_loop):  Call report_fragmemt_statistics (kludge).

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@74163 138bc75d-0d04-0410-961f-82ee72b054a4

18 years agoRestore a blank line, to match the trunk.
bothner [Mon, 1 Dec 2003 07:04:05 +0000 (1 07:04 +0000)]
Restore a blank line, to match the trunk.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@74091 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago Remember a tag type across compilation units.
bothner [Mon, 1 Dec 2003 06:52:59 +0000 (1 06:52 +0000)]
Remember a tag type across compilation units.
* c-decl.c (TYPE_IS_OLD_TAG):  New macro.
* c-decl.c (restore_fragment_bindings):  Chain new decl after old one.
When restoring a tag, reuse old tag type, and clear TYPE_IS_OLD_TAG.
(poplevel):  If popping a global tag, keep the IDNTEFIER_TAG_VALUE,
but hide it using TYPE_IS_OLD_TAG.
(lookup_tag, shadow_tag_warned, xref_tag, start_struct, start_enum,
finish_enum):  Handle TYPE_IS_OLD_TAG.

* c-decl.c (pushdecl, lookup_name, finish_enum):  Use new
track_declarations global.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@74090 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * gcc.c (reuse_server_sockets, server_socket): New globals.
bothner [Mon, 1 Dec 2003 06:22:17 +0000 (1 06:22 +0000)]
* gcc.c (reuse_server_sockets, server_socket):  New globals.
(excute, get_server_socket):  If reuse_server_sockets, do so.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@74089 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * cpplib.h (struct cpp_callbacks): Remove use of PARAMS macro.
bothner [Mon, 1 Dec 2003 06:08:15 +0000 (1 06:08 +0000)]
* cpplib.h (struct cpp_callbacks):  Remove use of PARAMS macro.
Drop last two parameters of enter_fragment call-back.
* cppfiles.c (_cpp_enter_fragment):  Likewise.
* c-common.h (cb_enter_fragment):  Likewise.
* c-common.h (track_dependencies, track_declarations):  New globals.
* c-common.c (track_dependencies, track_declarations):  New globals.
(create_builtins_fragment):  Set track_declarations.
(register_fragment_dependency):  Do nothing unless track_dependencies.
(cb_enter_fragment):  Calculate file name and line internally,
rather than being passed as parameters.
Set track_dependencies and track_declarations.
(cb_exit_fragment):  Clear track_dependencies and track_declarations.

* c-common.c (cb_enter_fragment):  Tweak inform messages.

* c-common.c (count_register_fragment_dependency_calls,
count_nonredundant_register_fragment_dependency_calls,
count_fragment_declarations, count_fragment_tags,
int count_new_fragments, count_new_empty_fragments,
lines_new_fragments, count_reread_fragments,
count_reread_empty_fragments, lines_reread_fragments,
count_reused_fragments, count_reused_empty_fragments,
lines_reused_fragments, current_fragment_is_new,
current_fragment_nested_at_start, current_fragment_nested_at_end):
New counters used for gathering statistics.
(note_fragment_binding_1, note_fragment_binding_3,
register_fragment_dependency, cb_enter_fragment, cb_exit_fragment):
Adjust counters.
(define gather_fragment_statistics):  Enable/disable statistics.
(report_fragment_statistics):  Print out statistics.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@74088 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * c-objc-common.c (init_c_objc_common_once): Move INIT_STATEMENT_CODES
bothner [Mon, 1 Dec 2003 03:55:27 +0000 (1 03:55 +0000)]
* c-objc-common.c (init_c_objc_common_once):  Move INIT_STATEMENT_CODES
to here from init_c_objc_common_eachsrc.

* c-objc-common.c (init_c_objc_common_eachsrc):  Move call to
c_decl_processing_eachsrc before cpp_do_macro_callbacks, since
before does reset_cpp_hashnodes and so would undo latter.

* c-opts.c (finish_options):  Move cpp_find_main_file call out to
c_common_post_options.
(c_common_post_options):  Call finish_options only if preprocess-only.
(init_c_common_eachsrc):  Call finish_options here instead.
This is because we want to process the command-line after
reset_cpp_hashnodes, not before.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@74085 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago More flexible fragment "chunking".
bothner [Mon, 24 Nov 2003 21:56:13 +0000 (24 21:56 +0000)]
More flexible fragment "chunking".
* cpplib.c (if_stack_length):  New function.
(_cpp_start_fragment):  Set or handle fragments cond_nesting field.
(_cpp_handle_directive):  Smarter fragment handling.  Don't create new
fragment if currently_skipping, nor for #ifdef etc if callback
avoid_new_fragment returns true.
* cpphash.h (struct cpp_fragment):  New field cond_nesting.
* cpplib.h (struct cpp_callbacks):  New avoid_new_fragment field.
* c-common.h (cb_avoid_new_fragment):  New declaration.
* c-common.c (cb_avoid_new_fragment):  New callback function.
* c-opts.c (init_c_common_once):  Set avoid_new_fragment callback.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@73900 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago Note whether fragment was empty so we can update mi_valid.
bothner [Mon, 24 Nov 2003 21:54:14 +0000 (24 21:54 +0000)]
Note whether fragment was empty so we can update mi_valid.
* cpphash.h (struct cpp_fragment):  New field empty.
* cppfiles.c (read_file_guts):  Mark head fragment as empty.
(_cpp_enter_fragment):  Clear mi_valid if reused fragment is non-empty
Otherwise, set empty from mi_valid.
(_cpp_exit_fragment):  Update empty and mi_valid fields.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@73899 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago Support compile-server dependency tracking for macros.
bothner [Mon, 24 Nov 2003 03:46:25 +0000 (24 03:46 +0000)]
Support compile-server dependency tracking for macros.
* c-opts.c (init_c_common_once):  Set uses_fragment callback.
* cpplib.h (struct cpp_callbacks):  New uses_fragment field.
* c-common.h (cb_uses_fragment):  New declaration.
* c-common.c (cb_uses_fragment):  New function.
* cpphash.h (struct cpp_macro):  New field defining_fragment.
* cppmacro.c (enter_macro_context):  Call uses_fragment callback.
(_cpp_create_definition):  Set defining_fragment field.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@73871 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago Support compile-server dependency tracking for macros.
bothner [Sun, 23 Nov 2003 21:58:53 +0000 (23 21:58 +0000)]
Support compile-server dependency tracking for macros.
* c-opts.c (init_c_common_once):  Set uses_fragment callback.
* cpplib.h (struct cpp_callbacks):  New uses_fragment field.
* c-common.h (cb_uses_fragment):  New declaration.
* c-common.c (cb_uses_fragment):  New function.
* cpphash.h (struct cpp_macro):  New field defining_fragment.
* cppmacro.c (enter_macro_context):  Call uses_fragment callback.
(_cpp_create_definition):  Set defining_fragment field.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@73861 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * c-format.c (init_dynamic_diag_info): An identifier may exist yet
bothner [Sun, 23 Nov 2003 20:29:18 +0000 (23 20:29 +0000)]
* c-format.c (init_dynamic_diag_info):  An identifier may exist yet
not have a global value, e.g. when the compiler sercer sees a new file.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@73859 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * c-opts.c (finish_options): Move cpp_find_main_file earlier, so
bothner [Fri, 7 Nov 2003 21:58:43 +0000 (7 21:58 +0000)]
* c-opts.c (finish_options):  Move cpp_find_main_file earlier, so
parse_in's main_file is set.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@73345 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * c-decl.c (duplicate_decls): Don't modify olddecl. Instead, merge
bothner [Fri, 7 Nov 2003 21:06:23 +0000 (7 21:06 +0000)]
* c-decl.c (duplicate_decls):  Don't modify olddecl.  Instead, merge
olddecl's info into newdecl.
(pushdecl):  Return (except for PARM_DECL) the new decl.
(c_write_global_declarations):  Skip old declaration.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@73344 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * c-decl.c (start_struct): Increment currently_nested.
bothner [Fri, 7 Nov 2003 20:36:49 +0000 (7 20:36 +0000)]
* c-decl.c (start_struct):  Increment currently_nested.
(finish_struct):  Decrement currently_nested.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@73343 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago (cb_exit_fragment):
bothner [Thu, 6 Nov 2003 06:01:41 +0000 (6 06:01 +0000)]
(cb_exit_fragment):
Use 'inform' instead of 'warning' on fragment reuse and invalidation.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@73294 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * c-common.c (create_builtins_fragment): Copy name.
bothner [Thu, 6 Nov 2003 05:37:39 +0000 (6 05:37 +0000)]
* c-common.c (create_builtins_fragment):  Copy name.

* c-common.c (register_fragment_dependency):  Don't register
dependency on builtins_c_fragment.

* c-common.c (cb_enter_fragment):  Set input_location.
Use 'inform' instead of 'warning' on fragment reuse and invalidation.
Remove some bogus messages, and improve text for others.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@73293 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * dwarf2out.c (init_done, frame_init_done): New statics.
bothner [Thu, 6 Nov 2003 01:30:59 +0000 (6 01:30 +0000)]
* dwarf2out.c (init_done, frame_init_done):  New statics.
(dwarf2out_frame_init, init_file_table, dwarf2out_init):  Reset
tables if called a second time for compile server.
(dwarf2out_finish):  Reset various static counters etc.
(NOTE_MODIFIED_TREE):  New macro.
(equate_type_number_to_die, gen_enumeration_type_die,
gen_struct_or_union_type_die, gen_typedef_die, gen_type_die):  Use it.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@73291 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * c-common.c (builtins_c_fragment): Mark for PCH.
mrs [Thu, 30 Oct 2003 02:46:50 +0000 (30 02:46 +0000)]
* c-common.c (builtins_c_fragment): Mark for PCH.
(output_c_fragment): Likewise.
(current_fragment_deps_end): Likewise.
(include_fragments): Add.
(restore_fragment): Add code to output remembered asm code
associated with the fragment.
(cb_enter_fragment): Use FRAGMENT_CHAIN instead of TREE_CHAIN.
Add code to remember the start of the asm code output.
(xfseek): Add.
(cb_exit_fragment): Add code to save off the asm code that was
output during fragment processing.
* c-common.h (FRAGMENT_CHAIN): Add.
(FRAGMENT_GLOBAL_CHAIN): Add.
(alloc_include_fragment):
* ggc-common.c (gt_pch_note_object): Allow the static types of
GTY(()) variables to not match, so that we can have
subclass/superclasses.
* tree.h (SET_DECL_FRAGMENT): No cast needed anymore, the types are
now correct.
* tree.h (tree_decl): Make defining_fragment be a c_include_fragment.
(c_include_fragment): Add asm_buf and asm_file_startpos.

cp/
* lang-specs.h: Use the server for PCH compiles.

* parser.c (cp_parser_translation_unit): Arrange for toplevel
decls to not be nested.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@73079 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * varasm.c (init_varasm_once): Reset const_labelno.
bothner [Wed, 29 Oct 2003 19:11:55 +0000 (29 19:11 +0000)]
* varasm.c (init_varasm_once):  Reset const_labelno.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@73057 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * function.c (init_function_once): Reset funcdef_no.
bothner [Wed, 29 Oct 2003 19:06:07 +0000 (29 19:06 +0000)]
* function.c (init_function_once):  Reset funcdef_no.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@73056 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * c-patch.in (maybe_identifier): New non-terminal.
bothner [Wed, 29 Oct 2003 19:02:40 +0000 (29 19:02 +0000)]
* c-patch.in (maybe_identifier):  New non-terminal.
(structsp_attr):  Use maybe_identifier to combine_case.  Not only
is this simpler, but it calls finish_struct before parsing body,
which is needed for compiler-server to adjust currently_nested.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@73055 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * cpphash.h (struct cpp_fragment): Fields start_line and end_line
bothner [Wed, 29 Oct 2003 18:45:22 +0000 (29 18:45 +0000)]
* cpphash.h (struct cpp_fragment):  Fields start_line and end_line
are fileline instances.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@73054 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * cppfiles.c, cpplib.c, cppmacro.c, cpppch.c, fix-header.c:
bothner [Sat, 18 Oct 2003 21:32:26 +0000 (18 21:32 +0000)]
* cppfiles.c, cpplib.c, cppmacro.c, cpppch.c, fix-header.c:
Update callers of cpp_push_buffer.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@72660 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * c-opts.c (c_common_post_options): Don't call cpp_find_main_file yet.
bothner [Sat, 18 Oct 2003 21:29:21 +0000 (18 21:29 +0000)]
* c-opts.c (c_common_post_options):  Don't call cpp_find_main_file yet.
(push_command_line_include):  When done with options, pass LC_LEAVE
instead of LC_RENAME to cpp_change_file and finally cpp_push_main_file.
(c_common_post_options):  Move finish_options call to here.
(finish_options):  Take file name parameter, as in mainline.
Don't do cpp cpp processing for "<built-in>" here.
(init_c_common_once):  Don't call finish_options here, but do inline
cpp processing for "<built-in>".
Don't register_cpp_callbacks if flag_preprocess_only.
(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.

* cpplex.c (_cpp_get_fresh_line):  Return value now just depends on
whether pfile->buffer is NULL after pop, ignoring return_at_eof.
* cpphash.h (struct cpp_buffer):  Remove unused return_at_eof field.
* cpplib.c (cpp_push_buffer):  Since we no longer set return_at_eof,
remove the unused return_at_eof parameter.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@72659 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * cppinit.c (cpp_read_main_file): Split into two functions:
bothner [Sat, 18 Oct 2003 21:28:10 +0000 (18 21:28 +0000)]
* cppinit.c (cpp_read_main_file):  Split into two functions:
Distribute _cpp_stack_file call over the two functions.
(cpp_find_main_file):  New function.
Don't call _cpp_do_file_change even if working_directory flag set.
(cpp_push_main_file):  New function.
* cppfiles.c (_cpp_find_failed):  New helper function.
(find_file):  Made non-static and renamed to _cpp_find_file.
(_cpp_stack_file):  No longer needed.  But note the following.
(stack_file):  Made non-static and renamed to _cpp_stack_file.
(search_path_head):  If there is no current buffer, use main_file.
* fix-header.c (cpp_read_main_file):  Replace cpp_read_main_file
call with calls to cpp_find_main_file and cpp_push_main_file.
* cpphash.h:  Update function declarations.
* cpplib.h:  Update function declarations.

* cppfiles.c, cpplib.c, cppmacro.c, cpppch.c, fix-header.c:
Update callers of cpp_push_buffer.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@72658 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * c-lex.c (src_line): Remove unneeded static variable.
bothner [Sat, 18 Oct 2003 21:26:00 +0000 (18 21:26 +0000)]
* c-lex.c (src_line):   Remove unneeded static variable.
(cb_line_change):  Set input_line directly, instead of src_line.
(get_non_padding_token):  We no longer need to compensate for the
"horrible things" the C++ front-end does with the current line number,

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@72657 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * c-ppoutput.c (cb_line_change): Revert 2003-08-04's change.
bothner [Sat, 18 Oct 2003 20:41:39 +0000 (18 20:41 +0000)]
* c-ppoutput.c (cb_line_change): Revert 2003-08-04's change.
* c-lex.c (cb_line_change): Skip line changing whenever
c-ppoutput.c would.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@72655 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * decl2.c (import_export_class): Never export/import vtables
mrs [Tue, 14 Oct 2003 21:06:43 +0000 (14 21:06 +0000)]
* decl2.c (import_export_class): Never export/import vtables
with inline key functions.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@72498 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * gcc.c (default_compilers): Don't include -server in name.
mrs [Tue, 7 Oct 2003 22:01:58 +0000 (7 22:01 +0000)]
* gcc.c (default_compilers): Don't include -server in name.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@72203 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * opts.c (add_input_filename): Allocate "-" using malloc, as later
mrs [Wed, 1 Oct 2003 01:24:06 +0000 (1 01:24 +0000)]
* opts.c (add_input_filename): Allocate "-" using malloc, as later
we free it.
* toplev.c (pop_fd): Fix reading from -, by ignore errors from
closing stdin again.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@71966 138bc75d-0d04-0410-961f-82ee72b054a4

18 years agoFix spelling.
mrs [Tue, 30 Sep 2003 22:39:31 +0000 (30 22:39 +0000)]
Fix spelling.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@71958 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * pex-unix.c (set_last_pipe_input, get_last_pipe_input): Add hooks
mrs [Tue, 30 Sep 2003 00:53:54 +0000 (30 00:53 +0000)]
* pex-unix.c (set_last_pipe_input, get_last_pipe_input): Add hooks
into piping internals.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@71934 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * libiberty.h (set_last_pipe_input): Add hooks into piping internals.
mrs [Tue, 30 Sep 2003 00:53:31 +0000 (30 00:53 +0000)]
* libiberty.h (set_last_pipe_input): Add hooks into piping internals.
(get_last_pipe_input): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@71933 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * toplev.c (server_loop): Add load balancing server front end.
mrs [Tue, 30 Sep 2003 00:49:22 +0000 (30 00:49 +0000)]
* toplev.c (server_loop): Add load balancing server front end.
(get_request_from_load_balancer): Add.
(get_job): Add.
(send_fd): Add.

* toplev.c (get_fd): Fix typo.

* objc/lang-specs.h: Don't include -server in name.

* toplev.c (server_loop): Add multiple CPU, multiple server support.

* gcc.c (get_server_socket): Get an ACK from the server on session start.
(delete_temp_files): Don't use global server_socket.

* toplev.c (server_loop): Listen for one client at a time.  Write
an ACK to the client on session bring up.  Used to delay pipeline
processing until the server commits to servicing us.

* gcc.c (get_server_socket): Arrange to close server socket on exec.

* tree.c (get_next_decl_uid): Add.
* tree.h (get_next_decl_uid): Add.

* toplev.c (do_compile): Add output fragment so that different
translation units can have different builtins.
(server_loop): Quit the server when we encouter errors.

* langhooks.h (struct lang_hooks): Add uses_conditional_symtab,
init_output_fragment, create_output_fragment,
end_output_fragment): Add.
* langhooks-def.h (LANG_HOOKS_USES_CONDITIONAL_SYMTAB): Add.
(LANG_HOOKS_INIT_OUTPUT_FRAGMENT): Add.
(LANG_HOOKS_CREATE_OUTPUT_FRAGMENT): Add.
(LANG_HOOKS_END_OUTPUT_FRAGMENT): Add.

* expr.c (expand_expr): Hack around hard error for now...

* dbxout.c (dbxout_init): Manage debugging information across
multiple translation units.  We use different files for each
translation unit.

* cppfiles.c (stack_file): Create fragments more often for C++, as
they are the only way to turn off definitions and macros.
(read_file_guts): Likewise.

* toplev.c (server_loop): Remove output from server channel, use a
single byte to indicate exit status.
* gcc.c: Add hadling for --kill-servercp.
(delete_temp_files): Likewise.
(pexecute_server_wait): Add.
(pexecute_server): Add.  Split out from execute and add support
for piping.
(execute): Add support for arbitrarily many servers, and add
support for piping by splitting out waiting from starting jobs.
(process_command): Remove disabling of -pipe when compile servers
are used, it now works.  Fix --kill-server and -kill-server so
that they work.
(write_switch_fds_request): Add support for piping.
(main): Allow --kill-server{,cp} to not have input files.

* config/darwin.h (FIXPROTO_IGNORE_LIST): Add.

* c-objc-common.c (init_c_objc_common_once): Remove redundant
setting of do_note_macros.

* c-common.c (c_tree_size): Add.
(dont_defeat_good_checking): Add.
(cb_enter_fragment): Don't alter timestamp of a reused fragment,
as decls in the symbol table of a conditional symbol table
language still refer to the old fragment, and need to not have
their timestamp changed.  Chain together fragments for the same
cpp_fragment so that we can reuse them later.  Add more verbose
debugging output.  Temporarily reuse fragments rather than
reparsing them.
(output_c_fragment): Add.
(output_fragment): Add.
(create_output_fragment): Add.
(end_output_fragment): Add.
(init_output_fragment): Add.
(activate_output_fragment): Add.
(c_print_decl): Add.
* c-common.h (c_tree_size): Add.
(DECL_FRAGMENTT): Add.
(init_output_fragment): Add.
(create_output_fragment): Add.
(end_output_fragment): Add.
(activate_output_fragment): Add.
(c_print_decl): Add.
* c-lang.c (LANG_HOOKS_TREE_SIZE): Add.
(LANG_HOOKS_PRINT_DECL): Add.
(LANG_HOOKS_INIT_OUTPUT_FRAGMENT): Add.
(LANG_HOOKS_CREATE_OUTPUT_FRAGMENT): Add.
(LANG_HOOKS_END_OUTPUT_FRAGMENT): Add.

* c-common.h (SET_DECL_FRAGMENT): To ensure we always set the
defining fragment for created decls, move ...
* tree.h (SET_DECL_FRAGMENT): ... to here.
* tree.c (build_decl): Set the fragment for conditional symbol
table languages.

Allow for improved garbage collection of include_fragments.

* tree.c (tree_node_structure): Handle INCLUDE_FRAGMENTs.
* c-common.c (current_c_fragment): Move ...
* tree.c (current_c_fragment): ... to here.
* c-common.c (alloc_include_fragment): Move ...
* c-common.h (current_c_fragment): ... to here.
* c-common.def (INCLUDE_FRAGMENT): Move ...
* tree.def (INCLUDE_FRAGMENT): ... to here.
* c-common.h (struct c_include_fragment): Move ...
* tree.h (struct c_include_fragment): ... to here.
(enum tree_node_structure): Add TS_FRAGMENT.
(union tree_node): Add fragment.

* toplev.c (server_loop): Use stderr instead of the socket for output.
* gcc.c (execute): If the compile server fails to write out a
return code, set rcode to 1 so that the compile will fail.  Remove
extra code to handle output, as now we write to the output
directly.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@71932 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * call.c (add_function_candidate): Don't let functions from inactive fragments
mrs [Tue, 30 Sep 2003 00:46:52 +0000 (30 00:46 +0000)]
* call.c (add_function_candidate): Don't let functions from inactive fragments
be included.

* semantics.c (is_type_again): Add.
(begin_class_definition): Give a better error message for now when
a type is defined twice from the same source file, in a header
that lacks inclusion guards.

* ptree.c (cxx_print_decl): Delegate to c_print_decl for extra
stuff like fragments..

* decl2.c (finish_file): Clear out ssdf_decl as well for another
translation unit.
(find_using_fragment): Add.
(direct_using_p): Add.
(lookup_using_namespace_one): Add.
(ambiguous_decl): Handle multiple translation units better.
(add_using_namespace): Handle using for multiple translation units.
(lookup_using_namespace): Likewise.
(qualified_lookup_using_namespace): Likewise.
* decl.c (cxx_post_options): Add.
(duplicate_decls): Handle multiple translation units better.
(pushdecl): Likewise.
(lookup_tag): Likewise.
(unqualified_namespace_lookup): Handle using for conditional
fragments.
(init_cxx_decl_processing_eachsrc): Move main_timestamp setting
earlier, to cxx_post_options.
(setup_globals): Don't need to do anything anymore.
(init_cxx_decl_processing_eachsrc): Likewise.
(restore_fragment_bindings): Likewise.
(c_init_decl_done): Remove.
* cp-tree.h (AS_FRAGMENT): Add.
(NS_ITER_TO_SCOPE): Add.
(NS_ITER_TO_FRAGMENT): Add.
(fragment_active): Add.
(decl_active): Add.
(in_other_unit): Add.
(lookup_using_namespace_one): Add.
(cxx_post_options): Add.
* cp-lang.c (LANG_HOOKS_USES_CONDITIONAL_SYMTAB): Add.
(LANG_HOOKS_INIT_OUTPUT_FRAGMENT): Add.
(LANG_HOOKS_CREATE_OUTPUT_FRAGMENT): Add.
(LANG_HOOKS_END_OUTPUT_FRAGMENT): Add.
(LANG_HOOKS_POST_OPTIONS): Redirect to our own cxx_post_options.
(cp_tree_size): Delegate to C for sizes of unknown things.
* call.c (rejoust): Add.
(tourney): Hack to prefer later overloads.
* lang-specs.h: Don't include -server in name.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@71931 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * dbxout.c (dbxout_typedefs): Output typedefs in forward order.
bothner [Fri, 26 Sep 2003 20:02:03 +0000 (26 20:02 +0000)]
* dbxout.c (dbxout_typedefs):  Output typedefs in forward order.
No longer any need to reverse by recursion.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@71830 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * pex-unix.c (set_last_pipe_input, get_last_pipe_input): Add hooks
mrs [Wed, 24 Sep 2003 01:05:52 +0000 (24 01:05 +0000)]
    * pex-unix.c (set_last_pipe_input, get_last_pipe_input): Add hooks
        into piping internals.

        * libiberty.h (set_last_pipe_input): Add hooks into piping internals.
        (get_last_pipe_input): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@71708 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * c-ppoutput.c (print): Use fileline typedef for field 'line'.
bothner [Fri, 19 Sep 2003 00:50:02 +0000 (19 00:50 +0000)]
* c-ppoutput.c (print):  Use fileline typedef for field 'line'.
(print_line, maybe_print_line, cb_define, cb_undef, cb_include,
cb_ident, cb_def_pragma):  Use fileline typedef.
* cpphash.h (struct cpp_reader):  Likewise for field out.first_line.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@71555 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * dwarf2asm.c (dw2_output_indirect_constants): Reinitialize
mrs [Mon, 15 Sep 2003 22:34:53 +0000 (15 22:34 +0000)]
* dwarf2asm.c (dw2_output_indirect_constants): Reinitialize
indirect_pool for new output file.
* dwarf2out.c (dwarf2out_frame_finish): Reinitialize cie_cfi_head for
new output file.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@71410 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * c-common.c (warn_fragment_invalidation): New "flag" - for
bothner [Mon, 15 Sep 2003 22:14:15 +0000 (15 22:14 +0000)]
* c-common.c (warn_fragment_invalidation):  New "flag" - for
now just a macro for !quiet_flag.
(cb_enter_fragment, cb_exit_fragmnet):  Be more specific when
warning about invalidating a fragment.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@71409 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * pretty-print.c (pp_construct): Use xcalloc instead of xmalloc
bothner [Mon, 15 Sep 2003 22:05:36 +0000 (15 22:05 +0000)]
* pretty-print.c (pp_construct): Use xcalloc instead of xmalloc
when allocating pp->buffer.
Plus left-over older ChangeLog entries.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@71408 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * c-decl.c (restore_fragment_bindings): List of tags needs tree_cons.
bothner [Fri, 12 Sep 2003 22:19:55 +0000 (12 22:19 +0000)]
* c-decl.c (restore_fragment_bindings):  List of tags needs tree_cons.

* c-decl.c (start_function): Increment currently_nested.
(finish_function):  Decrement currently_nested.

* c-common.c (c-common.c):  Try to make clearer, and add two comments.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@71342 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * cpplib.c (_cpp_pop_buffer): Do generate a call-back for
bothner [Fri, 12 Sep 2003 22:19:26 +0000 (12 22:19 +0000)]
* cpplib.c (_cpp_pop_buffer):  Do generate a call-back for
leaving main file.
* c-ppoutput.c (pp_file_change):  Check for map==NULL, for LC_LEAVE.
* fix-header.c (cb_file_change):  Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@71341 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * toplev.c (do_compile): Remove unwanted push_srcloc/pop_srcloc.
bothner [Fri, 12 Sep 2003 22:18:53 +0000 (12 22:18 +0000)]
* toplev.c (do_compile):  Remove unwanted push_srcloc/pop_srcloc.

* opts.c (common_handle_option):  Remove bogus cast.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@71340 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * config/darwin.c (machopic_finish): Zero out machopic_stubs and
bothner [Fri, 12 Sep 2003 21:10:53 +0000 (12 21:10 +0000)]
* config/darwin.c (machopic_finish):  Zero out machopic_stubs and
machopic_non_lazy_pointers when done.  Needed for compile-server.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@71338 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * c-lex.c (fe_file_change): Don't transform to_line with SOURCE_LINE.
bothner [Fri, 12 Sep 2003 05:06:54 +0000 (12 05:06 +0000)]
* c-lex.c (fe_file_change): Don't transform to_line with SOURCE_LINE.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@71329 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * common.opt (fserver): Make it JoinedOrMissing.
mrs [Tue, 9 Sep 2003 21:28:10 +0000 (9 21:28 +0000)]
* common.opt (fserver): Make it JoinedOrMissing.
* flags.h (compiler_server): Update doc.
* opts.c (common_handle_option, case OPT_fserver): Handle selection
of different modes, default to mode 2.
* toplev.c (server_mode): Update doc.
(server_loop): Allow accept to EINTR to allow debugging, always remove
old server socket when starting up server to aid debugging.
(lang_dependent_init): Always set dump_base_name.
(finalize): Flush output to the asm file and ensure that it is written.
(push_to_fd, pop_fd): Add more error checking.
(xdup, xdup2, xclose): Add.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@71248 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * gcc.c (process_command): Don't use -pipe with compiler server
mrs [Tue, 9 Sep 2003 18:51:23 +0000 (9 18:51 +0000)]
* gcc.c (process_command): Don't use -pipe with compiler server
yet, it won't work.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@71241 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * gcc.c (execute): Improve -o handling, in C++ land it doesn't
mrs [Fri, 5 Sep 2003 23:51:42 +0000 (5 23:51 +0000)]
* gcc.c (execute): Improve -o handling, in C++ land it doesn't
always come last, asm_name defaults to "-" instead of "".

* gcc.c (process_command): Don't use -pipe with compiler server
yet, it won't work.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@71122 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago2003-08-29 Mike Stump <mrs@apple.com>
mrs [Sat, 30 Aug 2003 06:01:01 +0000 (30 06:01 +0000)]
2003-08-29  Mike Stump  <mrs@apple.com>

* Makefile.in (opts.o): Add missing dependency on langhooks.h.
(explow.o): Likewise.

2003-08-29  Mike Stump  <mrs@apple.com>

* config/darwin.h (CC1PLUS_SPEC): Add support for __private_extern__.

2003-08-29  Mike Stump  <mrs@apple.com>

* c.opt: Add -fpascal-strings -arch -header-mapfile -Wmost and
-Wno-four-char-constants to enable easier testing.  We'll probably
remove these before merging the compile server back.
* c-opts.c (c_common_handle_option): Add handling for OPT_arch,
OPT_header_mapfile OPT_fpascal-strings OPT_Wmost and
OPT_Wfour_char_constants..

2003-08-29  Mike Stump  <mrs@apple.com>

* c-opts.c (cb_file_change): Move push_command_line_include
processing from here...
(c_common_post_options): to here to fix -include.  Reset
input_line here so we don't leak line numbes from the -include
headers from the command line.
(init_c_common_once): Move pch_init from here...
* toplev.c (lang_dependent_init): to here, as a hook.
(do_compile): Don't need to reset input_filename anymore, instead,
push_srcloc to set it.
(lang_dependent_init): Set dump_base_name, even if there are
no input files.
* c-lang.c (LANG_HOOKS_INIT_PCH): Add.
* cp/cp-lang.c (LANG_HOOKS_INIT_PCH): Add.
* langhooks-def.h (LANG_HOOKS_INIT_PCH): Add.
(LANG_HOOKS_INITIALIZER): Add LANG_HOOKS_INIT_PCH.
* langhooks.h (struct land_hooks): Add pch_init.
* objc/objc-lang.c (LANG_HOOKS_INIT_PCH): Add.

2003-08-29  Mike Stump  <mrs@apple.com>

* Added http://gcc.gnu.org/ml/gcc/2003-08/msg01145.html to unstick
pch.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@70945 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago Add framework support for darwin.
mrs [Fri, 29 Aug 2003 19:55:03 +0000 (29 19:55 +0000)]
Add framework support for darwin.

* c-incpath.c (add_path): Use a consistent style for cpp_dir.
          Initialize p->construct to 0.
(add_system_path, add_bracket_path): New.
(register_include_chains): Add use of extra_includes callback.
* c-incpath.h (add_system_path, add_bracket_path): New.
* c-opts.c (c_common_missing_argument,
          c_common_handle_option): Add -F argument processing.
  (c_common_init_options): Use TARGET_C_INIT.
* c.opt: Add -F argument processing.
* gcc.c (trad_capable_cpp): Add -F argument processing.
* cppfiles.c (find_file_in_dir): Update to use construct callback.
(search_path_exhausted, cpp_get_path, cpp_get_buffer,
cpp_get_prev): New.
(find_file): Use search_path_exhausted.
(make_cpp_dir): Initialize construct to 0.
* cpplib.h (missing_header_cb, missing_header, construct,
  cpp_get_path, cpp_get_buffer, cpp_get_file, cpp_get_prev): New.
* target-def.h: (TARGET_EXTRA_INCLUDES, TARGET_OPTF): New.
(TARGET_INITIALIZER): Add TARGET_EXTRA_INCLUDES and TARGET_OPTF.
* target.h (struct gcc_target): Add extra_includes and opt_f_processing.
* hooks.c (hook_void_int, hook_void_charptr): Add.
* hooks.h (hook_void_int, hook_void_charptr): Add.
* Makefile.in (c-incpath.o) : Add $(TARGET_H) and
          $(MACHMODE_H) dependencies.
  (c-opts.o): Likewise.
  (ifcvt.o): Use $(TARGET_H) instead of target.h.
* fix-header: Include target.h and target-def.h and define targetm.

* config/darwin-c.c (using_frameworks, find_subframework_file,
          find_subframework_header, add_system_framework_path,
          frameworks_in_use, num_frameworks, max_frameworks,
          add_framework, find_framework, struct framework_header,
          framework_header_dirs, framework_construct_pathname,
          find_subframework_file, add_system_framework_path,
          add_framework_path_real, framework_defaults,
          darwin_register_frameworks_real, find_subframework_header,
          darwin_init): Add.
* config/darwin.c (darwin_register_frameworks_cb,
          darwin_register_frameworks, add_framework_path_cb,
          add_framework_path): Add.
* config/darwin.h (TARGET_EXTRA_INCLUDES, TARGET_F_OPT,
          TARGET_C_INIT): New.
  (TARGET_OPTION_TRANSLATE_TABLE): Add -framework support.
  (CPP_SPEC): Add __APPLE_CC__ support.
* t-darwin (darwin-c.o): Add c-incpath.h dependency.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@70921 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * cpplib.c (_cpp_restore_macro): Rename to cpp_restore_macros,
bothner [Fri, 29 Aug 2003 04:15:34 +0000 (29 04:15 +0000)]
* cpplib.c (_cpp_restore_macro):  Rename to cpp_restore_macros,
and change parameter list to take a cpp_fragment*.
Don't define and undef callbacks here.
(cpp_do_macro_callbacks):  New function to do above callbacks.
* cpplib.h:  Update accordingly.
* c-common.c (restore_fragment):  Update to call cpp_restore_macros
and also call cpp_do_macro_callbacks.
(reset_cpp_hashnodes):  Don't use restore_macros, so we don't do
cpp_do_macro_callbacks here.
* c-objc-common.c (init_c_objc_common_once):  If -g3 was specified
call create_builtins_fragment even not in server mode.
(init_c_objc_common_eachsrc):  Call cpp_do_macro_callbacks here.
* c-opts.c (finish_options):  Set the file_change callback here
rather than in c_common_post_options, but not if flag_preprocess_only,
so that the map field in c-lex.c can get set in time.
(c_common_post_options):  Even if flag_preprocess_only don't call
finish_options since init_c_common_once now calls it unconditionally.
(cb_file_change):  Don't segfault if new_map is NULL.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@70903 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * cpperror.c (print_location): Don't check for !pfile->buffer. That
bothner [Thu, 28 Aug 2003 00:28:30 +0000 (28 00:28 +0000)]
* cpperror.c (print_location):  Don't check for !pfile->buffer.  That
test fails following my 08-21 change, and it seems unnecessary anyway.
(cpp_error):  Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@70876 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * lex.c (init_cxx_once): Move pop_srcloc to here...
mrs [Fri, 22 Aug 2003 00:02:40 +0000 (22 00:02 +0000)]
* lex.c (init_cxx_once): Move pop_srcloc to here...
(init_cxx_eachsrc): from here.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@70669 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * c-opts.c (init_c_common_once): Do finish_options now,
bothner [Thu, 21 Aug 2003 19:41:44 +0000 (21 19:41 +0000)]
* c-opts.c (init_c_common_once):  Do finish_options now,
regardless of server_mode.
(c_common_parse_file):  Never do finish_options now.

* c-opts.c (push_command_line_include):  Don't do cpp_change_file.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@70665 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * c-decl.c (setup_globals): Don't clear input_filename.
bothner [Thu, 21 Aug 2003 19:33:24 +0000 (21 19:33 +0000)]
* c-decl.c (setup_globals):  Don't clear input_filename.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@70664 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * c-lang.c (c_write_globals): Remove function.
bothner [Thu, 21 Aug 2003 19:32:33 +0000 (21 19:32 +0000)]
* c-lang.c (c_write_globals):  Remove function.
(LANG_HOOKS_WRITE_GLOBALS):  Set to c_objc_common_finish_file instead.
* objc/objc-lang.c (LANG_HOOKS_WRITE_GLOBALS):  Likewise.
* c-objc-common.c (c_objc_common_finish_file):  Also call
c_write_global_declarations here instead of removed c_write_globals.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@70663 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * toplev.c (lang_dependent_init): Remove parameter.
bothner [Thu, 21 Aug 2003 19:31:09 +0000 (21 19:31 +0000)]
* toplev.c (lang_dependent_init):  Remove parameter.
Don't call lang_hooks.init_eachsrc here.
Default dump_base_name to in_fnames[0].
Set main_input_filename and input_filename from dump_base_name.
Use maininput_filename for init_asm_output and debug_hooks->init.
(do_compile):  Call init_eachsrc even for first iterations.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@70662 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * cpplex.c (_cpp_clean_line): Add extra '\n' into buffer,
bothner [Thu, 21 Aug 2003 19:22:59 +0000 (21 19:22 +0000)]
* cpplex.c (_cpp_clean_line):  Add extra '\n' into buffer,
in case it is re-used.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@70660 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * cpplib.h (struct cpp_token): Change type of field line to fileline.
bothner [Thu, 21 Aug 2003 17:50:00 +0000 (21 17:50 +0000)]
* cpplib.h (struct cpp_token):  Change type of field line to fileline.
(cpp_error_with_line):  Use fileline for appropriate parameter.
* cpphash.h (struct cpp_macro):  Change type of field line to fileline.
(struct cpp_reader):  Likewise for fields line and directive_line.
(_cpp_begin_message):  Use fileline for appropriate parameter.
* cpperror.c (print_location, _cpp_begin_message, cpp_error_with_line,
cpp_error):  Use fileline for appropriate parameters and variables.
(print_location):  New local lin, since it is not a fileline.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@70654 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * cp-lang.c (LANG_HOOKS_INIT_ONCE): New book definition.
bothner [Sun, 17 Aug 2003 17:24:27 +0000 (17 17:24 +0000)]
* cp-lang.c (LANG_HOOKS_INIT_ONCE):  New book definition.
(LANG_HOOKS_INIT):  Update.
(LANG_HOOKS_WRITE_GLOBALS):  Now calls finish_file.
* class.c (finish_struct_1):  Maybe call note_fragment_binding_3.
* decl.c (pushtag, pushdecl):  Maybe call note_fragment_binding_1.
(finih_enum):  Maybe call note_fragment_binding_3.
(push_overloaded_decl):  Maybe call note_fragment_binding_2.
(c_init_decl_done):  New variable.
(cxx_init_decl_processing):  Split into init_cxx_decl_processing_once
and init_cxx_decl_processing_eachsrc.
(xref_tag, start_enum):  Call note_tag.
(restore_fragment_bindings):  New function.
* decl2.c (finish_file):  Reset ssdf_decls and priority_info_map.
* lang-specs.h:  Add --server support.
* lex.c (cxx_init):  Split into new functions init_cxx_once and
init_cxx_eachsrc.
(lang_clear_identifier):  New function.
* parser.c (cp_parser_declaration_seq_opt):  Increment and decrement
currently_nested while parsing a single declaration.
(cp_parser_linkage_specification):  Counteract the above,
* cp-tree.h:  Update declarations.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@70518 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * c-common.c (restore_fragment): New function.
bothner [Sun, 17 Aug 2003 16:40:13 +0000 (17 16:40 +0000)]
* c-common.c (restore_fragment):  New function.
(reset_cpp_hashnodes, cb_enter_fragment):  use it.
* c-common.h (restore_fragment):  New declaration.
* c-decl.c (init_c_decl_processing_eachsrc):  Remove call to
restore_fragment_bindings as it is handled by reset_cpp_hashnodes.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@70517 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * objc/objc-act.c (init_objc): Inline into objc_init.
bothner [Sat, 16 Aug 2003 06:34:07 +0000 (16 06:34 +0000)]
* objc/objc-act.c (init_objc):  Inline into objc_init.
(objc_init):  Renamed to init_objc_eachsrc.
* objc/objc-lang.c (LANG_HOOKS_INIT):  Update accordingly.
* objc/objc-act.h:  Update prototype.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@70503 138bc75d-0d04-0410-961f-82ee72b054a4

18 years agoMerge failure: Need to init have_c and have_o in process_command.
bothner [Sat, 16 Aug 2003 03:35:27 +0000 (16 03:35 +0000)]
Merge failure:  Need to init have_c and have_o in process_command.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@70502 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * objc/lang-specs.h: Handle -server flag.
bothner [Sat, 16 Aug 2003 01:31:15 +0000 (16 01:31 +0000)]
* objc/lang-specs.h: Handle -server flag.
* objc/objc-lang.c (LANG_HOOKS_INIT_ONCE):  New definition.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@70501 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * toplev.c (server_argv, server_argc): New static variables.
bothner [Sat, 16 Aug 2003 00:49:01 +0000 (16 00:49 +0000)]
* toplev.c (server_argv, server_argc):  New static variables.
(server_loop):  Save options from 'F' command in server_argv
and server_argc, after comparing with previously saved options.

* gcc.c (write_switch_fds_request):  Use 'D' rather 'F' as command.
* toplev.c (server_loop):  Fix conflicting use of 'F' command.

* gcc.c (default_compilers):  Don't pass -fserver to @.cc1-server.
(execute):  Pass command options to server as 'F' command.
* toplev.c (server_get_command):  Recognize and ignore 'F' command.

* gcc.c:  Add stdin/stderr/stdout redirection, fixes -pipe.
(send_fd, write_switch_fds_request):  New function.
* toplev.c:  Add stdin/stderr/stdout redirection, fixes -pipe.
(get_fd, push_to_fd, pop_fd):  New functions.
* toplev.c:  Add umask support for server.

* gcc.c (ENABLE_SERVER):  New macro.
(struct infile, infile, n_infiles, input_file_compiler):  Move earlier.
(use_server, kill_server, server_socket_name, server_socket):
New variables.
(cpp_unique_options, cc1_options, default_compilers):  Handle --server.
(option_map):  New entries for --server and --kill-server.
(delete_temp_fie):  Handle (poorly) kill_server.
(execute):  If --server, pass command to server.
(process_command):  Handle -server and --kill-server.
(get_server_socket, write_input_request, write_output_request,
write_input_requests): New functions.
* toplev.c (ENABLE_SERVER):  New macros.
(server_mode, server_timeout):  New variable.
(f_options):  Add server_mode.
* toplev.c (server_get_command, server_loop):  New functions.
(compile_file):  Split into compile_file_parse and compile_file_finish.
  (process_options):  Move stuff to do_compile and lang_dependent_init.
(do_compile):  Move backend_init call to lang_dependent_init.
(finalize):  Re-set first_global_object_name and
weak_global_object_name.
(do_compile):  Loop over in_fnames.
(toplev_main):  Call server_loop if requested.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@70500 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * c-decl.c (first_builtin_decl, last_builtin_decl): Removed fields.
bothner [Fri, 15 Aug 2003 23:37:54 +0000 (15 23:37 +0000)]
* c-decl.c (first_builtin_decl,  last_builtin_decl):  Removed fields.
Susbumed by builtins_fragment.
(restore_fragment_bindings, lang_clear_identifier, setup_globals):
New functions.
(c_init_decl_processing):  Split into new functions
init_c_decl_processing_once and init_c_decl_processing_eachsrc.
(pushdecl, finish_struct, finish_enum):  Assocate binding with
current fragment.
(shadow_tag_warned, xref_tag, start_struct, start_enum):
Likewise, using note_tag.
(start_enum, finish_enum):  Increment/decrement currently_nested.
(lookup_name):  Register dependency.
(c_reset_state):  Remove.
* c-objc-common.c (c_objc_common_init):  Split into new functions
init_c_objc_common_once and init_c_objc_common_eachsrc.
* tree.h (struct tree_decl):  New field defining_fragment.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@70495 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * c-common.def (INCLUDE_FRAGMENT): New tree code.
bothner [Fri, 15 Aug 2003 23:11:16 +0000 (15 23:11 +0000)]
* c-common.def (INCLUDE_FRAGMENT):  New tree code.

* opts.c (add_input_filename):  Canonicalize input file name "-" to "".

* opts.c (common_handle_option):  Handle OPT_fserver.
* common.opt (fserver):  New flag.
* flags.h (server_mode):  New declaration.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@70494 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * c-lang.c (finish_file): Remove. Combine with ...
bothner [Fri, 15 Aug 2003 21:47:04 +0000 (15 21:47 +0000)]
* c-lang.c (finish_file):  Remove.  Combine with ...
(c_write_globals):  New function.
(LANG_HOOKS_WRITE_GLOBALS):  New macro, defined as c_write_globals.
(LANG_HOOKS_INIT_ONCE):  New definition, as init_c_objc_common_once.
(LANG_HOOKS_INIT):  Update to renamed init_c_objc_common_eachsrc.
* c-tree.h:  Add new or rename function declarations.
* c-opts.c (this_input_filename): Remove variable.
(c_common_post_options):  Don't canonicalie input filename here.
Move some stuff to init_c_common_once.
If only preprocessing, do it now (kludge).
(init_c_common_once):  New function.
(c_common_init):  Renamed to init_c_common_eachsrc.
(c_common_parse_file):  Now parses just a single module,
rather than loop over modules.
(finish_options):   Takes no parameters.  Move calls.
Now called before cpp_read_main_file, so first cpp_child_file is
LC_ENTER rather than LC_RENAME.  Also do an LC_LEAVE.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@70492 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago<
bothner [Fri, 15 Aug 2003 18:25:37 +0000 (15 18:25 +0000)]
<
* c-common.c (current_fragment_deps_stack, current_fragment_deps_end,
current_c_fragment, builtins_fragment, builtins_c_fragment,
undo_buffer, undo_buffer_trees, fragment_bindings_stack,
fragment_bindings_end, main_timestamp, c_timestamp, currently_nested)
New global variables.
(create_builtins_fragment, register_decl_dependency, push_undo_raw,
push_undo_tree_raw, push_tree_field_undo, process_undo_buffer,
alloc_include_fragment, reset_hashnode, reset_cpp_hashnodes,
cb_enter_fragment, save_fragment_bindings, cb_exit_fragment.
note_tag, register_fragment_dependency. note_fragment_binding_1,
note_fragment_binding_2, note_fragment_binding_3):  New functions.
* c-common.h (struct c_include_fragment):  New type.
(DECL_FRAGMENT, SET_DECL_FRAGMENT, C_FRAGMENT): New macros.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@70488 138bc75d-0d04-0410-961f-82ee72b054a4

18 years ago * cpphash.h (struct cpp_fragment): New type.
bothner [Fri, 15 Aug 2003 01:47:41 +0000 (15 01:47 +0000)]
* cpphash.h (struct cpp_fragment):  New type.
(struct cpp_buffer) <saved_current_fragment>:  New field.
(struct cpp_reader) <current_fragment, do_note_macros, macro_notes,
macro_notes_alloc_length, macro_notes_count>:  New fields.
* cpplib.c (cpp_fragment):  New typedef.
(struct cpp_callbacks) <enter_fragment, exit_fragment>:  New callbacks.
(_cpp_start_fragment, _cpp_enter_fragment, _cpp_exit_fragment.
_cpp_note_macro, _cpp_restore_macros):  New functions.
(struct cpp_macro_note):  New type.
* cpplex.c (_cpp_clean_line):  Kludge to support compile server.
* cpplib.c (_cpp_start_fragment, _cpp_restore_macros,
_cpp_note_macro):  New functions.
(_cpp_handle_directive):  Maybe call _cpp_exit_fragment and
_cpp_start_fragment.
(do_define, do_undef):  Call _cpp_note_macro.
(cpp_push_buffer):  Save current_fragment, and then set to NULL.
(_cpp_pop_buffer):  Call _cpp_exit_fragment.  Restore current_fragment.
Call _cpp_start_fragment.
* cppfiles.c (struct _cpp_file) <fragments>:  New field.
(read_file_gits):  Delete buffer here.
Purge fragments, and then create a new initial fragment.
(_cpp_enter_fragment, _cpp_exit_fragment, purge_fragments):
New functions.
(stack_file):  Don't clear valid bit.
Initialize cpp_reader's current_fragment.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/compile-server-branch@70461 138bc75d-0d04-0410-961f-82ee72b054a4