+1999-10-30 Mark Mitchell <mark@codesourcery.com>
+
+ * decl.c (pop_cp_function_context): Don't call free on a NULL
+ pointer.
+ * semantics.c: Include ggc.h.
+ (expand_body): Do garbage-collection after processing a template
+ function. Clear DECL_SAVED_TREE after generating RTL for a
+ function.
+ * Makefile.in (semantics.o): Depend on ggc.h.
+
1999-10-29 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (make_typename_type): Change prototype.
$(srcdir)/../toplev.h $(srcdir)/../ggc.h
semantics.o: semantics.c $(CONFIG_H) $(CXX_TREE_H) lex.h \
$(srcdir)/../except.h $(srcdir)/../system.h $(srcdir)/../toplev.h \
- $(srcdir)/../flags.h
+ $(srcdir)/../flags.h $(srcdir)/../ggc.h
dump.o: dump.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../system.h
#\f
#include "lex.h"
#include "toplev.h"
#include "flags.h"
+#include "ggc.h"
/* There routines provide a modular interface to perform many parsing
operations. They may therefore be used during actual parsing, or
|| (DECL_LANG_SPECIFIC (fn)
&& DECL_TEMPLATE_INFO (fn)
&& uses_template_parms (DECL_TI_ARGS (fn))))
- return;
+ {
+ /* Normally, collection only occurs in rest_of_compilation. So,
+ if we don't collect here, we never collect junk generated
+ during the processing of templates until we hit a
+ non-template function. */
+ ggc_collect ();
+ return;
+ }
/* There's no reason to do any of the work here if we're only doing
semantic analysis; this code just generates RTL. */
/* Generate code for the function. */
finish_function (lineno, 0);
+ /* We don't need the body any more. Allow it to be garbage
+ collected. We can't do this if we're going to dump everything. */
+ if (!flag_dump_translation_unit)
+ DECL_SAVED_TREE (fn) = NULL_TREE;
+
/* And restore the current source position. */
lineno = saved_lineno;
input_filename = saved_input_filename;