]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/tree-dump.c
Lower VEC_COND_EXPR into internal functions.
[thirdparty/gcc.git] / gcc / tree-dump.c
index e89ddf6a36ac9a127237bef4ebf06f4e2a34db2c..d2049053e733229a46b1c0876dd542e5be6ecda3 100644 (file)
@@ -1,5 +1,5 @@
 /* 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.
@@ -21,15 +21,11 @@ along with GCC; see the file COPYING3.  If not see
 #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);
@@ -156,22 +152,6 @@ dump_maybe_newline (dump_info_p di)
     }
 }
 
-/* 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
@@ -357,7 +337,8 @@ dequeue_and_dump (dump_info_p di)
       /* 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))
@@ -510,7 +491,6 @@ dequeue_and_dump (dump_info_p di)
        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;
@@ -539,8 +519,7 @@ dequeue_and_dump (dump_info_p di)
          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))
@@ -562,7 +541,7 @@ dequeue_and_dump (dump_info_p di)
 
     case INTEGER_CST:
       fprintf (di->stream, "int: ");
-      print_decs (t, di->stream);
+      print_decs (wi::to_wide (t), di->stream);
       break;
 
     case STRING_CST:
@@ -582,6 +561,7 @@ dequeue_and_dump (dump_info_p di)
     case ADDR_EXPR:
     case INDIRECT_REF:
     case CLEANUP_POINT_EXPR:
+    case VIEW_CONVERT_EXPR:
     case SAVE_EXPR:
     case REALPART_EXPR:
     case IMAGPART_EXPR:
@@ -625,6 +605,7 @@ dequeue_and_dump (dump_info_p di)
       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;
@@ -649,7 +630,7 @@ dequeue_and_dump (dump_info_p di)
       {
        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);
@@ -704,10 +685,6 @@ dequeue_and_dump (dump_info_p di)
     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:
       {
@@ -733,7 +710,7 @@ dequeue_and_dump (dump_info_p di)
 /* 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);
 }
@@ -741,7 +718,7 @@ int dump_flag (dump_info_p di, int flag, const_tree 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;
@@ -757,7 +734,7 @@ dump_node (const_tree t, int flags, FILE *stream)
   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);