From e61a4f52126624a6fdd0c63e9f39b53095190a77 Mon Sep 17 00:00:00 2001 From: Aldy Hernandez Date: Wed, 18 Oct 2017 19:49:08 +0000 Subject: [PATCH] wide-int.cc (debug): New. * wide-int.cc (debug) [const wide_int &]: New. (debug) [const wide_int *]: New. (debug) [const widest_int &]: New. (debug) [const widest_int *]: New. From-SVN: r253866 --- gcc/ChangeLog | 7 +++++++ gcc/wide-int.cc | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 59e0910f8a7..da95f722c8e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2017-10-18 Aldy Hernandez + + * wide-int.cc (debug) [const wide_int &]: New. + (debug) [const wide_int *]: New. + (debug) [const widest_int &]: New. + (debug) [const widest_int *]: New. + 2017-10-18 Vladimir Makarov PR middle-end/82556 diff --git a/gcc/wide-int.cc b/gcc/wide-int.cc index 71e24ec22af..1a1a68c1943 100644 --- a/gcc/wide-int.cc +++ b/gcc/wide-int.cc @@ -2146,6 +2146,39 @@ template void generic_wide_int >::dump () const; template void offset_int::dump () const; template void widest_int::dump () const; +/* We could add all the above ::dump variants here, but wide_int and + widest_int should handle the common cases. Besides, you can always + call the dump method directly. */ + +DEBUG_FUNCTION void +debug (const wide_int &ref) +{ + ref.dump (); +} + +DEBUG_FUNCTION void +debug (const wide_int *ptr) +{ + if (ptr) + debug (*ptr); + else + fprintf (stderr, "\n"); +} + +DEBUG_FUNCTION void +debug (const widest_int &ref) +{ + ref.dump (); +} + +DEBUG_FUNCTION void +debug (const widest_int *ptr) +{ + if (ptr) + debug (*ptr); + else + fprintf (stderr, "\n"); +} #if CHECKING_P -- 2.30.2