OSDN Git Service

PR fortran/23516
[pf3gnuchains/gcc-fork.git] / gcc / lambda.h
index 98fe6bd..9855b6f 100644 (file)
@@ -1,5 +1,5 @@
 /* Lambda matrix and vector interface.
-   Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
    Contributed by Daniel Berlin <dberlin@dberlin.org>
 
 This file is part of GCC.
@@ -16,8 +16,8 @@ for more details.
 
 You should have received a copy of the GNU General Public License
 along with GCC; see the file COPYING.  If not, write to the Free
-Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.  */
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA.  */
 
 #ifndef LAMBDA_H
 #define LAMBDA_H
@@ -196,13 +196,12 @@ lambda_body_vector lambda_body_vector_compute_new (lambda_trans_matrix,
 void print_lambda_body_vector (FILE *, lambda_body_vector);
 lambda_loopnest gcc_loopnest_to_lambda_loopnest (struct loops *,
                                                 struct loop *,
-                                                VEC(tree) **,
-                                                VEC(tree) **,
+                                                VEC(tree,heap) **,
+                                                VEC(tree,heap) **,
                                                 bool);
-void lambda_loopnest_to_gcc_loopnest (struct loop *, VEC(tree) *,
-                                     VEC(tree) *,
-                                     lambda_loopnest, 
-                                     lambda_trans_matrix);
+void lambda_loopnest_to_gcc_loopnest (struct loop *,
+                                     VEC(tree,heap) *, VEC(tree,heap) *,
+                                     lambda_loopnest, lambda_trans_matrix);
 
 
 static inline void lambda_vector_negate (lambda_vector, lambda_vector, int);
@@ -326,19 +325,15 @@ lambda_vector_min_nz (lambda_vector vec1, int n, int start)
 {
   int j;
   int min = -1;
-#ifdef ENABLE_CHECKING 
-  if (start > n)
-    abort ();
-#endif
+
+  gcc_assert (start <= n);
   for (j = start; j < n; j++)
     {
       if (vec1[j])
        if (min < 0 || vec1[j] < vec1[min])
          min = j;
     }
-
-  if (min < 0)
-    abort ();
+  gcc_assert (min >= 0);
 
   return min;
 }
@@ -381,5 +376,26 @@ print_lambda_vector (FILE * outfile, lambda_vector vector, int n)
     fprintf (outfile, "%3d ", vector[i]);
   fprintf (outfile, "\n");
 }
+
+/* Returns true when the vector V is lexicographically positive, in
+   other words, when the first nonzero element is positive.  */
+
+static inline bool
+lambda_vector_lexico_pos (lambda_vector v, 
+                         unsigned n)
+{
+  unsigned i;
+  for (i = 0; i < n; i++)
+    {
+      if (v[i] == 0)
+       continue;
+      if (v[i] < 0)
+       return false;
+      if (v[i] > 0)
+       return true;
+    }
+  return true;
+}
+
 #endif /* LAMBDA_H  */