/* List management for the GNU C-Compiler expander.
- Copyright (C) 1987, 88, 92-97, 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+ 1999 Free Software Foundation, Inc.
This file is part of GNU CC.
#include "system.h"
#include "toplev.h"
#include "rtl.h"
+#include "ggc.h"
+
+static void free_list PARAMS ((rtx *, rtx *));
+static void zap_lists PARAMS ((void *));
/* Functions for maintaining cache-able lists of EXPR_LIST and INSN_LISTs. */
}
/* This function will initialize the EXPR_LIST and INSN_LIST caches. */
-void
-init_EXPR_INSN_LIST_cache ()
+
+static void
+zap_lists (dummy)
+ void *dummy ATTRIBUTE_UNUSED;
{
unused_expr_list = NULL;
unused_insn_list = NULL;
}
+void
+init_EXPR_INSN_LIST_cache ()
+{
+ if (ggc_p)
+ {
+ static int initialized;
+ if (!initialized)
+ {
+ initialized = 1;
+ ggc_add_root (&unused_expr_list, 1, 1, zap_lists);
+ }
+
+ /* No need to squish the lists across functions with GC enabled. */
+ }
+ else
+ {
+ unused_expr_list = NULL;
+ unused_insn_list = NULL;
+ }
+}
+
/* This function will free up an entire list of EXPR_LIST nodes. */
void
free_EXPR_LIST_list (listp)