2010-04-29 Martin Jambor * cgraph.c (cgraph_set_node_decl): New function. * cgraph.h (cgraph_set_node_decl): Declare. Index: mine/gcc/cgraph.c =================================================================== --- mine.orig/gcc/cgraph.c +++ mine/gcc/cgraph.c @@ -2305,4 +2305,21 @@ cgraph_set_looping_const_or_pure_flag (s DECL_LOOPING_CONST_OR_PURE_P (alias->decl) = looping_const_or_pure; } +/* Set the declaration NODE belongs to to NEW_DECL. */ + +void +cgraph_set_node_decl (struct cgraph_node *node, tree new_decl) +{ + void **slot; + + slot = htab_find_slot (cgraph_hash, node, NO_INSERT); + if (*slot == node) + htab_clear_slot (cgraph_hash, slot); + + node->decl = new_decl; + slot = (struct cgraph_node **) htab_find_slot (cgraph_hash, node, INSERT); + gcc_assert (!*slot); + *slot = node; +} + #include "gt-cgraph.h" Index: mine/gcc/cgraph.h =================================================================== --- mine.orig/gcc/cgraph.h +++ mine/gcc/cgraph.h @@ -487,6 +487,7 @@ void cgraph_set_nothrow_flag (struct cgr void cgraph_set_readonly_flag (struct cgraph_node *, bool); void cgraph_set_pure_flag (struct cgraph_node *, bool); void cgraph_set_looping_const_or_pure_flag (struct cgraph_node *, bool); +void cgraph_set_node_decl (struct cgraph_node *, tree); /* In cgraphunit.c */ void cgraph_finalize_function (tree, bool);