aboutsummaryrefslogtreecommitdiff
path: root/gcc/pretty-print.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2017-12-20 12:51:57 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2017-12-20 12:51:57 +0000
commitdc3f38050535e8904dce2fd02c6efb6cf91eea3d (patch)
tree07db92271531d8b8b511202edb0dfe43cec24bc0 /gcc/pretty-print.c
parent36fd64086542ed734aded849304723218fa4d6fd (diff)
downloadgcc-dc3f38050535e8904dce2fd02c6efb6cf91eea3d.zip
gcc-dc3f38050535e8904dce2fd02c6efb6cf91eea3d.tar.gz
gcc-dc3f38050535e8904dce2fd02c6efb6cf91eea3d.tar.bz2
poly_int: dump routines
2017-12-20 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * dumpfile.h (dump_dec): Declare. * dumpfile.c (dump_dec): New function. * pretty-print.h (pp_wide_integer): Turn into a function and declare a poly_int version. * pretty-print.c (pp_wide_integer): New function for poly_ints. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r255864
Diffstat (limited to 'gcc/pretty-print.c')
-rw-r--r--gcc/pretty-print.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/pretty-print.c b/gcc/pretty-print.c
index 1fbd2fe..0c328d0 100644
--- a/gcc/pretty-print.c
+++ b/gcc/pretty-print.c
@@ -795,6 +795,30 @@ pp_clear_state (pretty_printer *pp)
pp_indentation (pp) = 0;
}
+/* Print X to PP in decimal. */
+template<unsigned int N, typename T>
+void
+pp_wide_integer (pretty_printer *pp, const poly_int_pod<N, T> &x)
+{
+ if (x.is_constant ())
+ pp_wide_integer (pp, x.coeffs[0]);
+ else
+ {
+ pp_left_bracket (pp);
+ for (unsigned int i = 0; i < N; ++i)
+ {
+ if (i != 0)
+ pp_comma (pp);
+ pp_wide_integer (pp, x.coeffs[i]);
+ }
+ pp_right_bracket (pp);
+ }
+}
+
+template void pp_wide_integer (pretty_printer *, const poly_uint16_pod &);
+template void pp_wide_integer (pretty_printer *, const poly_int64_pod &);
+template void pp_wide_integer (pretty_printer *, const poly_uint64_pod &);
+
/* Flush the formatted text of PRETTY-PRINTER onto the attached stream. */
void
pp_write_text_to_stream (pretty_printer *pp)