LCOV - code coverage report
Current view: top level - gcc/analyzer - symbolic-memory-offsets.h Coverage Total Hit
Test: gcc.info Lines: 100.0 % 5 5
Test Date: 2026-12-05 16:10:02 Functions: - 0 0
Legend: Lines:     hit not hit

            Line data    Source code
       1              : /* A (cluster_region, symbolic bit offset) pair for representing
       2              :    where a region starts in memory.
       3              :    Copyright (C) 2026 Free Software Foundation, Inc.
       4              :    Contributed by David Malcolm <dmalcolm@redhat.com>.
       5              : 
       6              : This file is part of GCC.
       7              : 
       8              : GCC is free software; you can redistribute it and/or modify it
       9              : under the terms of the GNU General Public License as published by
      10              : the Free Software Foundation; either version 3, or (at your option)
      11              : any later version.
      12              : 
      13              : GCC is distributed in the hope that it will be useful, but
      14              : WITHOUT ANY WARRANTY; without even the implied warranty of
      15              : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      16              : General Public License for more details.
      17              : 
      18              : You should have received a copy of the GNU General Public License
      19              : along with GCC; see the file COPYING3.  If not see
      20              : <http://www.gnu.org/licenses/>.  */
      21              : 
      22              : #ifndef GCC_ANALYZER_SYMBOLIC_MEMORY_OFFSETS_H
      23              : #define GCC_ANALYZER_SYMBOLIC_MEMORY_OFFSETS_H
      24              : 
      25              : #include "analyzer/symbolic-ranges.h"
      26              : 
      27              : namespace ana {
      28              : namespace symbolic {
      29              : 
      30              : /* A (cluster_region, symbolic bit offset) pair for representing
      31              :    where a region starts in memory.
      32              :    Note that these have a granularity of *bits*.  */
      33              : 
      34              : class memory_offset
      35              : {
      36              : public:
      37              :   using symbolic_bit_offset = symbolic::scalar<integer_with_unit<units::bit>>;
      38              : 
      39       152279 :   memory_offset (const cluster_region &cluster_reg,
      40              :                  const symbolic_bit_offset &bit_offset)
      41         3354 :   : m_cluster_reg (cluster_reg),
      42         3354 :     m_bit_offset (bit_offset)
      43              :   {
      44              :   }
      45              : 
      46              :   void dump () const;
      47              : 
      48              :   bool
      49              :   operator== (const memory_offset &other) const
      50              :   {
      51              :     return (&m_cluster_reg == &other.m_cluster_reg
      52              :             && &m_bit_offset == &other.m_bit_offset);
      53              :   }
      54              : 
      55              :   bool
      56              :   operator!= (const memory_offset &other) const
      57              :   {
      58              :     return !(*this == other);
      59              :   }
      60              : 
      61              :   int
      62              :   cmp (const memory_offset &other) const;
      63              : 
      64              :   bool
      65              :   zero_offset_p () const
      66              :   {
      67              :     return m_bit_offset.is_zero_p ();
      68              :   }
      69              : 
      70              :   bool non_null_p () const;
      71              : 
      72              :   std::unique_ptr<text_art::tree_widget>
      73              :   make_dump_widget (node_dump_state &nds) const;
      74              : 
      75              :   void
      76              :   accept_node_visitor (symbolic::node_visitor &v) const;
      77              : 
      78              :   std::unique_ptr<json::object>
      79              :   to_json () const;
      80              : 
      81              :   /* Deprecated (poor terminology); use get_cluster_region instead.  */
      82              :   const cluster_region &
      83       425827 :   get_base_region () const { return m_cluster_reg; }
      84              : 
      85              :   const cluster_region &
      86              :   get_cluster_region () const { return m_cluster_reg; }
      87              : 
      88              :   const symbolic_bit_offset &
      89       426529 :   get_bit_offset () const { return m_bit_offset; }
      90              : 
      91              : private:
      92              :   const cluster_region &m_cluster_reg;
      93              :   const symbolic_bit_offset &m_bit_offset;
      94              : };
      95              : 
      96              : } // namespace ana::symbolic
      97              : 
      98              : } // namespace ana
      99              : 
     100              : #endif /* GCC_ANALYZER_SYMBOLIC_MEMORY_OFFSETS_H */
        

Generated by: LCOV version 2.6-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.