aboutsummaryrefslogtreecommitdiff
path: root/gcc/print-tree.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2020-11-02 08:38:30 -0800
committerNathan Sidwell <nathan@acm.org>2020-11-02 08:56:38 -0800
commitf8a737930bb0bd0714970cf04ea0463fddb5c6ef (patch)
treecc31ef58d14288c08f0f068cd8e8f1b389a94cb4 /gcc/print-tree.c
parente9a2e208dd763bf71b0cc9db8526ef8f47ee289e (diff)
downloadgcc-f8a737930bb0bd0714970cf04ea0463fddb5c6ef.zip
gcc-f8a737930bb0bd0714970cf04ea0463fddb5c6ef.tar.gz
gcc-f8a737930bb0bd0714970cf04ea0463fddb5c6ef.tar.bz2
core: debug-print whole call expr
In debugging some call-expr handling, I got confused because the debug printer elided NULL call operands. This changes the printer to display them as NULL. gcc/ * print-tree.c (print_node): Display all the operands of a call expr.
Diffstat (limited to 'gcc/print-tree.c')
-rw-r--r--gcc/print-tree.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/gcc/print-tree.c b/gcc/print-tree.c
index d1150e4..84bf819 100644
--- a/gcc/print-tree.c
+++ b/gcc/print-tree.c
@@ -742,20 +742,26 @@ print_node (FILE *file, const char *prefix, tree node, int indent,
}
if (code == CALL_EXPR)
{
- call_expr_arg_iterator iter;
- tree arg;
print_node (file, "fn", CALL_EXPR_FN (node), indent + 4);
print_node (file, "static_chain", CALL_EXPR_STATIC_CHAIN (node),
indent + 4);
- i = 0;
- FOR_EACH_CALL_EXPR_ARG (arg, iter, node)
+
+ call_expr_arg_iterator iter;
+ init_call_expr_arg_iterator (node, &iter);
+ while (more_call_expr_args_p (&iter))
{
/* Buffer big enough to format a 32-bit UINT_MAX into, plus
the text. */
char temp[15];
- sprintf (temp, "arg:%u", i);
- print_node (file, temp, arg, indent + 4);
- i++;
+ sprintf (temp, "arg:%u", iter.i);
+ tree arg = next_call_expr_arg (&iter);
+ if (arg)
+ print_node (file, temp, arg, indent + 4);
+ else
+ {
+ indent_to (file, indent + 4);
+ fprintf (file, "%s NULL", temp);
+ }
}
}
else