diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2003-04-24 09:46:17 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2003-04-24 09:46:17 +0000 |
commit | 796621e8c274bfce5c7f3f1d23126267b91f102f (patch) | |
tree | 1dff424ee79b2287699dd3e721d653f4dbfa039f /gcc/libgcov.c | |
parent | 374ca7f74e476db1cf06296eea9ca4bce8b2264a (diff) | |
download | gcc-796621e8c274bfce5c7f3f1d23126267b91f102f.zip gcc-796621e8c274bfce5c7f3f1d23126267b91f102f.tar.gz gcc-796621e8c274bfce5c7f3f1d23126267b91f102f.tar.bz2 |
New GCOV_TAG_FUNCTION layout
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.
From-SVN: r66035
Diffstat (limited to 'gcc/libgcov.c')
-rw-r--r-- | gcc/libgcov.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/gcc/libgcov.c b/gcc/libgcov.c index a2c831e..a406114 100644 --- a/gcc/libgcov.c +++ b/gcc/libgcov.c @@ -203,7 +203,8 @@ gcov_exit (void) } /* Merge execution counts for each function. */ - for (f_ix = gi_ptr->n_functions, fi_ptr = gi_ptr->functions; f_ix--; + for (f_ix = gi_ptr->n_functions, fi_ptr = gi_ptr->functions; + f_ix--; fi_ptr = (const struct gcov_fn_info *) ((const char *) fi_ptr + fi_stride)) { @@ -211,19 +212,17 @@ gcov_exit (void) length = gcov_read_unsigned (); /* Check function */ - if (tag != GCOV_TAG_FUNCTION) + if (tag != GCOV_TAG_FUNCTION + || gcov_read_unsigned () != fi_ptr->ident + || gcov_read_unsigned () != fi_ptr->checksum) { read_mismatch:; fprintf (stderr, "profiling:%s:Merge mismatch for %s\n", gi_ptr->filename, - fi_ptr ? fi_ptr->name : "summaries"); + f_ix + 1 ? "function" : "summaries"); goto read_fatal; } - if (strcmp (gcov_read_string (), fi_ptr->name) - || gcov_read_unsigned () != fi_ptr->checksum) - goto read_mismatch; - for (c_ix = t_ix = 0; t_ix != GCOV_COUNTERS; t_ix++) if ((1 << t_ix) & gi_ptr->ctr_mask) { @@ -284,9 +283,8 @@ gcov_exit (void) if (!summary_pos) memset (&program, 0, sizeof (program)); - fi_ptr = 0; - /* Merge the summaries. */ + f_ix = ~0u; for (t_ix = c_ix = 0, cs_obj = object.ctrs, cs_tobj = this_object.ctrs, cs_prg = program.ctrs, cs_tprg = this_program.ctrs, @@ -346,7 +344,7 @@ gcov_exit (void) { /* Announce function. */ base = gcov_write_tag (GCOV_TAG_FUNCTION); - gcov_write_string (fi_ptr->name); + gcov_write_unsigned (fi_ptr->ident); gcov_write_unsigned (fi_ptr->checksum); gcov_write_length (base); |