aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/wide-int.cc33
2 files changed, 40 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 59e0910..da95f72 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2017-10-18 Aldy Hernandez <aldyh@redhat.com>
+
+ * 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 <vmakarov@redhat.com>
PR middle-end/82556
diff --git a/gcc/wide-int.cc b/gcc/wide-int.cc
index 71e24ec..1a1a68c 100644
--- a/gcc/wide-int.cc
+++ b/gcc/wide-int.cc
@@ -2146,6 +2146,39 @@ template void generic_wide_int <wide_int_ref_storage <true> >::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, "<nil>\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, "<nil>\n");
+}
#if CHECKING_P