summaryrefslogtreecommitdiff
path: root/gcc/tree-dump.c
diff options
context:
space:
mode:
authorbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>2004-06-30 18:11:14 +0000
committerbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>2004-06-30 18:11:14 +0000
commit2ed8b5d0fb02aeec25a8ff7cd1e48f2fafbf45f3 (patch)
tree01829581c8eb09eede00ea3a28703fb4b3440dc5 /gcc/tree-dump.c
parent9a6486a6df3ead668aa9b95d72491fba067e7c03 (diff)
downloadgcc-2ed8b5d0fb02aeec25a8ff7cd1e48f2fafbf45f3.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@83920 138bc75d-0d04-0410-961f-82ee72b054a4
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 314c29f8e8e..2e945e46143 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. */