diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2017-12-20 12:51:57 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2017-12-20 12:51:57 +0000 |
commit | dc3f38050535e8904dce2fd02c6efb6cf91eea3d (patch) | |
tree | 07db92271531d8b8b511202edb0dfe43cec24bc0 /gcc/dumpfile.c | |
parent | 36fd64086542ed734aded849304723218fa4d6fd (diff) |
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/dumpfile.c')
-rw-r--r-- | gcc/dumpfile.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/dumpfile.c b/gcc/dumpfile.c index 4a59d601044..a49ff997ea4 100644 --- a/gcc/dumpfile.c +++ b/gcc/dumpfile.c @@ -473,6 +473,27 @@ dump_printf_loc (dump_flags_t dump_kind, source_location loc, } } +/* Output VALUE in decimal to appropriate dump streams. */ + +template<unsigned int N, typename C> +void +dump_dec (int dump_kind, const poly_int<N, C> &value) +{ + STATIC_ASSERT (poly_coeff_traits<C>::signedness >= 0); + signop sgn = poly_coeff_traits<C>::signedness ? SIGNED : UNSIGNED; + if (dump_file && (dump_kind & pflags)) + print_dec (value, dump_file, sgn); + + if (alt_dump_file && (dump_kind & alt_flags)) + print_dec (value, alt_dump_file, sgn); +} + +template void dump_dec (int, const poly_uint16 &); +template void dump_dec (int, const poly_int64 &); +template void dump_dec (int, const poly_uint64 &); +template void dump_dec (int, const poly_offset_int &); +template void dump_dec (int, const poly_widest_int &); + /* Start a dump for PHASE. Store user-supplied dump flags in *FLAG_PTR. Return the number of streams opened. Set globals DUMP_FILE, and ALT_DUMP_FILE to point to the opened streams, and |