Makefile.in (GTFILES): Add cgraph.h.
* Makefile.in (GTFILES): Add cgraph.h. * cgraph.c (known_decls): Remove. (cgraph_hash, cgraph_nodes, cgraph_nodes_queue, cgraph_varpool_hash, cgraph_varpool_nodes_queue): GTYize. (cgraph_node): Do not allocate known_decls; use polutate hashtable. (cgraph_varpool_node): Likewise; add next pointer. (cgraph_varpool_nodes): New static variable. * cgraph.h (cgraph_local_info, cgraph_global_info, cgraph_rtl_info, cgraph_node, cgraph_edge, cgraph_varpool_node, cgraph_nodes, cgraph_n_nodes, cgraph_varpool_n_nodes, cgraph_varpool_nodes_queue): GTYize. * gengtype.c (open_base_files): Include cgraph.h From-SVN: r68742
This commit is contained in:
parent
f11c1f9089
commit
ed2df68b4b
@ -1,3 +1,17 @@
|
||||
Mon Jun 30 23:47:33 CEST 2003 Jan Hubicka <jh@suse.cz>
|
||||
|
||||
* Makefile.in (GTFILES): Add cgraph.h.
|
||||
* cgraph.c (known_decls): Remove.
|
||||
(cgraph_hash, cgraph_nodes, cgraph_nodes_queue,
|
||||
cgraph_varpool_hash, cgraph_varpool_nodes_queue): GTYize.
|
||||
(cgraph_node): Do not allocate known_decls; use polutate hashtable.
|
||||
(cgraph_varpool_node): Likewise; add next pointer.
|
||||
(cgraph_varpool_nodes): New static variable.
|
||||
* cgraph.h (cgraph_local_info, cgraph_global_info, cgraph_rtl_info,
|
||||
cgraph_node, cgraph_edge, cgraph_varpool_node, cgraph_nodes, cgraph_n_nodes,
|
||||
cgraph_varpool_n_nodes, cgraph_varpool_nodes_queue): GTYize.
|
||||
* gengtype.c (open_base_files): Include cgraph.h
|
||||
|
||||
2003-06-30 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||
|
||||
* Changelog: Remove ">>>>>>>" from previous change.
|
||||
|
@ -1999,7 +1999,7 @@ GTFILES = $(srcdir)/input.h $(srcdir)/coretypes.h $(srcdir)/cpplib.h \
|
||||
$(srcdir)/bitmap.h $(srcdir)/coverage.c $(srcdir)/function.h $(srcdir)/rtl.h \
|
||||
$(srcdir)/optabs.h $(srcdir)/tree.h $(srcdir)/libfuncs.h $(srcdir)/hashtable.h \
|
||||
$(srcdir)/real.h $(srcdir)/varray.h $(srcdir)/ssa.h $(srcdir)/insn-addr.h \
|
||||
$(srcdir)/cselib.h $(srcdir)/basic-block.h \
|
||||
$(srcdir)/cselib.h $(srcdir)/basic-block.h $(srcdir)/cgraph.h \
|
||||
$(srcdir)/c-common.h $(srcdir)/c-tree.h \
|
||||
$(srcdir)/alias.c $(srcdir)/bitmap.c $(srcdir)/cselib.c $(srcdir)/cgraph.c \
|
||||
$(srcdir)/dbxout.c $(srcdir)/dwarf2out.c $(srcdir)/dwarf2asm.c \
|
||||
|
80
gcc/cgraph.c
80
gcc/cgraph.c
@ -35,15 +35,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||
#include "varray.h"
|
||||
#include "output.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_decls;
|
||||
|
||||
/* Hash table used to convert declarations into nodes. */
|
||||
static htab_t cgraph_hash = 0;
|
||||
static GTY((param_is (struct cgraph_node))) htab_t cgraph_hash;
|
||||
|
||||
/* The linked list of cgraph nodes. */
|
||||
struct cgraph_node *cgraph_nodes;
|
||||
@ -58,7 +52,7 @@ int cgraph_n_nodes;
|
||||
bool cgraph_global_info_ready = false;
|
||||
|
||||
/* Hash table used to convert declarations into nodes. */
|
||||
static htab_t cgraph_varpool_hash = 0;
|
||||
static GTY((param_is (struct cgraph_varpool_node))) htab_t cgraph_varpool_hash;
|
||||
|
||||
/* Queue of cgraph nodes scheduled to be lowered and output. */
|
||||
struct cgraph_varpool_node *cgraph_varpool_nodes_queue;
|
||||
@ -66,6 +60,9 @@ struct cgraph_varpool_node *cgraph_varpool_nodes_queue;
|
||||
/* Number of nodes in existence. */
|
||||
int cgraph_varpool_n_nodes;
|
||||
|
||||
/* The linked list of cgraph varpool nodes. */
|
||||
static GTY(()) struct cgraph_varpool_node *cgraph_varpool_nodes;
|
||||
|
||||
static struct cgraph_edge *create_edge PARAMS ((struct cgraph_node *,
|
||||
struct cgraph_node *));
|
||||
static void cgraph_remove_edge PARAMS ((struct cgraph_node *, struct cgraph_node *));
|
||||
@ -78,9 +75,9 @@ static hashval_t
|
||||
hash_node (p)
|
||||
const void *p;
|
||||
{
|
||||
return (hashval_t)
|
||||
htab_hash_pointer (DECL_ASSEMBLER_NAME
|
||||
(((struct cgraph_node *) p)->decl));
|
||||
return ((hashval_t)
|
||||
IDENTIFIER_HASH_VALUE (DECL_ASSEMBLER_NAME
|
||||
(((struct cgraph_node *) p)->decl)));
|
||||
}
|
||||
|
||||
/* Returns nonzero if P1 and P2 are equal. */
|
||||
@ -106,21 +103,15 @@ cgraph_node (decl)
|
||||
abort ();
|
||||
|
||||
if (!cgraph_hash)
|
||||
{
|
||||
cgraph_hash = htab_create (10, hash_node, eq_node, NULL);
|
||||
if (!known_decls)
|
||||
VARRAY_TREE_INIT (known_decls, 32, "known_decls");
|
||||
}
|
||||
cgraph_hash = htab_create_ggc (10, hash_node, eq_node, NULL);
|
||||
|
||||
slot =
|
||||
(struct cgraph_node **) htab_find_slot_with_hash (cgraph_hash,
|
||||
DECL_ASSEMBLER_NAME (decl),
|
||||
htab_hash_pointer
|
||||
(DECL_ASSEMBLER_NAME
|
||||
(decl)), 1);
|
||||
slot = (struct cgraph_node **)
|
||||
htab_find_slot_with_hash (cgraph_hash, DECL_ASSEMBLER_NAME (decl),
|
||||
IDENTIFIER_HASH_VALUE
|
||||
(DECL_ASSEMBLER_NAME (decl)), 1);
|
||||
if (*slot)
|
||||
return *slot;
|
||||
node = xcalloc (sizeof (*node), 1);
|
||||
node = ggc_alloc_cleared (sizeof (*node));
|
||||
node->decl = decl;
|
||||
node->next = cgraph_nodes;
|
||||
if (cgraph_nodes)
|
||||
@ -135,7 +126,6 @@ cgraph_node (decl)
|
||||
node->next_nested = node->origin->nested;
|
||||
node->origin->nested = node;
|
||||
}
|
||||
VARRAY_PUSH_TREE (known_decls, decl);
|
||||
return node;
|
||||
}
|
||||
|
||||
@ -152,9 +142,9 @@ cgraph_node_for_identifier (id)
|
||||
if (!cgraph_hash)
|
||||
return NULL;
|
||||
|
||||
slot =
|
||||
(struct cgraph_node **) htab_find_slot_with_hash (cgraph_hash, id,
|
||||
htab_hash_pointer (id), 0);
|
||||
slot = (struct cgraph_node **)
|
||||
htab_find_slot_with_hash (cgraph_hash, id,
|
||||
IDENTIFIER_HASH_VALUE (id), 0);
|
||||
if (!slot)
|
||||
return NULL;
|
||||
return *slot;
|
||||
@ -166,7 +156,7 @@ static struct cgraph_edge *
|
||||
create_edge (caller, callee)
|
||||
struct cgraph_node *caller, *callee;
|
||||
{
|
||||
struct cgraph_edge *edge = xmalloc (sizeof (struct cgraph_edge));
|
||||
struct cgraph_edge *edge = ggc_alloc (sizeof (struct cgraph_edge));
|
||||
|
||||
edge->caller = caller;
|
||||
edge->callee = callee;
|
||||
@ -368,9 +358,9 @@ dump_cgraph (f)
|
||||
static hashval_t
|
||||
cgraph_varpool_hash_node (const PTR p)
|
||||
{
|
||||
return (hashval_t)
|
||||
htab_hash_pointer (DECL_ASSEMBLER_NAME
|
||||
(((struct cgraph_varpool_node *) p)->decl));
|
||||
return ((hashval_t)
|
||||
IDENTIFIER_HASH_VALUE (DECL_ASSEMBLER_NAME
|
||||
(((struct cgraph_varpool_node *) p)->decl)));
|
||||
}
|
||||
|
||||
/* Returns nonzero if P1 and P2 are equal. */
|
||||
@ -393,25 +383,21 @@ cgraph_varpool_node (tree decl)
|
||||
abort ();
|
||||
|
||||
if (!cgraph_varpool_hash)
|
||||
{
|
||||
cgraph_varpool_hash = htab_create (10, cgraph_varpool_hash_node, eq_cgraph_varpool_node, NULL);
|
||||
if (!known_decls)
|
||||
VARRAY_TREE_INIT (known_decls, 32, "known_decls");
|
||||
}
|
||||
cgraph_varpool_hash = htab_create_ggc (10, cgraph_varpool_hash_node,
|
||||
eq_cgraph_varpool_node, NULL);
|
||||
|
||||
slot =
|
||||
(struct cgraph_varpool_node **) htab_find_slot_with_hash (cgraph_varpool_hash,
|
||||
DECL_ASSEMBLER_NAME (decl),
|
||||
htab_hash_pointer
|
||||
(DECL_ASSEMBLER_NAME
|
||||
(decl)), 1);
|
||||
|
||||
slot = (struct cgraph_varpool_node **)
|
||||
htab_find_slot_with_hash (cgraph_varpool_hash, DECL_ASSEMBLER_NAME (decl),
|
||||
IDENTIFIER_HASH_VALUE (DECL_ASSEMBLER_NAME (decl)),
|
||||
1);
|
||||
if (*slot)
|
||||
return *slot;
|
||||
node = xcalloc (sizeof (*node), 1);
|
||||
node = ggc_alloc_cleared (sizeof (*node));
|
||||
node->decl = decl;
|
||||
cgraph_varpool_n_nodes++;
|
||||
cgraph_varpool_nodes = node;
|
||||
*slot = node;
|
||||
VARRAY_PUSH_TREE (known_decls, decl);
|
||||
return node;
|
||||
}
|
||||
|
||||
@ -427,9 +413,9 @@ cgraph_varpool_node_for_identifier (tree id)
|
||||
if (!cgraph_varpool_hash)
|
||||
return NULL;
|
||||
|
||||
slot =
|
||||
(struct cgraph_varpool_node **) htab_find_slot_with_hash (cgraph_varpool_hash, id,
|
||||
htab_hash_pointer (id), 0);
|
||||
slot = (struct cgraph_varpool_node **)
|
||||
htab_find_slot_with_hash (cgraph_varpool_hash, id,
|
||||
IDENTIFIER_HASH_VALUE (id), 0);
|
||||
if (!slot)
|
||||
return NULL;
|
||||
return *slot;
|
||||
|
35
gcc/cgraph.h
35
gcc/cgraph.h
@ -25,7 +25,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||
/* Information about the function collected locally.
|
||||
Available after function is lowered */
|
||||
|
||||
struct cgraph_local_info
|
||||
struct cgraph_local_info GTY(())
|
||||
{
|
||||
/* Set when function function is visiable in current compilation unit only
|
||||
and it's address is never taken. */
|
||||
@ -40,7 +40,7 @@ struct cgraph_local_info
|
||||
/* Information about the function that needs to be computed globally
|
||||
once compilation is finished. Available only with -funit-at-time. */
|
||||
|
||||
struct cgraph_global_info
|
||||
struct cgraph_global_info GTY(())
|
||||
{
|
||||
/* Set when the function will be inlined exactly once. */
|
||||
bool inline_once;
|
||||
@ -49,9 +49,10 @@ struct cgraph_global_info
|
||||
/* Information about the function that is propagated by the RTL backend.
|
||||
Available only for functions that has been already assembled. */
|
||||
|
||||
struct cgraph_rtl_info
|
||||
struct cgraph_rtl_info GTY(())
|
||||
{
|
||||
bool const_function, pure_function;
|
||||
bool const_function;
|
||||
bool pure_function;
|
||||
int preferred_incoming_stack_boundary;
|
||||
};
|
||||
|
||||
@ -59,19 +60,20 @@ struct cgraph_rtl_info
|
||||
/* The cgraph data strutcture.
|
||||
Each function decl has assigned cgraph_node listing calees and callers. */
|
||||
|
||||
struct cgraph_node
|
||||
struct cgraph_node GTY(())
|
||||
{
|
||||
tree decl;
|
||||
struct cgraph_edge *callees;
|
||||
struct cgraph_edge *callers;
|
||||
struct cgraph_node *next, *previous;
|
||||
struct cgraph_node *next;
|
||||
struct cgraph_node *previous;
|
||||
/* For nested functions points to function the node is nested in. */
|
||||
struct cgraph_node *origin;
|
||||
/* Points to first nested function, if any. */
|
||||
struct cgraph_node *nested;
|
||||
/* Pointer to the next function with same origin, if any. */
|
||||
struct cgraph_node *next_nested;
|
||||
void *aux;
|
||||
PTR GTY ((skip (""))) aux;
|
||||
|
||||
/* Set when function must be output - it is externally visible
|
||||
or it's address is taken. */
|
||||
@ -90,9 +92,10 @@ struct cgraph_node
|
||||
struct cgraph_rtl_info rtl;
|
||||
};
|
||||
|
||||
struct cgraph_edge
|
||||
struct cgraph_edge GTY(())
|
||||
{
|
||||
struct cgraph_node *caller, *callee;
|
||||
struct cgraph_node *caller;
|
||||
struct cgraph_node *callee;
|
||||
struct cgraph_edge *next_caller;
|
||||
struct cgraph_edge *next_callee;
|
||||
};
|
||||
@ -100,10 +103,10 @@ struct cgraph_edge
|
||||
/* The cgraph_varpool data strutcture.
|
||||
Each static variable decl has assigned cgraph_varpool_node. */
|
||||
|
||||
struct cgraph_varpool_node
|
||||
struct cgraph_varpool_node GTY(())
|
||||
{
|
||||
tree decl;
|
||||
void *aux;
|
||||
PTR GTY ((skip (""))) aux;
|
||||
|
||||
/* Set when function must be output - it is externally visible
|
||||
or it's address is taken. */
|
||||
@ -114,13 +117,13 @@ struct cgraph_varpool_node
|
||||
bool output;
|
||||
};
|
||||
|
||||
extern struct cgraph_node *cgraph_nodes;
|
||||
extern int cgraph_n_nodes;
|
||||
extern GTY(()) struct cgraph_node *cgraph_nodes;
|
||||
extern GTY(()) int cgraph_n_nodes;
|
||||
extern bool cgraph_global_info_ready;
|
||||
extern struct cgraph_node *cgraph_nodes_queue;
|
||||
extern GTY(()) struct cgraph_node *cgraph_nodes_queue;
|
||||
|
||||
extern int cgraph_varpool_n_nodes;
|
||||
extern struct cgraph_varpool_node *cgraph_varpool_nodes_queue;
|
||||
extern GTY(()) int cgraph_varpool_n_nodes;
|
||||
extern GTY(()) struct cgraph_varpool_node *cgraph_varpool_nodes_queue;
|
||||
|
||||
|
||||
/* In cgraph.c */
|
||||
|
@ -1089,7 +1089,7 @@ open_base_files (void)
|
||||
"hashtab.h", "splay-tree.h", "bitmap.h", "tree.h", "rtl.h",
|
||||
"function.h", "insn-config.h", "expr.h", "hard-reg-set.h",
|
||||
"basic-block.h", "cselib.h", "insn-addr.h", "ssa.h", "optabs.h",
|
||||
"libfuncs.h", "debug.h", "ggc.h",
|
||||
"libfuncs.h", "debug.h", "ggc.h", "cgraph.h",
|
||||
NULL
|
||||
};
|
||||
const char *const *ifp;
|
||||
|
Loading…
Reference in New Issue
Block a user