summaryrefslogtreecommitdiff
path: root/gcc/lambda.h
diff options
context:
space:
mode:
authorspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>2005-08-23 08:24:20 +0000
committerspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>2005-08-23 08:24:20 +0000
commitffe944fa4d599f56a68cb542a0eb6184f0414c29 (patch)
tree519608c83e01fb34fcdea8849d3554eaca59bf38 /gcc/lambda.h
parent1d7c087e8b9c917fc33169a61d7a300432cdf784 (diff)
downloadgcc-ffe944fa4d599f56a68cb542a0eb6184f0414c29.tar.gz
* lambda-code.c (lambda_vector_lexico_pos): Moved...
* lambda.h (lambda_vector_lexico_pos): ... here. * tree-data-ref.c (build_classic_dist_vector): Return false when the distance vector is lexicographically negative. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103392 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lambda.h')
-rw-r--r--gcc/lambda.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/lambda.h b/gcc/lambda.h
index dea12ef6098..9855b6f73ed 100644
--- a/gcc/lambda.h
+++ b/gcc/lambda.h
@@ -376,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 */