aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-affine.c
diff options
context:
space:
mode:
authorAndrew Pinski <pinskia@gmail.com>2007-08-18 13:53:02 -0700
committerAndrew Pinski <pinskia@gcc.gnu.org>2007-08-18 13:53:02 -0700
commitea336dd510bf20b5a3e3d7da84c8108c42e44b63 (patch)
tree7ae0a361840bc2824923927c3b59ff16ea8325e2 /gcc/tree-affine.c
parentcda5e672d80cf69da6901c62ec155a0731277b95 (diff)
downloadgcc-ea336dd510bf20b5a3e3d7da84c8108c42e44b63.zip
gcc-ea336dd510bf20b5a3e3d7da84c8108c42e44b63.tar.gz
gcc-ea336dd510bf20b5a3e3d7da84c8108c42e44b63.tar.bz2
tree-affine.h (print_aff): New prototype.
2007-08-18 Andrew Pinski <pinskia@gmail.com> * tree-affine.h (print_aff): New prototype. (debug_aff): Likewise. * tree-affine.c (print_aff): New function. (debug_aff): Likewise. From-SVN: r127615
Diffstat (limited to 'gcc/tree-affine.c')
-rw-r--r--gcc/tree-affine.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/gcc/tree-affine.c b/gcc/tree-affine.c
index 0f19587..b6c47d6 100644
--- a/gcc/tree-affine.c
+++ b/gcc/tree-affine.c
@@ -719,3 +719,48 @@ aff_combination_constant_multiple_p (aff_tree *val, aff_tree *div,
gcc_assert (mult_set);
return true;
}
+
+/* Prints the affine VAL to the FILE. */
+
+void
+print_aff (FILE *file, aff_tree *val)
+{
+ unsigned i;
+ bool uns = TYPE_UNSIGNED (val->type);
+ if (POINTER_TYPE_P (val->type))
+ uns = false;
+ fprintf (file, "{\n type = ");
+ print_generic_expr (file, val->type, TDF_VOPS|TDF_MEMSYMS);
+ fprintf (file, "\n offset = ");
+ dump_double_int (file, val->offset, uns);
+ if (val->n > 0)
+ {
+ fprintf (file, "\n elements = {\n");
+ for (i = 0; i < val->n; i++)
+ {
+ fprintf (file, " [%d] = ", i);
+ print_generic_expr (file, val->elts[i].val, TDF_VOPS|TDF_MEMSYMS);
+
+ fprintf (file, " * ");
+ dump_double_int (file, val->elts[i].coef, uns);
+ if (i != val->n - 1)
+ fprintf (file, ", \n");
+ }
+ fprintf (file, "\n }");
+ }
+ if (val->rest)
+ {
+ fprintf (file, "\n rest = ");
+ print_generic_expr (file, val->rest, TDF_VOPS|TDF_MEMSYMS);
+ }
+ fprintf (file, "\n}");
+}
+
+/* Prints the affine VAL to the standard error, used for debugging. */
+
+void
+debug_aff (aff_tree *val)
+{
+ print_aff (stderr, val);
+ fprintf (stderr, "\n");
+}