/* Tree-dumping functionality for intermediate representation.
- Copyright (C) 1999-2015 Free Software Foundation, Inc.
+ Copyright (C) 1999-2020 Free Software Foundation, Inc.
Written by Mark Mitchell <mark@codesourcery.com>
This file is part of GCC.
#include "config.h"
#include "system.h"
#include "coretypes.h"
-#include "tm.h"
#include "tree.h"
#include "tree-pretty-print.h"
-#include "alias.h"
-#include "splay-tree.h"
#include "tree-dump.h"
#include "langhooks.h"
#include "tree-iterator.h"
-#include "tree-cfg.h"
static unsigned int queue (dump_info_p, const_tree, int);
static void dump_index (dump_info_p, unsigned int);
}
}
-/* Dump FUNCTION_DECL FN as tree dump PHASE. */
-
-void
-dump_function (int phase, tree fn)
-{
- FILE *stream;
- int flags;
-
- stream = dump_begin (phase, &flags);
- if (stream)
- {
- dump_function_to_file (fn, stream, flags);
- dump_end (phase, stream);
- }
-}
-
/* Dump pointer PTR using FIELD to identify it. */
void
/* All declarations have names. */
if (DECL_NAME (t))
dump_child ("name", DECL_NAME (t));
- if (DECL_ASSEMBLER_NAME_SET_P (t)
+ if (HAS_DECL_ASSEMBLER_NAME_P (t)
+ && DECL_ASSEMBLER_NAME_SET_P (t)
&& DECL_ASSEMBLER_NAME (t) != DECL_NAME (t))
dump_child ("mngl", DECL_ASSEMBLER_NAME (t));
if (DECL_ABSTRACT_ORIGIN (t))
dump_string_field (di, "tag", "union");
dump_child ("flds", TYPE_FIELDS (t));
- dump_child ("fncs", TYPE_METHODS (t));
queue_and_dump_index (di, "binf", TYPE_BINFO (t),
DUMP_BINFO);
break;
if (DECL_FIELD_OFFSET (t))
dump_child ("bpos", bit_position (t));
}
- else if (TREE_CODE (t) == VAR_DECL
- || TREE_CODE (t) == PARM_DECL)
+ else if (VAR_P (t) || TREE_CODE (t) == PARM_DECL)
{
dump_int (di, "used", TREE_USED (t));
if (DECL_REGISTER (t))
case INTEGER_CST:
fprintf (di->stream, "int: ");
- print_decs (t, di->stream);
+ print_decs (wi::to_wide (t), di->stream);
break;
case STRING_CST:
case ADDR_EXPR:
case INDIRECT_REF:
case CLEANUP_POINT_EXPR:
+ case VIEW_CONVERT_EXPR:
case SAVE_EXPR:
case REALPART_EXPR:
case IMAGPART_EXPR:
break;
case TRY_FINALLY_EXPR:
+ case EH_ELSE_EXPR:
dump_child ("op 0", TREE_OPERAND (t, 0));
dump_child ("op 1", TREE_OPERAND (t, 1));
break;
{
unsigned HOST_WIDE_INT cnt;
tree index, value;
- dump_int (di, "lngt", vec_safe_length (CONSTRUCTOR_ELTS (t)));
+ dump_int (di, "lngt", CONSTRUCTOR_NELTS (t));
FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (t), cnt, index, value)
{
dump_child ("idx", index);
case SWITCH_EXPR:
dump_child ("cond", TREE_OPERAND (t, 0));
dump_child ("body", TREE_OPERAND (t, 1));
- if (TREE_OPERAND (t, 2))
- {
- dump_child ("labl", TREE_OPERAND (t,2));
- }
break;
case OMP_CLAUSE:
{
/* Return nonzero if FLAG has been specified for the dump, and NODE
is not the root node of the dump. */
-int dump_flag (dump_info_p di, int flag, const_tree node)
+int dump_flag (dump_info_p di, dump_flags_t flag, const_tree node)
{
return (di->flags & flag) && (node != di->node);
}
/* Dump T, and all its children, on STREAM. */
void
-dump_node (const_tree t, int flags, FILE *stream)
+dump_node (const_tree t, dump_flags_t flags, FILE *stream)
{
struct dump_info di;
dump_queue_p dq;
di.flags = flags;
di.node = t;
di.nodes = splay_tree_new (splay_tree_compare_pointers, 0,
- (splay_tree_delete_value_fn) &free);
+ splay_tree_delete_pointers);
/* Queue up the first node. */
queue (&di, t, DUMP_NONE);