aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-dump.c
diff options
context:
space:
mode:
authorPer Bothner <per@bothner.com>2004-06-30 11:11:14 -0700
committerPer Bothner <bothner@gcc.gnu.org>2004-06-30 11:11:14 -0700
commita281759fdf4cc20f179d37ef875f7c233ab68f46 (patch)
tree01829581c8eb09eede00ea3a28703fb4b3440dc5 /gcc/tree-dump.c
parent3c20847b8301eb9aa407ee8273b6e738e7067ee0 (diff)
downloadgcc-a281759fdf4cc20f179d37ef875f7c233ab68f46.zip
gcc-a281759fdf4cc20f179d37ef875f7c233ab68f46.tar.gz
gcc-a281759fdf4cc20f179d37ef875f7c233ab68f46.tar.bz2
Conditionally compile support for --enable-mapped_location.
* tree-mudflap.c (mf_file_function_line_tree): Take a location_t rather than a pointer to one. Use expand_location. (mf_varname_tree): Use expand_location. * tree-dump.c: Use expand_location on DECL_SOURCE_LOCATION. * coverage.c: Likewise. * print-tree.c: Likewise. * c-aux-info.c (gen_aux_info_record): Likewise. * c-parse.in: Use SET_EXPR_LOCATION macro. * gimple-low.c: Likewise. * tree-mudflap.c: Likewise. * gimplify.c: Likewise. Also use EXPR_LOCATION and EXPR_HAS_LOCATION. * c-ppoutput.c: Use new source_location typedef instead of fileline. * c-semantics.c: Use new macros. * c-typeck.c: Likewise. From-SVN: r83920
Diffstat (limited to 'gcc/tree-dump.c')
-rw-r--r--gcc/tree-dump.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/tree-dump.c b/gcc/tree-dump.c
index 314c29f..2e945e4 100644
--- a/gcc/tree-dump.c
+++ b/gcc/tree-dump.c
@@ -315,6 +315,7 @@ dequeue_and_dump (dump_info_p di)
}
else if (DECL_P (t))
{
+ expanded_location xloc;
/* All declarations have names. */
if (DECL_NAME (t))
dump_child ("name", DECL_NAME (t));
@@ -325,18 +326,19 @@ dequeue_and_dump (dump_info_p di)
queue_and_dump_type (di, t);
dump_child ("scpe", DECL_CONTEXT (t));
/* And a source position. */
- if (DECL_SOURCE_FILE (t))
+ xloc = expand_location (DECL_SOURCE_LOCATION (t));
+ if (xloc.file)
{
- const char *filename = strrchr (DECL_SOURCE_FILE (t), '/');
+ const char *filename = strrchr (xloc.file, '/');
if (!filename)
- filename = DECL_SOURCE_FILE (t);
+ filename = xloc.file;
else
/* Skip the slash. */
++filename;
dump_maybe_newline (di);
fprintf (di->stream, "srcp: %s:%-6d ", filename,
- DECL_SOURCE_LINE (t));
+ xloc.line);
di->column += 6 + strlen (filename) + 8;
}
/* And any declaration can be compiler-generated. */