[gcc/devel/gccgo] tree-pretty-print: Handle boolean types

Ian Lance Taylor ian@gcc.gnu.org
Sun Jul 12 18:06:40 GMT 2020


https://gcc.gnu.org/g:d8bd9d32e8b3e7c2a1bb6fc920efe6691fb5e8b6

commit d8bd9d32e8b3e7c2a1bb6fc920efe6691fb5e8b6
Author: Richard Sandiford <richard.sandiford@arm.com>
Date:   Mon May 11 16:51:48 2020 +0100

    tree-pretty-print: Handle boolean types
    
    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.

Diff:
---
 gcc/ChangeLog           | 4 ++++
 gcc/tree-pretty-print.c | 8 ++++++++
 2 files changed, 12 insertions(+)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 62dc1066ab4..cf6eafd1a15 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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>
 
diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c
index 885ca8cd329..f04fd65091a 100644
--- a/gcc/tree-pretty-print.c
+++ b/gcc/tree-pretty-print.c
@@ -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


More information about the Gcc-cvs mailing list