aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2021-12-29 17:50:28 -0500
committerJason Merrill <jason@redhat.com>2022-01-03 19:36:35 -0500
commit43359148b252b9501b0b570b8d48d02fb301b6c8 (patch)
tree49a622fde63fbba4b35df487a8c16afdebd379bd
parenta4ae8c370168bfba428ca9d475f37d19c957f4a2 (diff)
downloadgcc-43359148b252b9501b0b570b8d48d02fb301b6c8.zip
gcc-43359148b252b9501b0b570b8d48d02fb301b6c8.tar.gz
gcc-43359148b252b9501b0b570b8d48d02fb301b6c8.tar.bz2
tree-pretty-print: still indent unhandled codes
It would be nice to handle language-specific codes in the tree pretty-printer, but until then we can at least indent them appropriately. gcc/ChangeLog: * tree-pretty-print.c (do_niy): Add spc parameter. (NIY): Pass it. (print_call_name): Add spc local variable.
-rw-r--r--gcc/tree-pretty-print.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c
index c2bdfb5..3526625 100644
--- a/gcc/tree-pretty-print.c
+++ b/gcc/tree-pretty-print.c
@@ -53,19 +53,19 @@ static const char *op_symbol (const_tree);
static void newline_and_indent (pretty_printer *, int);
static void maybe_init_pretty_print (FILE *);
static void print_struct_decl (pretty_printer *, const_tree, int, dump_flags_t);
-static void do_niy (pretty_printer *, const_tree, dump_flags_t);
+static void do_niy (pretty_printer *, const_tree, int, dump_flags_t);
#define INDENT(SPACE) do { \
int i; for (i = 0; i<SPACE; i++) pp_space (pp); } while (0)
-#define NIY do_niy (pp, node, flags)
+#define NIY do_niy (pp, node, spc, flags)
static pretty_printer *tree_pp;
/* Try to print something for an unknown tree code. */
static void
-do_niy (pretty_printer *pp, const_tree node, dump_flags_t flags)
+do_niy (pretty_printer *pp, const_tree node, int spc, dump_flags_t flags)
{
int i, len;
@@ -77,8 +77,8 @@ do_niy (pretty_printer *pp, const_tree node, dump_flags_t flags)
len = TREE_OPERAND_LENGTH (node);
for (i = 0; i < len; ++i)
{
- newline_and_indent (pp, 2);
- dump_generic_node (pp, TREE_OPERAND (node, i), 2, flags, false);
+ newline_and_indent (pp, spc+2);
+ dump_generic_node (pp, TREE_OPERAND (node, i), spc+2, flags, false);
}
}
@@ -4397,6 +4397,7 @@ void
print_call_name (pretty_printer *pp, tree node, dump_flags_t flags)
{
tree op0 = node;
+ int spc = 0;
if (TREE_CODE (op0) == NON_LVALUE_EXPR)
op0 = TREE_OPERAND (op0, 0);