OSDN Git Service

2008-09-23 Martin Jambor <mjambor@suse.cz>
authorjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 23 Sep 2008 13:08:15 +0000 (13:08 +0000)
committerjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 23 Sep 2008 13:08:15 +0000 (13:08 +0000)
* cgraph.c (cgraph_free_edge): Use sizeof(*e).
(cgraph_node_remove_callees): New temporary f.  Hold the next item
in f when looping.
(cgraph_node_remove_callers): Likewise.

* ipa-prop.c (ipa_edge_removal_hook): Use ATTRIBUTE_UNUSED.
(ipa_node_removal_hook): Likewise.

* doc/gimple.texi (gimple_copy_call_skip_args): Changed to
gimple_call_copy_skip_args and moved to the gimple_call section.
* gimple.c (gimple_copy_call_skip_args): Renamed to
gimple_call_copy_skip_args.  Changed al users.

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

gcc/ChangeLog
gcc/cgraph.c
gcc/doc/gimple.texi
gcc/gimple.c
gcc/gimple.h
gcc/ipa-cp.c
gcc/ipa-prop.c

index cae9404..0f04eb4 100644 (file)
@@ -1,3 +1,18 @@
+2008-09-23  Martin Jambor  <mjambor@suse.cz>
+
+       * cgraph.c (cgraph_free_edge): Use sizeof(*e).
+       (cgraph_node_remove_callees): New temporary f.  Hold the next item
+       in f when looping.
+       (cgraph_node_remove_callers): Likewise.
+
+       * ipa-prop.c (ipa_edge_removal_hook): Use ATTRIBUTE_UNUSED.
+       (ipa_node_removal_hook): Likewise.
+
+       * doc/gimple.texi (gimple_copy_call_skip_args): Changed to
+       gimple_call_copy_skip_args and moved to the gimple_call section.
+       * gimple.c (gimple_copy_call_skip_args): Renamed to
+       gimple_call_copy_skip_args.  Changed al users.
+
 2008-09-22  Vladimir Makarov  <vmakarov@redhat.com>
 
        * ira-color.c (start_allocno_priorities): Rename to
 2008-09-22  Vladimir Makarov  <vmakarov@redhat.com>
 
        * ira-color.c (start_allocno_priorities): Rename to
index 90359a4..163ab9d 100644 (file)
@@ -752,7 +752,7 @@ cgraph_free_edge (struct cgraph_edge *e)
   int uid = e->uid;
 
   /* Clear out the edge so we do not dangle pointers.  */
   int uid = e->uid;
 
   /* Clear out the edge so we do not dangle pointers.  */
-  memset (e, 0, sizeof (e));
+  memset (e, 0, sizeof (*e));
   e->uid = uid;
   NEXT_FREE_EDGE (e) = free_edges;
   free_edges = e;
   e->uid = uid;
   NEXT_FREE_EDGE (e) = free_edges;
   free_edges = e;
