diff options
author | Per Bothner <per@bothner.com> | 2004-06-30 11:11:14 -0700 |
---|---|---|
committer | Per Bothner <bothner@gcc.gnu.org> | 2004-06-30 11:11:14 -0700 |
commit | a281759fdf4cc20f179d37ef875f7c233ab68f46 (patch) | |
tree | 01829581c8eb09eede00ea3a28703fb4b3440dc5 /gcc/coverage.c | |
parent | 3c20847b8301eb9aa407ee8273b6e738e7067ee0 (diff) | |
download | gcc-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/coverage.c')
-rw-r--r-- | gcc/coverage.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/gcc/coverage.c b/gcc/coverage.c index e39f0a6..c67300b 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; |