OSDN Git Service

Daily bump.
[pf3gnuchains/gcc-fork.git] / gcc / tree-dump.c
index 5467e28..3e89cdf 100644 (file)
@@ -1,6 +1,6 @@
 /* Tree-dumping functionality for intermediate representation.
-   Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
-   Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+   2010, 2011 Free Software Foundation, Inc.
    Written by Mark Mitchell <mark@codesourcery.com>
 
 This file is part of GCC.
@@ -25,14 +25,18 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm.h"
 #include "tree.h"
 #include "splay-tree.h"
-#include "diagnostic.h"
+#include "filenames.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"
+
+/* If non-NULL, return one past-the-end of the matching SUBPART of
+   the WHOLE string.  */
+#define skip_leading_substring(whole,  part) \
+   (strncmp (whole, part, strlen (part)) ? NULL : whole + strlen (part))
 
 static unsigned int queue (dump_info_p, const_tree, int);
 static void dump_index (dump_info_p, unsigned int);
@@ -356,12 +360,7 @@ dequeue_and_dump (dump_info_p di)
       xloc = expand_location (DECL_SOURCE_LOCATION (t));
       if (xloc.file)
        {
-         const char *filename = strrchr (xloc.file, '/');
-         if (!filename)
-           filename = xloc.file;
-         else
-           /* Skip the slash.  */
-           ++filename;
+         const char *filename = lbasename (xloc.file);
 
          dump_maybe_newline (di);
          fprintf (di->stream, "srcp: %s:%-6d ", filename,
@@ -372,8 +371,8 @@ dequeue_and_dump (dump_info_p di)
       if (CODE_CONTAINS_STRUCT (TREE_CODE (t), TS_DECL_COMMON)
          && DECL_ARTIFICIAL (t))
        dump_string_field (di, "note", "artificial");
-      if (TREE_CHAIN (t) && !dump_flag (di, TDF_SLIM, NULL))
-       dump_child ("chan", TREE_CHAIN (t));
+      if (DECL_CHAIN (t) && !dump_flag (di, TDF_SLIM, NULL))
+       dump_child ("chain", DECL_CHAIN (t));
     }
   else if (code_class == tcc_type)
     {
@@ -574,8 +573,6 @@ dequeue_and_dump (dump_info_p di)
     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:
     case REALPART_EXPR:
@@ -783,7 +780,8 @@ static struct dump_file_info dump_files[TDI_end] =
   {".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},
@@ -812,6 +810,7 @@ static const struct dump_option_value_info dump_options[] =
   {"raw", TDF_RAW},
   {"graph", TDF_GRAPH},
   {"details", TDF_DETAILS},
+  {"cselib", TDF_CSELIB},
   {"stats", TDF_STATS},
   {"blocks", TDF_BLOCKS},
   {"vops", TDF_VOPS},
@@ -823,9 +822,11 @@ static const struct dump_option_value_info dump_options[] =
   {"eh", TDF_EH},
   {"alias", TDF_ALIAS},
   {"nouid", TDF_NOUID},
+  {"enumerate_locals", TDF_ENUMERATE_LOCALS},
+  {"scev", TDF_SCEV},
   {"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_NOUID)},
+           | TDF_RHS_ONLY | TDF_NOUID | TDF_ENUMERATE_LOCALS | TDF_SCEV)},
   {NULL, 0}
 };
 
@@ -928,7 +929,7 @@ dump_begin (int phase, int *flag_ptr)
   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);