diff options
author | Bernd Schmidt <crux@gcc.gnu.org> | 1999-09-07 10:10:01 +0000 |
---|---|---|
committer | Bernd Schmidt <crux@gcc.gnu.org> | 1999-09-07 10:10:01 +0000 |
commit | afe3d09019946edd8476fa7e7fa965368e8b3904 (patch) | |
tree | 194b36b94e07894eebfa0d3294f15271a8a5be02 /gcc/toplev.c | |
parent | 6bc2c8c8a62bab3cdfd5051b2fdfa6ee7a90b1c8 (diff) | |
download | gcc-afe3d09019946edd8476fa7e7fa965368e8b3904.zip gcc-afe3d09019946edd8476fa7e7fa965368e8b3904.tar.gz gcc-afe3d09019946edd8476fa7e7fa965368e8b3904.tar.bz2 |
Commit parts that were missing in Mark's last commit
From-SVN: r29164
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r-- | gcc/toplev.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c index fda94db..68c7458 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -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 (); |