This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[cs] patch to not create "output fragment" for C
- From: Per Bothner <per at bothner dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 01 Dec 2003 23:32:24 -0800
- Subject: [cs] patch to not create "output fragment" for C
I checked the attached patch into the compile-server branch.
This disables for C some stuff that Mike put in for C++ support,
but is (at least for now) undesirable for C.
--
--Per Bothner
per@bothner.com http://per.bothner.com/
2003-12-01 Per Bothner <pbothner@apple.com>
* 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).
Index: c-common.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-common.c,v
retrieving revision 1.438.2.13
diff -u -p -r1.438.2.13 c-common.c
--- c-common.c 1 Dec 2003 06:08:14 -0000 1.438.2.13
+++ c-common.c 2 Dec 2003 07:12:18 -0000
@@ -4842,6 +4842,9 @@ create_output_fragment (void)
{
struct c_include_fragment* st;
cpp_fragment *fragment;
+ if (!lang_hooks.uses_conditional_symtab)
+ return;
+ /* FIXME check server_mode! */
fragment = xcalloc (1, sizeof (cpp_fragment));
fragment->name = "<built-in>";
parse_in->current_fragment = fragment;
@@ -4860,6 +4863,8 @@ create_output_fragment (void)
void
end_output_fragment (void)
{
+ if (!lang_hooks.uses_conditional_symtab)
+ return;
/* Fold these into cb_exit_fragment as well?! */
if (C_FRAGMENT (output_fragment) != current_c_fragment)
abort ();
@@ -4882,7 +4887,8 @@ void init_output_fragment ()
void
activate_output_fragment (void)
{
- output_c_fragment->include_timestamp = main_timestamp;
+ if (output_c_fragment != NULL)
+ output_c_fragment->include_timestamp = main_timestamp;
}
/* Handle extra debugging of C tree nodes. */
Index: toplev.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/toplev.c,v
retrieving revision 1.813.2.10
diff -u -p -r1.813.2.10 toplev.c
--- toplev.c 1 Oct 2003 01:24:06 -0000 1.813.2.10
+++ toplev.c 2 Dec 2003 07:12:19 -0000
@@ -4366,9 +4366,12 @@ finalize (void)
fflush (asm_out_file);
if (ferror (asm_out_file) != 0)
fatal_error ("error writing to %s: %m", asm_file_name);
- if (asm_out_file != stdout
- && fclose (asm_out_file) != 0)
- fatal_error ("error closing %s: %m", asm_file_name);
+ if (asm_out_file != stdout)
+ {
+ if (fclose (asm_out_file) != 0)
+ fatal_error ("error closing %s: %m", asm_file_name);
+ asm_out_file = NULL;
+ }
}
/* Do whatever is necessary to finish printing the graphs. */
@@ -4785,7 +4788,7 @@ get_request_from_load_balancer (int *soc
static int idle_servers[SERVER_MAX];
static int nservers = 0;
/* For debugging, turn this off. */
- static int do_load_balancing = 1;
+ static int do_load_balancing = 0;
int fd;
char xbuf[1];
@@ -5103,6 +5106,10 @@ server_loop ()
}
else
fprintf(stderr, "server done\n");
+ { /* Kludge - fails unless linked with c-common.o. */
+ extern void report_fragment_statistics (void);
+ report_fragment_statistics ();
+ }
#endif
}