aboutsummaryrefslogtreecommitdiff
path: root/gcc/coverage.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2014-06-04 11:31:25 +0200
committerMartin Liska <marxin@gcc.gnu.org>2014-06-04 09:31:25 +0000
commita96bf0d3ceb411299cc5dedfc7705de9ac21988a (patch)
treeba3780120bafe130806deba7072ed5222d5dc54b /gcc/coverage.c
parent7d2268ead3f156afba5c23c563b9690f9f59012e (diff)
downloadgcc-a96bf0d3ceb411299cc5dedfc7705de9ac21988a.zip
gcc-a96bf0d3ceb411299cc5dedfc7705de9ac21988a.tar.gz
gcc-a96bf0d3ceb411299cc5dedfc7705de9ac21988a.tar.bz2
Make coverage_compute_cfg_checksum callable with arg.
* coverage.h (coverage_compute_cfg_checksum): Argument added. * coverage.c (coverage_compute_cfg_checksum): Likewise. * profile.c (branch_prob): Likewise. From-SVN: r211217
Diffstat (limited to 'gcc/coverage.c')
-rw-r--r--gcc/coverage.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/coverage.c b/gcc/coverage.c
index 5e9005e..44b616c 100644
--- a/gcc/coverage.c
+++ b/gcc/coverage.c
@@ -583,7 +583,7 @@ coverage_compute_profile_id (struct cgraph_node *n)
return chksum & 0x7fffffff;
}
-/* Compute cfg checksum for the current function.
+/* Compute cfg checksum for the function FN given as argument.
The checksum is calculated carefully so that
source code changes that doesn't affect the control flow graph
won't change the checksum.
@@ -594,12 +594,12 @@ coverage_compute_profile_id (struct cgraph_node *n)
but the compiler won't detect the change and use the wrong profile data. */
unsigned
-coverage_compute_cfg_checksum (void)
+coverage_compute_cfg_checksum (struct function *fn)
{
basic_block bb;
- unsigned chksum = n_basic_blocks_for_fn (cfun);
+ unsigned chksum = n_basic_blocks_for_fn (fn);
- FOR_EACH_BB_FN (bb, cfun)
+ FOR_EACH_BB_FN (bb, fn)
{
edge e;
edge_iterator ei;