@@ -846,13 +846,14 @@ cgraph_update_edges_for_call_stmt (gimple old_stmt, gimple new_stmt)
 void
 cgraph_node_remove_callees (struct cgraph_node *node)
 {
 void
 cgraph_node_remove_callees (struct cgraph_node *node)
 {
-  struct cgraph_edge *e;
+  struct cgraph_edge *e, *f;
 
   /* It is sufficient to remove the edges from the lists of callers of
      the callees.  The callee list of the node can be zapped with one
      assignment.  */
 
   /* It is sufficient to remove the edges from the lists of callers of
      the callees.  The callee list of the node can be zapped with one
      assignment.  */
-  for (e = node->callees; e; e = e->next_callee)
+  for (e = node->callees; e; e = f)
     {
     {
+      f = e->next_callee;
       cgraph_call_edge_removal_hooks (e);
       cgraph_edge_remove_callee (e);
       cgraph_free_edge (e);
       cgraph_call_edge_removal_hooks (e);
       cgraph_edge_remove_callee (e);
       cgraph_free_edge (e);
@@ -870,13 +871,14 @@ cgraph_node_remove_callees (struct cgraph_node *node)
 static void
 cgraph_node_remove_callers (struct cgraph_node *node)
 {
 static void
 cgraph_node_remove_callers (struct cgraph_node *node)
 {
-  struct cgraph_edge *e;
+  struct cgraph_edge *e, *f;
 
   /* It is sufficient to remove the edges from the lists of callees of
      the callers.  The caller list of the node can be zapped with one
      assignment.  */
 
   /* It is sufficient to remove the edges from the lists of callees of
      the callers.  The caller list of the node can be zapped with one
      assignment.  */
-  for (e = node->callers; e; e = e->next_caller)
+  for (e = node->callers; e; e = f)
     {
     {
+      f = e->next_caller;
       cgraph_call_edge_removal_hooks (e);
       cgraph_edge_remove_caller (e);
       cgraph_free_edge (e);
       cgraph_call_edge_removal_hooks (e);
       cgraph_edge_remove_caller (e);
       cgraph_free_edge (e);
index 8277a8c..06d2186 100644 (file)
@@ -875,11 +875,6 @@ Update statement @code{S} if it has been marked modified.
 Return a deep copy of statement @code{STMT}.
 @end deftypefn
 
 Return a deep copy of statement @code{STMT}.
 @end deftypefn
 
-@deftypefn {GIMPLE function} gimple gimple_copy_call_skip_args (gimple stmt, bitmap args_to_skip)
-Build a @code{GIMPLE_CALL} identical to @code{STMT} but skipping the arguments
-in the positions marked by the set @code{ARGS_TO_SKIP}.
-@end deftypefn
-
 @node Tuple specific accessors
 @section Tuple specific accessors
 @cindex Tuple specific accessors
 @node Tuple specific accessors
 @section Tuple specific accessors
 @cindex Tuple specific accessors
@@ -1261,6 +1256,11 @@ Return true if @code{GIMPLE_CALL} @code{S} cannot be inlined.
 Return true if @code{S} is a noreturn call. 
 @end deftypefn
 
 Return true if @code{S} is a noreturn call. 
 @end deftypefn
 
+@deftypefn {GIMPLE function} gimple gimple_call_copy_skip_args (gimple stmt, bitmap args_to_skip)
+Build a @code{GIMPLE_CALL} identical to @code{STMT} but skipping the arguments
+in the positions marked by the set @code{ARGS_TO_SKIP}.
+@end deftypefn
+
 
 @node @code{GIMPLE_CATCH}
 @subsection @code{GIMPLE_CATCH}
 
 @node @code{GIMPLE_CATCH}
 @subsection @code{GIMPLE_CATCH}
index f6a1450..47b9c9a 100644 (file)
@@ -3192,7 +3192,7 @@ canonicalize_cond_expr_cond (tree t)
    the positions marked by the set ARGS_TO_SKIP.  */
 
 gimple
    the positions marked by the set ARGS_TO_SKIP.  */
 
 gimple
-gimple_copy_call_skip_args (gimple stmt, bitmap args_to_skip)
+gimple_call_copy_skip_args (gimple stmt, bitmap args_to_skip)
 {
   int i;
   tree fn = gimple_call_fn (stmt);
 {
   int i;
   tree fn = gimple_call_fn (stmt);
index 85fc75e..a390590 100644 (file)
@@ -4479,7 +4479,7 @@ basic_block gsi_insert_on_edge_immediate (edge, gimple);
 basic_block gsi_insert_seq_on_edge_immediate (edge, gimple_seq);
 void gsi_commit_one_edge_insert (edge, basic_block *);
 void gsi_commit_edge_inserts (void);
 basic_block gsi_insert_seq_on_edge_immediate (edge, gimple_seq);
 void gsi_commit_one_edge_insert (edge, basic_block *);
 void gsi_commit_edge_inserts (void);
-gimple gimple_copy_call_skip_args (gimple, bitmap);
+gimple gimple_call_copy_skip_args (gimple, bitmap);
 
 
 /* Convenience routines to walk all statements of a gimple function.
 
 
 /* Convenience routines to walk all statements of a gimple function.
index 4698197..f6864bb 100644 (file)
@@ -967,7 +967,7 @@ ipcp_update_callgraph (void)
                current_function_decl = cs->caller->decl;
                push_cfun (DECL_STRUCT_FUNCTION (cs->caller->decl));
                
                current_function_decl = cs->caller->decl;
                push_cfun (DECL_STRUCT_FUNCTION (cs->caller->decl));
                
-               new_stmt = gimple_copy_call_skip_args (cs->call_stmt,
+               new_stmt = gimple_call_copy_skip_args (cs->call_stmt,
                                                       args_to_skip);
                gsi = gsi_for_stmt (cs->call_stmt);
                gsi_replace (&gsi, new_stmt, true);
                                                       args_to_skip);
                gsi = gsi_for_stmt (cs->call_stmt);
                gsi_replace (&gsi, new_stmt, true);
index e741feb..16d9bed 100644 (file)
@@ -1108,8 +1108,7 @@ ipa_free_all_node_params (void)
 /* Hook that is called by cgraph.c when an edge is removed.  */
 
 static void
 /* Hook that is called by cgraph.c when an edge is removed.  */
 
 static void
-ipa_edge_removal_hook (struct cgraph_edge *cs,
-                      void *data __attribute__ ((unused)))
+ipa_edge_removal_hook (struct cgraph_edge *cs, void *data ATTRIBUTE_UNUSED)
 {
   /* During IPA-CP updating we can be called on not-yet analyze clones.  */
   if (VEC_length (ipa_edge_args_t, ipa_edge_args_vector)
 {
   /* During IPA-CP updating we can be called on not-yet analyze clones.  */
   if (VEC_length (ipa_edge_args_t, ipa_edge_args_vector)
@@ -1121,8 +1120,7 @@ ipa_edge_removal_hook (struct cgraph_edge *cs,
 /* Hook that is called by cgraph.c when a node is removed.  */
 
 static void
 /* Hook that is called by cgraph.c when a node is removed.  */
 
 static void
-ipa_node_removal_hook (struct cgraph_node *node,
-                      void *data __attribute__ ((unused)))
+ipa_node_removal_hook (struct cgraph_node *node, void *data ATTRIBUTE_UNUSED)
 {
   ipa_free_node_params_substructures (IPA_NODE_REF (node));
 }
 {
   ipa_free_node_params_substructures (IPA_NODE_REF (node));
 }