diff options
author | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-04-24 09:46:17 +0000 |
---|---|---|
committer | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-04-24 09:46:17 +0000 |
commit | 3f2c2dd8bcd38bd0773b6136df705b314cb244de (patch) | |
tree | 1dff424ee79b2287699dd3e721d653f4dbfa039f /gcc/gcov.c | |
parent | fd68dbde67e4a8c062be5ec69549bdef45853def (diff) | |
download | gcc-3f2c2dd8bcd38bd0773b6136df705b314cb244de.tar.gz |
New GCOV_TAG_FUNCTION layout
* coverage.c (struct function_list): Replace name with ident.
(struct counts_entry): Likewise.
(fn_ident): New.
(htab_counts_entry_hash, htab_counts_entry_eq,
htab_counts_entry_del): Adjust.
(reads_count_file, get_coverage_counts,
coverage_begin_output, coverage_end_function): Adjust.
(build_fn_info_type, build_fn_info_value): Likewise.
* gcov-dump.c (tag_function): Adjust.
* gcov-io.c (gcov_write_string, gcov_read_string): Not in LIBGCOV.
* gcov-io.h (gcov_write_string, gcov_read_string): Not in LIBGCOV.
* gcov.c (struct function_info): Add ident.
(read_graph_file, read_count_file): Adjust.
* libgcov.c (gcov_exit): Adjust.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@66035 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcov.c')
-rw-r--r-- | gcc/gcov.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/gcc/gcov.c b/gcc/gcov.c index 572292364b2..40e16cf92ed 100644 --- a/gcc/gcov.c +++ b/gcc/gcov.c @@ -168,6 +168,7 @@ typedef struct function_info { /* Name of function. */ char *name; + unsigned ident; unsigned checksum; /* Array of basic blocks. */ @@ -744,21 +745,23 @@ read_graph_file () unsigned tag = gcov_read_unsigned (); unsigned length = gcov_read_unsigned (); unsigned long base = gcov_position (); - + if (tag == GCOV_TAG_FUNCTION) { char *function_name; - unsigned checksum, lineno; + unsigned ident, checksum, lineno; source_t *src; function_t *probe, *prev; - function_name = xstrdup (gcov_read_string ()); + ident = gcov_read_unsigned (); checksum = gcov_read_unsigned (); + function_name = xstrdup (gcov_read_string ()); src = find_source (gcov_read_string ()); lineno = gcov_read_unsigned (); fn = (function_t *)xcalloc (1, sizeof (function_t)); fn->name = function_name; + fn->ident = ident; fn->checksum = checksum; fn->src = src; fn->line = lineno; @@ -1015,7 +1018,7 @@ read_count_file () program_count++; else if (tag == GCOV_TAG_FUNCTION) { - const char *function_name = gcov_read_string (); + unsigned ident = gcov_read_unsigned (); struct function_info *fn_n = functions; for (fn = fn ? fn->next : NULL; ; fn = fn->next) @@ -1026,11 +1029,11 @@ read_count_file () fn_n = NULL; else { - fnotice (stderr, "%s:unknown function `%s'\n", - da_file_name, function_name); + fnotice (stderr, "%s:unknown function `%u'\n", + da_file_name, ident); break; } - if (!strcmp (fn->name, function_name)) + if (fn->ident == ident) break; } |