aboutsummaryrefslogtreecommitdiff
path: root/libgcc/libgcov-driver.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2020-06-25 11:20:52 +0200
committerMartin Liska <mliska@suse.cz>2020-06-25 11:27:12 +0200
commit88891c5ff0e3e20d3dd743c4eb6cc45399ee5c33 (patch)
treeb90351f275fb454261cfb91a278cfead392e4e48 /libgcc/libgcov-driver.c
parenta8d8caca0cbfde0317ca96bfea75a7f047152dad (diff)
downloadgcc-88891c5ff0e3e20d3dd743c4eb6cc45399ee5c33.zip
gcc-88891c5ff0e3e20d3dd743c4eb6cc45399ee5c33.tar.gz
gcc-88891c5ff0e3e20d3dd743c4eb6cc45399ee5c33.tar.bz2
gcov-tool: fix merge operation for summary
libgcc/ChangeLog: * libgcov-driver.c (merge_summary): Remove function as its name is misleading and doing something different. (dump_one_gcov): Add ATTRIBUTE_UNUSED for 2 args. Take read summary in gcov-tool. * libgcov-util.c (curr_object_summary): Remove. (read_gcda_file): Remove unused curr_object_summary. (gcov_merge): Merge summaries. * libgcov.h: Add summary argument for gcov_info struct.
Diffstat (limited to 'libgcc/libgcov-driver.c')
-rw-r--r--libgcc/libgcov-driver.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/libgcc/libgcov-driver.c b/libgcc/libgcov-driver.c
index cbfcae9..871b87b 100644
--- a/libgcc/libgcov-driver.c
+++ b/libgcc/libgcov-driver.c
@@ -442,19 +442,6 @@ write_one_data (const struct gcov_info *gi_ptr,
gcov_write_unsigned (0);
}
-/* Helper function for merging summary. */
-
-static void
-merge_summary (int run_counted, struct gcov_summary *summary,
- gcov_type run_max)
-{
- if (!run_counted)
- {
- summary->runs++;
- summary->sum_max += run_max;
- }
-}
-
/* Dump the coverage counts for one gcov_info object. We merge with existing
counts when possible, to avoid growing the .da files ad infinitum. We use
this program's checksum to make sure we only accumulate whole program
@@ -464,7 +451,8 @@ merge_summary (int run_counted, struct gcov_summary *summary,
static void
dump_one_gcov (struct gcov_info *gi_ptr, struct gcov_filename *gf,
- unsigned run_counted, gcov_type run_max)
+ unsigned run_counted ATTRIBUTE_UNUSED,
+ gcov_type run_max ATTRIBUTE_UNUSED)
{
struct gcov_summary summary = {};
int error;
@@ -492,7 +480,15 @@ dump_one_gcov (struct gcov_info *gi_ptr, struct gcov_filename *gf,
gcov_rewrite ();
- merge_summary (run_counted, &summary, run_max);
+#if !IN_GCOV_TOOL
+ if (!run_counted)
+ {
+ summary.runs++;
+ summary.sum_max += run_max;
+ }
+#else
+ summary = gi_ptr->summary;
+#endif
write_one_data (gi_ptr, &summary);
/* fall through */