From: Nathan Sidwell Date: Mon, 2 Nov 2020 16:38:30 +0000 (-0800) Subject: core: debug-print whole call expr X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f8a737930bb0bd0714970cf04ea0463fddb5c6ef;p=gcc.git 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. --- diff --git a/gcc/print-tree.c b/gcc/print-tree.c index d1150e472d5..84bf8199b1e 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