LCOV - code coverage report
Current view: top level - gcc/analyzer - bar-chart.h (source / functions) Coverage Total Hit
Test: gcc.info Lines: 100.0 % 4 4
Test Date: 2024-12-21 13:15:12 Functions: 100.0 % 1 1
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: - 0 0

             Branch data     Line data    Source code
       1                 :             : /* Support for plotting bar charts in dumps.
       2                 :             :    Copyright (C) 2020-2024 Free Software Foundation, Inc.
       3                 :             :    Contributed by David Malcolm <dmalcolm@redhat.com>.
       4                 :             : 
       5                 :             : This file is part of GCC.
       6                 :             : 
       7                 :             : GCC is free software; you can redistribute it and/or modify it
       8                 :             : under the terms of the GNU General Public License as published by
       9                 :             : the Free Software Foundation; either version 3, or (at your option)
      10                 :             : any later version.
      11                 :             : 
      12                 :             : GCC is distributed in the hope that it will be useful, but
      13                 :             : WITHOUT ANY WARRANTY; without even the implied warranty of
      14                 :             : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      15                 :             : General Public License for more details.
      16                 :             : 
      17                 :             : You should have received a copy of the GNU General Public License
      18                 :             : along with GCC; see the file COPYING3.  If not see
      19                 :             : <http://www.gnu.org/licenses/>.  */
      20                 :             : 
      21                 :             : #ifndef GCC_ANALYZER_BAR_CHART_H
      22                 :             : #define GCC_ANALYZER_BAR_CHART_H
      23                 :             : 
      24                 :             : namespace ana {
      25                 :             : 
      26                 :             : /* A class for printing bar charts to a pretty_printer.
      27                 :             : 
      28                 :             :    TODO(stage1): move to gcc subdir? */
      29                 :             : 
      30                 :           8 : class bar_chart
      31                 :             : {
      32                 :             : public:
      33                 :             :   typedef unsigned long value_t;
      34                 :             : 
      35                 :             :   /* Add an item, taking a copy of NAME.  */
      36                 :             :   void add_item (const char *name, value_t value);
      37                 :             : 
      38                 :             :   /* Print the data to PP.  */
      39                 :             :   void print (pretty_printer *pp) const;
      40                 :             : 
      41                 :             : private:
      42                 :             :   struct item
      43                 :             :   {
      44                 :          28 :     item (const char *name, value_t value)
      45                 :          28 :     : m_name (xstrdup (name)), m_strlen (strlen (name)) , m_value (value) {}
      46                 :          28 :     ~item () { free (m_name); }
      47                 :             : 
      48                 :             :     char *m_name;
      49                 :             :     size_t m_strlen;
      50                 :             :     value_t m_value;
      51                 :             :   };
      52                 :             : 
      53                 :             :   static void print_padding (pretty_printer *pp, size_t count);
      54                 :             : 
      55                 :             :   auto_delete_vec<item> m_items;
      56                 :             : };
      57                 :             : 
      58                 :             : } // namespace ana
      59                 :             : 
      60                 :             : #endif /* GCC_ANALYZER_BAR_CHART_H */
        

Generated by: LCOV version 2.1-beta

LCOV profile is generated on x86_64 machine using following configure options: configure --disable-bootstrap --enable-coverage=opt --enable-languages=c,c++,fortran,go,jit,lto,rust,m2 --enable-host-shared. GCC test suite is run with the built compiler.