OSDN Git Service

2011-04-29 Martin Jambor <mjambor@suse.cz>
authorjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 28 Apr 2011 22:49:46 +0000 (22:49 +0000)
committerjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 28 Apr 2011 22:49:46 +0000 (22:49 +0000)
* cgraphunit.c (cgraph_preserve_function_body_p): Accept a cgraph
node instead of a decl.  Update all callers.
* cgraph.h: Update declaration.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@173138 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/cgraph.h
gcc/cgraphunit.c
gcc/ipa-inline-transform.c

index 459923e..204cd0b 100644 (file)
@@ -1,3 +1,9 @@
+2011-04-29  Martin Jambor  <mjambor@suse.cz>
+
+       * cgraphunit.c (cgraph_preserve_function_body_p): Accept a cgraph
+       node instead of a decl.  Update all callers.
+       * cgraph.h: Update declaration.
+
 2011-04-28  Ira Rosen  <ira.rosen@linaro.org>
 
        PR tree-optimization/48765
index 14848b5..ec95ba7 100644 (file)
@@ -573,7 +573,7 @@ void cgraph_mark_needed_node (struct cgraph_node *);
 void cgraph_mark_address_taken_node (struct cgraph_node *);
 void cgraph_mark_reachable_node (struct cgraph_node *);
 bool cgraph_inline_p (struct cgraph_edge *, cgraph_inline_failed_t *reason);
-bool cgraph_preserve_function_body_p (tree);
+bool cgraph_preserve_function_body_p (struct cgraph_node *);
 void verify_cgraph (void);
 void verify_cgraph_node (struct cgraph_node *);
 void cgraph_build_static_cdtor (char which, tree body, int priority);
index aa2f2a1..70b63b3 100644 (file)
@@ -1580,7 +1580,7 @@ cgraph_expand_function (struct cgraph_node *node)
   /* Make sure that BE didn't give up on compiling.  */
   gcc_assert (TREE_ASM_WRITTEN (decl));
   current_function_decl = NULL;
-  gcc_assert (!cgraph_preserve_function_body_p (decl));
+  gcc_assert (!cgraph_preserve_function_body_p (node));
   cgraph_release_function_body (node);
   /* Eliminate all call edges.  This is important so the GIMPLE_CALL no longer
      points to the dead function body.  */
@@ -1758,13 +1758,12 @@ cgraph_output_in_order (void)
 /* Return true when function body of DECL still needs to be kept around
    for later re-use.  */
 bool
-cgraph_preserve_function_body_p (tree decl)
+cgraph_preserve_function_body_p (struct cgraph_node *node)
 {
-  struct cgraph_node *node;
-
   gcc_assert (cgraph_global_info_ready);
+  gcc_assert (!node->same_body_alias);
+
   /* Look if there is any clone around.  */
-  node = cgraph_get_node (decl);
   if (node->clones)
     return true;
   return false;
index 7465325..117958c 100644 (file)
@@ -297,7 +297,7 @@ inline_transform (struct cgraph_node *node)
 
   /* We might need the body of this function so that we can expand
      it inline somewhere else.  */
-  if (cgraph_preserve_function_body_p (node->decl))
+  if (cgraph_preserve_function_body_p (node))
     save_inline_function_body (node);
 
   for (e = node->callees; e; e = e->next_callee)