]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-pretty-print: Handle boolean types
authorRichard Sandiford <richard.sandiford@arm.com>
Mon, 11 May 2020 15:51:48 +0000 (16:51 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Mon, 11 May 2020 15:51:48 +0000 (16:51 +0100)
AVX512-style masks and SVE-style predicates can be difficult
to debug in gimple dumps, since the types are printed like this:

  vector(4) <unnamed type> foo;

Some important details are hidden by that <unnamed type>,
such as the number of bits in an element and whether the type
is signed or unsigned.

This patch uses an ad-hoc syntax for printing unnamed
boolean types.  Normal frontend ones should be handled
by the earlier TYPE_NAME code.

2020-05-11  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* tree-pretty-print.c (dump_generic_node): Handle BOOLEAN_TYPEs.

gcc/ChangeLog
gcc/tree-pretty-print.c

index 62dc1066ab4e97c8d7ba1f741acde1c80d5e0474..cf6eafd1a15c6387c24a40ca5da5a6359041fc13 100644 (file)
@@ -1,3 +1,7 @@
+2020-05-11  Richard Sandiford  <richard.sandiford@arm.com>
+
+       * tree-pretty-print.c (dump_generic_node): Handle BOOLEAN_TYPEs.
+
 2020-05-11  Kelvin Nilsen  <kelvin@gcc.gnu.org>
            Bill Schmidt  <wschmidt@linux.ibm.com>
 
index 885ca8cd32951de6e619c9aa716a0c372b15a0b5..f04fd65091aa9f2a2f86a7c237d77fa1aa77d40a 100644 (file)
@@ -1761,6 +1761,14 @@ dump_generic_node (pretty_printer *pp, tree node, int spc, dump_flags_t flags,
                pp_decimal_int (pp, TYPE_PRECISION (node));
                pp_greater (pp);
              }
+           else if (TREE_CODE (node) == BOOLEAN_TYPE)
+             {
+               pp_string (pp, (TYPE_UNSIGNED (node)
+                               ? "<unsigned-boolean:"
+                               : "<signed-boolean:"));
+               pp_decimal_int (pp, TYPE_PRECISION (node));
+               pp_greater (pp);
+             }
            else if (TREE_CODE (node) == VOID_TYPE)
              pp_string (pp, "void");
            else