/* Tree-dumping functionality for intermediate representation.
- Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007, 2008
- Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+ 2010 Free Software Foundation, Inc.
Written by Mark Mitchell <mark@codesourcery.com>
This file is part of GCC.
#include "tm.h"
#include "tree.h"
#include "splay-tree.h"
-#include "diagnostic.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "tree-dump.h"
#include "tree-pass.h"
#include "langhooks.h"
#include "tree-iterator.h"
-#include "real.h"
-#include "fixed-value.h"
static unsigned int queue (dump_info_p, const_tree, int);
static void dump_index (dump_info_p, unsigned int);
dump_child ("cnst", DECL_INITIAL (t));
break;
+ case DEBUG_EXPR_DECL:
+ dump_int (di, "-uid", DEBUG_TEMP_UID (t));
+ /* Fall through. */
+
case VAR_DECL:
case PARM_DECL:
case FIELD_DECL:
case TRUTH_NOT_EXPR:
case ADDR_EXPR:
case INDIRECT_REF:
- case ALIGN_INDIRECT_REF:
case MISALIGNED_INDIRECT_REF:
case CLEANUP_POINT_EXPR:
case SAVE_EXPR:
{".gimple", "tree-gimple", NULL, TDF_TREE, 0, 4},
{".nested", "tree-nested", NULL, TDF_TREE, 0, 5},
{".vcg", "tree-vcg", NULL, TDF_TREE, 0, 6},
-#define FIRST_AUTO_NUMBERED_DUMP 7
+ {".ads", "ada-spec", NULL, 0, 0, 7},
+#define FIRST_AUTO_NUMBERED_DUMP 8
{NULL, "tree-all", NULL, TDF_TREE, 0, 0},
{NULL, "rtl-all", NULL, TDF_RTL, 0, 0},
static const struct dump_option_value_info dump_options[] =
{
{"address", TDF_ADDRESS},
+ {"asmname", TDF_ASMNAME},
{"slim", TDF_SLIM},
{"raw", TDF_RAW},
{"graph", TDF_GRAPH},
{"stmtaddr", TDF_STMTADDR},
{"memsyms", TDF_MEMSYMS},
{"verbose", TDF_VERBOSE},
- {"all", ~(TDF_RAW | TDF_SLIM | TDF_LINENO | TDF_TREE | TDF_RTL | TDF_IPA
+ {"eh", TDF_EH},
+ {"alias", TDF_ALIAS},
+ {"nouid", TDF_NOUID},
+ {"all", ~(TDF_RAW | TDF_SLIM | TDF_LINENO | TDF_TREE | TDF_RTL | TDF_IPA
| TDF_STMTADDR | TDF_GRAPH | TDF_DIAGNOSTIC | TDF_VERBOSE
- | TDF_RHS_ONLY)},
+ | TDF_RHS_ONLY | TDF_NOUID)},
{NULL, 0}
};
/* Return the dump_file_info for the given phase. */
struct dump_file_info *
-get_dump_file_info (enum tree_dump_index phase)
+get_dump_file_info (int phase)
{
if (phase < TDI_end)
return &dump_files[phase];
- else if (phase - TDI_end >= extra_dump_files_in_use)
+ else if ((size_t) (phase - TDI_end) >= extra_dump_files_in_use)
return NULL;
else
return extra_dump_files + (phase - TDI_end);
If the dump is not enabled, returns NULL. */
char *
-get_dump_file_name (enum tree_dump_index phase)
+get_dump_file_name (int phase)
{
char dump_id[10];
struct dump_file_info *dfi;
Multiple calls will reopen and append to the dump file. */
FILE *
-dump_begin (enum tree_dump_index phase, int *flag_ptr)
+dump_begin (int phase, int *flag_ptr)
{
char *name;
struct dump_file_info *dfi;
dfi = get_dump_file_info (phase);
stream = fopen (name, dfi->state < 0 ? "w" : "a");
if (!stream)
- error ("could not open dump file %qs: %s", name, strerror (errno));
+ error ("could not open dump file %qs: %m", name);
else
dfi->state = 1;
free (name);
TDI_tree_all, return nonzero if any dump is enabled. */
int
-dump_enabled_p (enum tree_dump_index phase)
+dump_enabled_p (int phase)
{
if (phase == TDI_tree_all)
{
/* Returns nonzero if tree dump PHASE has been initialized. */
int
-dump_initialized_p (enum tree_dump_index phase)
+dump_initialized_p (int phase)
{
struct dump_file_info *dfi = get_dump_file_info (phase);
return dfi->state > 0;
/* Returns the switch name of PHASE. */
const char *
-dump_flag_name (enum tree_dump_index phase)
+dump_flag_name (int phase)
{
struct dump_file_info *dfi = get_dump_file_info (phase);
return dfi->swtch;
dump_begin. */
void
-dump_end (enum tree_dump_index phase ATTRIBUTE_UNUSED, FILE *stream)
+dump_end (int phase ATTRIBUTE_UNUSED, FILE *stream)
{
fclose (stream);
}
const char *option_value;
const char *ptr;
int flags;
-
+
if (doglob && !dfi->glob)
return 0;
for (i = 0; i < extra_dump_files_in_use; i++)
any |= dump_switch_p_1 (arg, &extra_dump_files[i], false);
-
+
if (!any)
for (i = 0; i < extra_dump_files_in_use; i++)
any |= dump_switch_p_1 (arg, &extra_dump_files[i], true);
/* Dump FUNCTION_DECL FN as tree dump PHASE. */
void
-dump_function (enum tree_dump_index phase, tree fn)
+dump_function (int phase, tree fn)
{
FILE *stream;
int flags;
{
return dump_enable_all (TDF_RTL | TDF_DETAILS | TDF_BLOCKS) > 0;
}
-
-