]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Make coverage_compute_cfg_checksum callable with arg.
authorMartin Liska <mliska@suse.cz>
Wed, 4 Jun 2014 09:31:25 +0000 (11:31 +0200)
committerMartin Liska <marxin@gcc.gnu.org>
Wed, 4 Jun 2014 09:31:25 +0000 (09:31 +0000)
* coverage.h (coverage_compute_cfg_checksum): Argument added.
* coverage.c (coverage_compute_cfg_checksum): Likewise.
* profile.c (branch_prob): Likewise.

From-SVN: r211217

gcc/ChangeLog
gcc/coverage.c
gcc/coverage.h
gcc/profile.c

index a4ae5a2a3ea5da571ceb6e6648b5de41e632ecca..853a0346a9ba422b4ee164bff4868226160e66d9 100644 (file)
@@ -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
index 5e9005eb1b89a49e6bc129387fa0ed64a037aad1..44b616c7872a7ec711eb638b570cf105af3fc791 100644 (file)
@@ -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;
index 81f87a6f0bbe11cbe185f2b661172c7b2f5b9758..a144e0b86a08d80e4381cdabb5541b9767d14766 100644 (file)
@@ -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);
index 3282ee7a3c40ab762c811a86939bdc6441653664..4e82eab1138aa43fcb4fdafd799476b78dba5e90 100644 (file)
@@ -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