diff options
author | marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-06-04 09:31:25 +0000 |
---|---|---|
committer | marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-06-04 09:31:25 +0000 |
commit | a06672d436603b0533c5ff28b30bd64c794cc9eb (patch) | |
tree | ba3780120bafe130806deba7072ed5222d5dc54b /gcc | |
parent | 5cb7c8cf9860d39ab7d499b1a6c0f9c5ec4263bd (diff) | |
download | gcc-a06672d436603b0533c5ff28b30bd64c794cc9eb.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@211217 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/coverage.c | 8 | ||||
-rw-r--r-- | gcc/coverage.h | 4 | ||||
-rw-r--r-- | gcc/profile.c | 2 |
4 files changed, 13 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a4ae5a2a3ea..853a0346a9b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-06-04 Martin Liska <mliska@suse.cz> + + * coverage.h (coverage_compute_cfg_checksum): Argument added. + * coverage.c (coverage_compute_cfg_checksum): Likewise. + * profile.c (branch_prob): Likewise. + 2014-06-04 Martin Jambor <mjambor@suse.cz> PR ipa/61340 diff --git a/gcc/coverage.c b/gcc/coverage.c index 5e9005eb1b8..44b616c7872 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; diff --git a/gcc/coverage.h b/gcc/coverage.h index 81f87a6f0bb..a144e0b86a0 100644 --- a/gcc/coverage.h +++ b/gcc/coverage.h @@ -32,8 +32,8 @@ extern int coverage_begin_function (unsigned, unsigned); /* Complete the coverage information for the current function. */ extern void coverage_end_function (unsigned, unsigned); -/* Compute the control flow checksum for the current function. */ -extern unsigned coverage_compute_cfg_checksum (void); +/* Compute the control flow checksum for the function FN given as argument. */ +extern unsigned coverage_compute_cfg_checksum (struct function *fn); /* Compute the profile id of function N. */ extern unsigned coverage_compute_profile_id (struct cgraph_node *n); diff --git a/gcc/profile.c b/gcc/profile.c index 3282ee7a3c4..4e82eab1138 100644 --- a/gcc/profile.c +++ b/gcc/profile.c @@ -1195,7 +1195,7 @@ branch_prob (void) the checksum in only once place, since it depends on the shape of the control flow which can change during various transformations. */ - cfg_checksum = coverage_compute_cfg_checksum (); + cfg_checksum = coverage_compute_cfg_checksum (cfun); lineno_checksum = coverage_compute_lineno_checksum (); /* Write the data from which gcov can reconstruct the basic block |