Commit parts that were missing in Mark's last commit

From-SVN: r29164
This commit is contained in:
Bernd Schmidt 1999-09-07 10:10:01 +00:00
parent 6bc2c8c8a6
commit afe3d09019
6 changed files with 604 additions and 555 deletions

View File

@ -2393,6 +2393,7 @@ mark_eh_state (eh)
struct eh_status *eh;
{
mark_eh_stack (&eh->x_ehstack);
mark_eh_stack (&eh->x_catchstack);
mark_eh_queue (&eh->x_ehqueue);
ggc_mark_rtx (eh->x_catch_clauses);
@ -2401,6 +2402,7 @@ mark_eh_state (eh)
ggc_mark_tree (eh->x_protect_list);
ggc_mark_rtx (eh->ehc);
ggc_mark_rtx (eh->x_eh_return_stub_label);
}
/* This group of functions initializes the exception handling data

View File

@ -6714,6 +6714,7 @@ mark_function_state (p)
}
ggc_mark_rtx (p->x_nonlocal_goto_handler_slots);
ggc_mark_rtx (p->x_nonlocal_goto_handler_labels);
ggc_mark_rtx (p->x_nonlocal_goto_stack_level);
ggc_mark_tree (p->x_nonlocal_labels);
}

View File

@ -133,7 +133,7 @@ ggc_alloc_rtvec (nelt)
int nelt;
{
struct ggc_rtvec *v;
int size = sizeof (*v) + (nelt - 1) * sizeof (rtunion);
int size = sizeof (*v) + (nelt - 1) * sizeof (rtx);
v = (struct ggc_rtvec *) xmalloc (size);
bzero ((char *) v, size);
@ -195,7 +195,7 @@ ggc_alloc_string (contents, length)
strings = s;
#ifdef GGC_DUMP
fprintf(dump, "alloc string %p\n", &n->tree);
fprintf(dump, "alloc string %p\n", &s->string);
#endif
bytes_alloced_since_gc += size;

File diff suppressed because it is too large Load Diff

View File

@ -41,7 +41,8 @@ Boston, MA 02111-1307, USA. */
#include "flags.h"
#include "output.h"
#include "toplev.h"
#include "ggc.h"
#ifdef MULTIBYTE_CHARS
#include <locale.h>
#endif
@ -229,6 +230,16 @@ int objc_public_flag;
#define YYPRINT(FILE,YYCHAR,YYLVAL) yyprint(FILE,YYCHAR,YYLVAL)
extern void yyprint PROTO ((FILE *, int, YYSTYPE));
/* Add GC roots for variables local to this file. */
void
c_parse_init ()
{
ggc_add_tree_root (&declspec_stack, 1);
ggc_add_tree_root (&current_declspecs, 1);
ggc_add_tree_root (&prefix_attributes, 1);
}
%}
%%

View File

@ -1493,6 +1493,25 @@ decl_name (decl, verbosity)
return IDENTIFIER_POINTER (DECL_NAME (decl));
}
/* Mark P for GC. Also mark main_input_filename and input_filename. */
static void
mark_file_stack (p)
void *p;
{
struct file_stack *stack = *(struct file_stack **)p;
/* We're only called for input_file_stack, so we can mark the current
input_filename here as well. */
ggc_mark_string (main_input_filename);
ggc_mark_string (input_filename);
while (stack)
{
ggc_mark_string (stack->name);
stack = stack->next;
}
}
static int need_error_newline;
/* Function of last error message;
@ -3055,6 +3074,8 @@ compile_file (name)
#endif
}
if (ggc_p)
name = ggc_alloc_string (name, strlen (name));
input_filename = name;
/* Put an entry on the input file stack for the main input file. */
@ -4772,6 +4793,9 @@ main (argc, argv)
flag_short_enums = DEFAULT_SHORT_ENUMS;
#endif
ggc_add_root (&input_file_stack, 1, sizeof input_file_stack,
&mark_file_stack);
/* Perform language-specific options intialization. */
lang_init_options ();