+2004-05-22 Andrew Pinski <pinskia@physics.uc.edu>
+
+ * c-common.c (c_common_truthvalue_conversion): Handle
+ UNEQ_EXPR, UNLE_EXPR, UNGE_EXPR, UNLT_EXPR, UNGT_EXPR,
+ ORDERED_EXPR, and UNORDERED_EXPR as comparison operators,
+ i.e. set the type to truthvalue_type_node and return.
+
+2004-05-22 Zack Weinberg <zack@codesourcery.com>
+
+ * tree.h (struct tree_decl): Add possibly_inlined bit.
+ (DECL_POSSIBLY_INLINED): New accessor macro.
+ * cgraph.h: Remove declaration of cgraph_inline_hash.
+ * cgraph.c: Remove definition of cgraph_inline_hash.
+ (hash_node): Revert to hashing DECL_UID.
+ (eq_node): Take two pointers to cgraph_node structures.
+ Compare DECL_UIDs.
+ (cgraph_remove_node): Pass the node directly to htab_find_slot.
+ (cgraph_varpool_hash_node): Rename hash_varpool_node;
+ hash on DECL_UID.
+ (eq_cgraph_varpool_node): Rename eq_varpool_node; take two
+ pointers to cgraph_varpool_node structures; compare DECL_UIDs.
+ (cgraph_node): Allocate a temporary node on the stack, fill in
+ its DECL field, and pass that to htab_find_slot.
+ (cgraph_varpool_node): Likewise.
+ (cgraph_function_possibly_inlined_p): If global info is ready,
+ return the DECL_POSSIBLY_INLINED bit.
+ * cgraphunit.c (cgraph_mark_inline_edge): Set DECL_POSSIBLY_INLINED
+ instead of mucking with cgraph_inline_hash.
+
2004-05-22 Joseph S. Myers <jsm@polyomino.org.uk>
* doc/contrib.texi: Add g77 contributors.
/* Hash table used to convert declarations into nodes. */
static GTY((param_is (struct cgraph_node))) htab_t cgraph_hash;
-/* We destructively update the callgraph during inlining, thus we need to
- keep a separate table with information on whether inlining happened.
- ??? Do this with a bit in the DECL instead of a hash table. */
-htab_t cgraph_inline_hash;
-
/* The linked list of cgraph nodes. */
struct cgraph_node *cgraph_nodes;
static hashval_t
hash_node (const void *p)
{
- return htab_hash_pointer (((struct cgraph_node *) p)->decl);
+ const struct cgraph_node *n = p;
+ return (hashval_t) DECL_UID (n->decl);
}
/* Returns nonzero if P1 and P2 are equal. */
static int
eq_node (const void *p1, const void *p2)
{
- return (void *)((struct cgraph_node *) p1)->decl == p2;
+ const struct cgraph_node *n1 = p1, *n2 = p2;
+ return DECL_UID (n1->decl) == DECL_UID (n2->decl);
}
/* Allocate new callgraph node and insert it into basic data structures. */
struct cgraph_node *
cgraph_node (tree decl)
{
- struct cgraph_node *node;
- struct cgraph_node **slot;
+ struct cgraph_node key, *node, **slot;
if (TREE_CODE (decl) != FUNCTION_DECL)
abort ();
if (!cgraph_hash)
cgraph_hash = htab_create_ggc (10, hash_node, eq_node, NULL);
- slot = (struct cgraph_node **)
- htab_find_slot_with_hash (cgraph_hash, decl,
- htab_hash_pointer (decl), INSERT);
+ key.decl = decl;
+
+ slot = (struct cgraph_node **) htab_find_slot (cgraph_hash, &key, INSERT);
+
if (*slot)
return *slot;
cgraph_nodes = node->next;
if (node->next)
node->next->previous = node->previous;
- slot =
- htab_find_slot_with_hash (cgraph_hash, node->decl,
- htab_hash_pointer (node->decl), NO_INSERT);
+ slot = htab_find_slot (cgraph_hash, node, NO_INSERT);
if (*slot == node)
{
if (node->next_clone)
/* Returns a hash code for P. */
static hashval_t
-cgraph_varpool_hash_node (const void *p)
+hash_varpool_node (const void *p)
{
- return htab_hash_pointer (((struct cgraph_varpool_node *) p)->decl);
+ const struct cgraph_varpool_node *n = p;
+ return (hashval_t) DECL_UID (n->decl);
}
/* Returns nonzero if P1 and P2 are equal. */
static int
-eq_cgraph_varpool_node (const void *p1, const void *p2)
+eq_varpool_node (const void *p1, const void *p2)
{
- return (void *)((struct cgraph_varpool_node *) p1)->decl == p2;
+ const struct cgraph_varpool_node *n1 = p1, *n2 = p2;
+ return DECL_UID (n1->decl) == DECL_UID (n2->decl);
}
/* Return cgraph_varpool node assigned to DECL. Create new one when needed. */
struct cgraph_varpool_node *
cgraph_varpool_node (tree decl)
{
- struct cgraph_varpool_node *node;
- struct cgraph_varpool_node **slot;
+ struct cgraph_varpool_node key, *node, **slot;
if (!DECL_P (decl) || TREE_CODE (decl) == FUNCTION_DECL)
abort ();
if (!cgraph_varpool_hash)
- cgraph_varpool_hash = htab_create_ggc (10, cgraph_varpool_hash_node,
- eq_cgraph_varpool_node, NULL);
+ cgraph_varpool_hash = htab_create_ggc (10, hash_varpool_node,
+ eq_varpool_node, NULL);
+ key.decl = decl;
slot = (struct cgraph_varpool_node **)
- htab_find_slot_with_hash (cgraph_varpool_hash, decl,
- htab_hash_pointer (decl), INSERT);
+ htab_find_slot (cgraph_varpool_hash, &key, INSERT);
if (*slot)
return *slot;
node = ggc_alloc_cleared (sizeof (*node));
{
if (!cgraph_global_info_ready)
return (DECL_INLINE (decl) && !flag_really_no_inline);
- if (!cgraph_inline_hash)
- return false;
- return (htab_find_slot (cgraph_inline_hash, decl, NO_INSERT) != NULL);
+ return DECL_POSSIBLY_INLINED (decl);
}
/* Create clone of E in the node N represented by CALL_EXPR the callgraph. */