* Makefile.in (cgraph.o): Depend on gt-cgraph.h and varray.h.
* gt-cgraph.h: New GC file.
* cgraph.c (known_fns): New static variable.
(cgraph_node): Add the decl into varray.
From-SVN: r63998
+Sat Mar 8 19:22:30 CET 2003 Jan Hubicka <jh@suse.cz>
+
+ * Makefile.in (cgraph.o): Depend on gt-cgraph.h and varray.h.
+ * gt-cgraph.h: New GC file.
+ * cgraph.c (known_fns): New static variable.
+ (cgraph_node): Add the decl into varray.
+
2003-03-08 Hans-Peter Nilsson <hp@bitrange.com>
* config/mmix/mmix.md ("*movcc_expanded"): Add missing alternatives.
$(REGS_H) hard-reg-set.h flags.h real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h \
output.h function.h $(GGC_H) $(OBSTACK_H) $(TM_P_H) $(TREE_H) $(TARGET_H)
cgraph.o : cgraph.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
- langhooks.h tree-inline.h toplev.h flags.h ggc.h $(TARGET_H) cgraph.h
+ langhooks.h tree-inline.h toplev.h flags.h ggc.h $(TARGET_H) cgraph.h gt-cgraph.h
cgraphunit.o : cgraphunit.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
langhooks.h tree-inline.h toplev.h flags.h ggc.h $(TARGET_H) cgraph.h
cselib.o : cselib.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \
$(srcdir)/varray.h $(srcdir)/ssa.h $(srcdir)/insn-addr.h $(srcdir)/cselib.h \
$(srcdir)/basic-block.h $(srcdir)/location.h \
$(srcdir)/c-common.h $(srcdir)/c-tree.h \
- $(srcdir)/alias.c $(srcdir)/bitmap.c $(srcdir)/cselib.c \
+ $(srcdir)/alias.c $(srcdir)/bitmap.c $(srcdir)/cselib.c $(srcdir)/cgraph.c \
$(srcdir)/dbxout.c $(srcdir)/dwarf2out.c $(srcdir)/dwarf2asm.c \
$(srcdir)/emit-rtl.c $(srcdir)/except.c $(srcdir)/explow.c $(srcdir)/expr.c \
$(srcdir)/fold-const.c $(srcdir)/function.c \
GTFILES_LANG_DIR_NAMES = @subdirs@
GTFILES_SRCDIR = @srcdir@
-gtype-desc.h gtype-desc.c gt-except.h gt-function.h : s-gtype; @true
+gt-cgraph.h gtype-desc.h gtype-desc.c gt-except.h gt-function.h : s-gtype; @true
gt-integrate.h gt-stmt.h gt-tree.h gt-varasm.h gt-emit-rtl.h : s-gtype; @true
gt-explow.h gt-stor-layout.h gt-regclass.h gt-lists.h : s-gtype; @true
gt-alias.h gt-cselib.h gt-fold-const.h gt-gcse.h gt-profile.h : s-gtype; @true
#include "debug.h"
#include "target.h"
#include "cgraph.h"
+#include "varray.h"
+
+/* The known declarations must not get garbage collected. Callgraph
+ datastructures should not get saved via PCH code since this would
+ make it difficult to extend into intra-module optimizer later. So
+ we store only the references into the array to prevent gabrage
+ collector from deleting live data. */
+static GTY(()) varray_type known_fns;
/* Hash table used to convert declarations into nodes. */
static htab_t cgraph_hash = 0;
struct cgraph_node *node;
struct cgraph_node **slot;
+ if (TREE_CODE (decl) != FUNCTION_DECL)
+ abort ();
+
if (!cgraph_hash)
- cgraph_hash = htab_create (10, hash_node, eq_node, NULL);
+ {
+ cgraph_hash = htab_create (10, hash_node, eq_node, NULL);
+ VARRAY_TREE_INIT (known_fns, 32, "known_fns");
+ }
slot =
(struct cgraph_node **) htab_find_slot_with_hash (cgraph_hash, decl,
node->next_nested = node->origin->nested;
node->origin->nested = node;
}
+ VARRAY_PUSH_TREE (known_fns, decl);
return node;
}
fprintf (f, "\n");
}
}
+
+#include "gt-cgraph.h"