Add make_restrict_var_constraints
authorTom de Vries <tom@codesourcery.com>
Mon, 26 Oct 2015 10:47:09 +0000 (10:47 +0000)
committerTom de Vries <vries@gcc.gnu.org>
Mon, 26 Oct 2015 10:47:09 +0000 (10:47 +0000)
2015-10-26  Tom de Vries  <tom@codesourcery.com>

* tree-ssa-structalias.c (make_restrict_var_constraints): New function,
factored out of ...
(intra_create_variable_infos): ... here.

From-SVN: r229324

gcc/ChangeLog
gcc/tree-ssa-structalias.c

index e4a8b88981c42445dd78878b8f3934360e2cd289..8084f4b749c1c093085745b0bedf4464196c0a34 100644 (file)
@@ -1,3 +1,9 @@
+2015-10-26  Tom de Vries  <tom@codesourcery.com>
+
+       * tree-ssa-structalias.c (make_restrict_var_constraints): New function,
+       factored out of ...
+       (intra_create_variable_infos): ... here.
+
 2015-10-26  Tom de Vries  <tom@codesourcery.com>
 
        * tree-ssa-structalias.c (intra_create_variable_infos): Add
index 1e1ae95a297ed80c5304aeeb6677035cb01ac162..63a3d0265e63f5a501b85511e821aa7d8b80cda7 100644 (file)
@@ -5844,6 +5844,21 @@ debug_solution_for_var (unsigned int var)
   dump_solution_for_var (stderr, var);
 }
 
+/* Register the constraints for restrict var VI.  */
+
+static void
+make_restrict_var_constraints (varinfo_t vi)
+{
+  for (; vi; vi = vi_next (vi))
+    if (vi->may_have_pointers)
+      {
+       if (vi->only_restrict_pointers)
+         make_constraint_from_global_restrict (vi, "GLOBAL_RESTRICT");
+       else
+         make_copy_constraint (vi, nonlocal_id);
+      }
+}
+
 /* Create varinfo structures for all of the variables in the
    function for intraprocedural mode.  */
 
@@ -5882,14 +5897,7 @@ intra_create_variable_infos (struct function *fn)
          vi->is_restrict_var = 1;
          insert_vi_for_tree (heapvar, vi);
          make_constraint_from (p, vi->id);
-         for (; vi; vi = vi_next (vi))
-           if (vi->may_have_pointers)
-             {
-               if (vi->only_restrict_pointers)
-                 make_constraint_from_global_restrict (vi, "GLOBAL_RESTRICT");
-               else
-                 make_copy_constraint (vi, nonlocal_id);
-             }
+         make_restrict_var_constraints (vi);
          continue;
        }