aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2003-03-08 19:24:22 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2003-03-08 18:24:22 +0000
commit988d1653869158be80b797b13a60dacfc0a4fa22 (patch)
tree924b2a2b8d25bda315a461b330cfaa8c18cad7c1 /gcc
parent73ba39fc86a4697b0c25fcf7cb52a577a356fb0a (diff)
downloadgcc-988d1653869158be80b797b13a60dacfc0a4fa22.zip
gcc-988d1653869158be80b797b13a60dacfc0a4fa22.tar.gz
gcc-988d1653869158be80b797b13a60dacfc0a4fa22.tar.bz2
Makefile.in (cgraph.o): Depend on gt-cgraph.h and varray.h.
* 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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/Makefile.in6
-rw-r--r--gcc/cgraph.c19
3 files changed, 28 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1538848..0d7daa02 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+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.
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 727cacf..c11e554 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -1539,7 +1539,7 @@ simplify-rtx.o : simplify-rtx.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RT
$(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) \
@@ -1929,7 +1929,7 @@ GTFILES = $(srcdir)/location.h $(srcdir)/coretypes.h $(srcdir)/cpplib.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 \
@@ -1946,7 +1946,7 @@ GTFILES_FILES_FILES = @all_gtfiles_files_files@
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
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index bb035b2..fd638bc 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -33,6 +33,14 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#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;
@@ -82,8 +90,14 @@ cgraph_node (decl)
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,
@@ -107,6 +121,7 @@ cgraph_node (decl)
node->next_nested = node->origin->nested;
node->origin->nested = node;
}
+ VARRAY_PUSH_TREE (known_fns, decl);
return node;
}
@@ -290,3 +305,5 @@ dump_cgraph (f)
fprintf (f, "\n");
}
}
+
+#include "gt-cgraph.h"