OSDN Git Service

PR c++/48935
[pf3gnuchains/gcc-fork.git] / gcc / tree-dump.c
index beac441..039aca1 100644 (file)
@@ -1,6 +1,6 @@
 /* Tree-dumping functionality for intermediate representation.
    Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
-   2010 Free Software Foundation, Inc.
+   2010, 2011 Free Software Foundation, Inc.
    Written by Mark Mitchell <mark@codesourcery.com>
 
 This file is part of GCC.
@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm.h"
 #include "tree.h"
 #include "splay-tree.h"
+#include "filenames.h"
 #include "diagnostic-core.h"
 #include "toplev.h"
 #include "tree-dump.h"
@@ -32,6 +33,11 @@ along with GCC; see the file COPYING3.  If not see
 #include "langhooks.h"
 #include "tree-iterator.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);
 static void dequeue_and_dump (dump_info_p);
@@ -354,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,
@@ -809,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},