summaryrefslogtreecommitdiff
path: root/gcc/coverage.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/coverage.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/coverage.c')
-rw-r--r--gcc/coverage.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/gcc/coverage.c b/gcc/coverage.c
index e39f0a66cc7..c67300b8a7c 100644
--- a/gcc/coverage.c
+++ b/gcc/coverage.c
@@ -500,10 +500,11 @@ coverage_checksum_string (unsigned chksum, const char *string)
static unsigned
compute_checksum (void)
{
- unsigned chksum = DECL_SOURCE_LINE (current_function_decl);
+ expanded_location xloc
+ = expand_location (DECL_SOURCE_LOCATION (current_function_decl));
+ unsigned chksum = xloc.line;
- chksum = coverage_checksum_string (chksum,
- DECL_SOURCE_FILE (current_function_decl));
+ chksum = coverage_checksum_string (chksum, xloc.file);
chksum = coverage_checksum_string
(chksum, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (current_function_decl)));
@@ -523,8 +524,8 @@ coverage_begin_output (void)
if (!bbg_function_announced)
{
- const char *file = DECL_SOURCE_FILE (current_function_decl);
- unsigned line = DECL_SOURCE_LINE (current_function_decl);
+ expanded_location xloc
+ = expand_location (DECL_SOURCE_LOCATION (current_function_decl));
unsigned long offset;
if (!bbg_file_opened)
@@ -546,8 +547,8 @@ coverage_begin_output (void)
gcov_write_unsigned (compute_checksum ());
gcov_write_string (IDENTIFIER_POINTER
(DECL_ASSEMBLER_NAME (current_function_decl)));
- gcov_write_string (file);
- gcov_write_unsigned (line);
+ gcov_write_string (xloc.file);
+ gcov_write_unsigned (xloc.line);
gcov_write_length (offset);
bbg_function_announced = 1;