/* Prints out tree in human readable form - GCC
- Copyright (C) 1990-2013 Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
This file is part of GCC.
#include "coretypes.h"
#include "tm.h"
#include "tree.h"
+#include "varasm.h"
+#include "print-rtl.h"
+#include "stor-layout.h"
#include "ggc.h"
#include "langhooks.h"
#include "tree-iterator.h"
#include "tree-cfg.h"
#include "tree-dump.h"
#include "dumpfile.h"
+#include "wide-int-print.h"
/* Define the hash table of nodes already seen.
Such nodes are not repeated; brief cross-references are used. */
fprintf (file, " overflow");
fprintf (file, " ");
- if (TREE_INT_CST_HIGH (node) == 0)
- fprintf (file, HOST_WIDE_INT_PRINT_UNSIGNED, TREE_INT_CST_LOW (node));
- else if (TREE_INT_CST_HIGH (node) == -1
- && TREE_INT_CST_LOW (node) != 0)
- fprintf (file, "-" HOST_WIDE_INT_PRINT_UNSIGNED,
- -TREE_INT_CST_LOW (node));
- else
- fprintf (file, HOST_WIDE_INT_PRINT_DOUBLE_HEX,
- (unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (node),
- (unsigned HOST_WIDE_INT) TREE_INT_CST_LOW (node));
+ print_dec (node, file, TYPE_SIGN (TREE_TYPE (node)));
}
if (TREE_CODE (node) == REAL_CST)
{
if (TREE_VISITED (node))
fputs (" visited", file);
- if (code != TREE_VEC && code != SSA_NAME)
+ if (code != TREE_VEC && code != INTEGER_CST && code != SSA_NAME)
{
if (TREE_LANG_FLAG_0 (node))
fputs (" tree_0", file);
fputs (" common", file);
if (code == VAR_DECL && DECL_THREAD_LOCAL_P (node))
{
- enum tls_model kind = DECL_TLS_MODEL (node);
- switch (kind)
- {
- case TLS_MODEL_GLOBAL_DYNAMIC:
- fputs (" tls-global-dynamic", file);
- break;
- case TLS_MODEL_LOCAL_DYNAMIC:
- fputs (" tls-local-dynamic", file);
- break;
- case TLS_MODEL_INITIAL_EXEC:
- fputs (" tls-initial-exec", file);
- break;
- case TLS_MODEL_LOCAL_EXEC:
- fputs (" tls-local-exec", file);
- break;
- default:
- gcc_unreachable ();
- }
+ fputs (" ", file);
+ fputs (tls_model_names[DECL_TLS_MODEL (node)], file);
}
if (CODE_CONTAINS_STRUCT (code, TS_DECL_COMMON))
}
if (CODE_CONTAINS_STRUCT (code, TS_DECL_NON_COMMON))
{
- print_node (file, "arguments", DECL_ARGUMENT_FLD (node), indent + 4);
print_node (file, "result", DECL_RESULT_FLD (node), indent + 4);
}
else if (code == FUNCTION_DECL
&& DECL_STRUCT_FUNCTION (node) != 0)
{
+ print_node (file, "arguments", DECL_ARGUMENTS (node), indent + 4);
indent_to (file, indent + 4);
dump_addr (file, "struct-function ", DECL_STRUCT_FUNCTION (node));
}
if (TYPE_UNSIGNED (node))
fputs (" unsigned", file);
- /* The no-force-blk flag is used for different things in
- different types. */
- if ((code == RECORD_TYPE
- || code == UNION_TYPE
- || code == QUAL_UNION_TYPE)
- && TYPE_NO_FORCE_BLK (node))
+ if (TYPE_NO_FORCE_BLK (node))
fputs (" no-force-blk", file);
if (TYPE_STRING_FLAG (node))
fputs (" string-flag", file);
+
if (TYPE_NEEDS_CONSTRUCTING (node))
fputs (" needs-constructing", file);
fprintf (file, " overflow");
fprintf (file, " ");
- if (TREE_INT_CST_HIGH (node) == 0)
- fprintf (file, HOST_WIDE_INT_PRINT_UNSIGNED,
- TREE_INT_CST_LOW (node));
- else if (TREE_INT_CST_HIGH (node) == -1
- && TREE_INT_CST_LOW (node) != 0)
- fprintf (file, "-" HOST_WIDE_INT_PRINT_UNSIGNED,
- -TREE_INT_CST_LOW (node));
- else
- fprintf (file, HOST_WIDE_INT_PRINT_DOUBLE_HEX,
- (unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (node),
- (unsigned HOST_WIDE_INT) TREE_INT_CST_LOW (node));
+ print_dec (node, file, TYPE_SIGN (TREE_TYPE (node)));
break;
case REAL_CST:
fprintf (file, ">");
}
-/* Print the tree vector VEC in full on file FILE, preceded by PREFIX,
- starting in column INDENT. */
-
-void
-print_vec_tree (FILE *file, const char *prefix, vec<tree, va_gc> *vec, int indent)
-{
- tree elt;
- unsigned ix;
-
- /* Indent to the specified column, since this is the long form. */
- indent_to (file, indent);
-
- /* Print the slot this node is in, and its code, and address. */
- fprintf (file, "%s <VEC", prefix);
- dump_addr (file, " ", vec->address ());
-
- FOR_EACH_VEC_ELT (*vec, ix, elt)
- {
- char temp[10];
- sprintf (temp, "elt %d", ix);
- print_node (file, temp, elt, indent + 4);
- }
-}
-
/* Print the node NODE on standard error, for debugging.
Most nodes referred to by this one are printed recursively