]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-pretty-print: delimit TREE_VEC with braces
authorPatrick Palka <ppalka@redhat.com>
Sat, 12 Aug 2023 01:13:52 +0000 (21:13 -0400)
committerPatrick Palka <ppalka@redhat.com>
Sat, 12 Aug 2023 01:13:52 +0000 (21:13 -0400)
This makes the generic pretty printer print braces around a TREE_VEC,
like we do for CONSTRUCTOR.  This should improve readability of nested
TREE_VECs in particular.

gcc/ChangeLog:

* tree-pretty-print.cc (dump_generic_node) <case TREE_VEC>:
Delimit output with braces.

gcc/tree-pretty-print.cc

index 51a213529d19c75fff4648e81216e69036032c96..579037b32c2f381a409c8338b63298a3fa982c80 100644 (file)
@@ -1900,6 +1900,7 @@ dump_generic_node (pretty_printer *pp, tree node, int spc, dump_flags_t flags,
     case TREE_VEC:
       {
        size_t i;
+       pp_left_brace (pp);
        if (TREE_VEC_LENGTH (node) > 0)
          {
            size_t len = TREE_VEC_LENGTH (node);
@@ -1913,6 +1914,7 @@ dump_generic_node (pretty_printer *pp, tree node, int spc, dump_flags_t flags,
            dump_generic_node (pp, TREE_VEC_ELT (node, len - 1), spc,
                               flags, false);
          }
+       pp_right_brace (pp);
       }
       break;