LCOV - code coverage report
Current view: top level - libgcov - libgcov.c (source / functions) Hit Total Coverage
Test: trace.info Lines: 0 33 0.0 %
Date: 2023-02-20 11:47:12 Functions: 0 3 0.0 %

          Line data    Source code
       1             : /* Test for GCC >= 3.4.4 && <= 4.4.6 */
       2             : /*#if ( ( __GNUC__ >  3 ) || \
       3             :       ( __GNUC__ == 3 && __GNUC_MINOR__ > 4 )|| \
       4             :       ( __GNUC__ == 3 && __GNUC_MINOR__ == 4 && __GNUC_PATCHLEVEL__ >= 4 ) ) && \
       5             :     ( ( __GNUC__ <  4 ) || \
       6             :       ( __GNUC__ == 4 && __GNUC_MINOR__ < 4 )|| \
       7             :       ( __GNUC__ == 4 && __GNUC_MINOR__ == 4 && __GNUC_PATCHLEVEL__ <= 6 ) )
       8             :       */
       9             : /* Routines required for instrumenting a program.  */
      10             : /* Compile this one with gcc.  */
      11             : /* Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
      12             :    2000, 2001, 2002, 2003  Free Software Foundation, Inc.
      13             : 
      14             : This file is part of GCC.
      15             : 
      16             : GCC is free software; you can redistribute it and/or modify it under
      17             : the terms of the GNU General Public License as published by the Free
      18             : Software Foundation; either version 2, or (at your option) any later
      19             : version.
      20             : 
      21             : In addition to the permissions in the GNU General Public License, the
      22             : Free Software Foundation gives you unlimited permission to link the
      23             : compiled version of this file into combinations with other programs,
      24             : and to distribute those combinations without any restriction coming
      25             : from the use of this file.  (The General Public License restrictions
      26             : do apply in other respects; for example, they cover modification of
      27             : the file, and distribution when not linked into a combine
      28             : executable.)
      29             : 
      30             : GCC is distributed in the hope that it will be useful, but WITHOUT ANY
      31             : WARRANTY; without even the implied warranty of MERCHANTABILITY or
      32             : FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
      33             : for more details.
      34             : 
      35             : You should have received a copy of the GNU General Public License
      36             : along with GCC; see the file COPYING.  If not, write to the Free
      37             : Software Foundation, 59 Temple Place - Suite 330, Boston, MA
      38             : 02111-1307, USA.  */
      39             : 
      40             : #define GCOV_LINKAGE /* nothing */
      41             : 
      42             : #include "gcov-io.h"
      43             : 
      44             : /* Chain of per-object gcov structures.  */
      45             : struct gcov_info* gcov_list;
      46             : 
      47             : /* A program checksum allows us to distinguish program data for an
      48             :    object file included in multiple programs.  */
      49             : gcov_unsigned_t gcov_crc32;
      50             : 
      51             : /* The profile merging function that just adds the counters.  It is given
      52             :    an array COUNTERS of N_COUNTERS old counters and it reads the same number
      53             :    of counters from the gcov file.  */
      54           0 : void __gcov_merge_add(gcov_type* counters, unsigned n_counters)
      55             : {
      56           0 :     for (; n_counters; counters++, n_counters--)
      57           0 :         *counters += gcov_read_counter();
      58           0 : }
      59             : /* The profile merging function for choosing the most common value.
      60             :    It is given an array COUNTERS of N_COUNTERS old counters and it
      61             :    reads the same number of counters from the gcov file.  The counters
      62             :    are split into 3-tuples where the members of the tuple have
      63             :    meanings:
      64             : 
      65             :    -- the stored candidate on the most common value of the measured entity
      66             :    -- counter
      67             :    -- total number of evaluations of the value  */
      68           0 : void __gcov_merge_single(gcov_type* counters, unsigned n_counters)
      69             : {
      70             :     unsigned i, n_measures;
      71             :     gcov_type value, counter, all;
      72             : 
      73             :     GCOV_CHECK(!(n_counters % 3));
      74           0 :     n_measures = n_counters / 3;
      75           0 :     for (i = 0; i < n_measures; i++, counters += 3)
      76             :     {
      77           0 :         value = gcov_read_counter();
      78           0 :         counter = gcov_read_counter();
      79           0 :         all = gcov_read_counter();
      80             : 
      81           0 :         if (counters[0] == value)
      82           0 :             counters[1] += counter;
      83           0 :         else if (counter > counters[1])
      84             :         {
      85           0 :             counters[0] = value;
      86           0 :             counters[1] = counter - counters[1];
      87             :         }
      88             :         else
      89           0 :             counters[1] -= counter;
      90           0 :         counters[2] += all;
      91             :     }
      92           0 : }
      93             : 
      94             : /* The profile merging function for choosing the most common
      95             :    difference between two consecutive evaluations of the value.  It is
      96             :    given an array COUNTERS of N_COUNTERS old counters and it reads the
      97             :    same number of counters from the gcov file.  The counters are split
      98             :    into 4-tuples where the members of the tuple have meanings:
      99             : 
     100             :    -- the last value of the measured entity
     101             :    -- the stored candidate on the most common difference
     102             :    -- counter
     103             :    -- total number of evaluations of the value  */
     104             : 
     105           0 : void __gcov_merge_delta(gcov_type* counters, unsigned n_counters)
     106             : {
     107             :     unsigned i, n_measures;
     108             :     gcov_type last, value, counter, all;
     109             : 
     110             :     GCOV_CHECK(!(n_counters % 4));
     111           0 :     n_measures = n_counters / 4;
     112           0 :     for (i = 0; i < n_measures; i++, counters += 4)
     113             :     {
     114           0 :         last = gcov_read_counter();
     115           0 :         value = gcov_read_counter();
     116           0 :         counter = gcov_read_counter();
     117           0 :         all = gcov_read_counter();
     118             : 
     119           0 :         if (counters[1] == value)
     120           0 :             counters[2] += counter;
     121           0 :         else if (counter > counters[2])
     122             :         {
     123           0 :             counters[1] = value;
     124           0 :             counters[2] = counter - counters[2];
     125             :         }
     126             :         else
     127           0 :             counters[2] -= counter;
     128           0 :         counters[3] += all;
     129             :     }
     130           0 : }
     131             : //#endif /* __GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__ */

Generated by: LCOV version 1.14