OSDN Git Service

* tree-optimize.c (execute_ipa_pass_list): New.
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 17 Jun 2005 11:53:59 +0000 (11:53 +0000)
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 17 Jun 2005 11:53:59 +0000 (11:53 +0000)
(ipa_passes): Use it.

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

gcc/ChangeLog
gcc/tree-optimize.c

index 44ed9d2..29ec313 100644 (file)
@@ -1,3 +1,8 @@
+2005-06-17  Jan Hubicka  <jh@suse.cz>
+
+       * tree-optimize.c (execute_ipa_pass_list): New.
+       (ipa_passes): Use it.
+
 2005-06-16  Richard Henderson  <rth@redhat.com>
 
        PR tree-opt/22022
index 0812b64..a33a710 100644 (file)
@@ -50,7 +50,6 @@ Boston, MA 02111-1307, USA.  */
 #include "cfgloop.h"
 #include "except.h"
 
-
 /* Global variables used to communicate with passes.  */
 int dump_flags;
 bool in_gimple_form;
@@ -665,7 +664,35 @@ execute_pass_list (struct tree_opt_pass *pass)
   do
     {
       if (execute_one_pass (pass) && pass->sub)
-       execute_pass_list (pass->sub);
+        execute_pass_list (pass->sub);
+      pass = pass->next;
+    }
+  while (pass);
+}
+
+/* Same as execute_pass_list but assume that subpasses of IPA passes
+   are local passes.  */
+static void
+execute_ipa_pass_list (struct tree_opt_pass *pass)
+{
+  do
+    {
+      if (execute_one_pass (pass) && pass->sub)
+       {
+         struct cgraph_node *node;
+         for (node = cgraph_nodes; node; node = node->next)
+           if (node->analyzed)
+             {
+               push_cfun (DECL_STRUCT_FUNCTION (node->decl));
+               current_function_decl = node->decl;
+               execute_pass_list (pass);
+               free_dominance_info (CDI_DOMINATORS);
+               free_dominance_info (CDI_POST_DOMINATORS);
+               current_function_decl = NULL;
+               pop_cfun ();
+               ggc_collect ();
+             }
+       }
       pass = pass->next;
     }
   while (pass);
@@ -692,8 +719,10 @@ tree_lowering_passes (tree fn)
 void
 ipa_passes (void)
 {
+  cfun = NULL;
+  tree_register_cfg_hooks ();
   bitmap_obstack_initialize (NULL);
-  execute_pass_list (all_ipa_passes);
+  execute_ipa_pass_list (all_ipa_passes);
   bitmap_obstack_release (NULL);
 }
 \f