aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2009-05-31 18:01:38 -0400
committerJason Merrill <jason@gcc.gnu.org>2009-05-31 18:01:38 -0400
commit1aec401ee5c1eb7d5caeac74d0cfb6b26e3590f1 (patch)
tree5f90478fcda78e3b4eeae78c8fb673395269e315
parented7910bb1513a00096fa7215bc3affd186eb7e9e (diff)
downloadgcc-1aec401ee5c1eb7d5caeac74d0cfb6b26e3590f1.zip
gcc-1aec401ee5c1eb7d5caeac74d0cfb6b26e3590f1.tar.gz
gcc-1aec401ee5c1eb7d5caeac74d0cfb6b26e3590f1.tar.bz2
tree-pretty-print.c (print_call_name): Take the callee, not the call itself.
* tree-pretty-print.c (print_call_name): Take the callee, not the call itself. Make non-static. Use dump_function_name for functions. (dump_generic_node): Adjust. * diagnostic.h: Declare print_call_name. * gimple-pretty-print.c (dump_gimple_call): Use it. From-SVN: r148019
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/diagnostic.h1
-rw-r--r--gcc/gimple-pretty-print.c2
-rw-r--r--gcc/tree-pretty-print.c22
4 files changed, 21 insertions, 13 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 800f69d..54dc9b7 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+2009-05-31 Jason Merrill <jason@redhat.com>
+
+ * tree-pretty-print.c (print_call_name): Take the callee, not the
+ call itself. Make non-static. Use dump_function_name for
+ functions.
+ (dump_generic_node): Adjust.
+ * diagnostic.h: Declare print_call_name.
+ * gimple-pretty-print.c (dump_gimple_call): Use it.
+
2009-05-31 Kaz Kojima <kkojima@gcc.gnu.org>
* config/sh/sh.md (ashldi3_std): New define_expand.
diff --git a/gcc/diagnostic.h b/gcc/diagnostic.h
index 998c11e..aa9aaf8 100644
--- a/gcc/diagnostic.h
+++ b/gcc/diagnostic.h
@@ -226,6 +226,7 @@ extern void print_generic_expr (FILE *, tree, int);
extern void print_generic_decl (FILE *, tree, int);
extern void debug_c_tree (tree);
extern void dump_omp_clauses (pretty_printer *, tree, int, int);
+extern void print_call_name (pretty_printer *, tree);
/* In gimple-pretty-print.c */
extern void debug_generic_expr (tree);
diff --git a/gcc/gimple-pretty-print.c b/gcc/gimple-pretty-print.c
index ec366f8..6a5190e 100644
--- a/gcc/gimple-pretty-print.c
+++ b/gcc/gimple-pretty-print.c
@@ -508,7 +508,7 @@ dump_gimple_call (pretty_printer *buffer, gimple gs, int spc, int flags)
pp_space (buffer);
}
- dump_generic_node (buffer, gimple_call_fn (gs), spc, flags, false);
+ print_call_name (buffer, gimple_call_fn (gs));
pp_string (buffer, " (");
dump_gimple_call_args (buffer, gs, flags);
pp_character (buffer, ')');
diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c
index 02b6365..0599e3c 100644
--- a/gcc/tree-pretty-print.c
+++ b/gcc/tree-pretty-print.c
@@ -40,7 +40,6 @@ along with GCC; see the file COPYING3. If not see
/* Local functions, macros and variables. */
static const char *op_symbol (const_tree);
static void pretty_print_string (pretty_printer *, const char*);
-static void print_call_name (pretty_printer *, 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, int);
@@ -1329,7 +1328,7 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
break;
case CALL_EXPR:
- print_call_name (buffer, node);
+ print_call_name (buffer, CALL_EXPR_FN (node));
/* Print parameters. */
pp_space (buffer);
@@ -2662,32 +2661,31 @@ op_symbol (const_tree op)
return op_symbol_code (TREE_CODE (op));
}
-/* Prints the name of a CALL_EXPR. */
+/* Prints the name of a call. NODE is the CALL_EXPR_FN of a CALL_EXPR or
+ the gimple_call_fn of a GIMPLE_CALL. */
-static void
-print_call_name (pretty_printer *buffer, const_tree node)
+void
+print_call_name (pretty_printer *buffer, tree node)
{
- tree op0;
-
- gcc_assert (TREE_CODE (node) == CALL_EXPR);
-
- op0 = CALL_EXPR_FN (node);
+ tree op0 = node;
if (TREE_CODE (op0) == NON_LVALUE_EXPR)
op0 = TREE_OPERAND (op0, 0);
+ again:
switch (TREE_CODE (op0))
{
case VAR_DECL:
case PARM_DECL:
+ case FUNCTION_DECL:
dump_function_name (buffer, op0);
break;
case ADDR_EXPR:
case INDIRECT_REF:
case NOP_EXPR:
- dump_generic_node (buffer, TREE_OPERAND (op0, 0), 0, 0, false);
- break;
+ op0 = TREE_OPERAND (op0, 0);
+ goto again;
case COND_EXPR:
pp_string (buffer, "(");