LCOV - code coverage report
Current view: top level - gcc/sym-exec - sym-exec-condition.cc (source / functions) Coverage Total Hit
Test: gcc.info Lines: 74.2 % 31 23
Test Date: 2026-02-28 14:20:25 Functions: 100.0 % 5 5
Legend: Lines:     hit not hit

            Line data    Source code
       1              : /* Everything defined here is used for representing conditions for bits
       2              :    and their status.
       3              :    Copyright (C) 2022-2026 Free Software Foundation, Inc.
       4              :    Contributed by Matevos Mehrabyan <matevosmehrabyan@gmail.com>
       5              : 
       6              : This file is part of GCC.
       7              : 
       8              : GCC is free software; you can redistribute it and/or modify it under
       9              : the terms of the GNU General Public License as published by the Free
      10              : Software Foundation; either version 3, or (at your option) any later
      11              : version.
      12              : 
      13              : GCC is distributed in the hope that it will be useful, but WITHOUT ANY
      14              : WARRANTY; without even the implied warranty of MERCHANTABILITY or
      15              : FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
      16              : 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              : #include "sym-exec-condition.h"
      23              : 
      24              : /* Constructor where the first argument is the bit left to the condition sign,
      25              :    the second argument is the bit right to the condition sign and the third
      26              :    argument is the code of the condition.  */
      27              : 
      28         6310 : bit_condition::bit_condition (value_bit *left, value_bit *right, tree_code code)
      29              : {
      30         6310 :   this->m_left = left;
      31         6310 :   this->m_right = right;
      32         6310 :   this->m_code = code;
      33         6310 :   m_type = BIT_CONDITION;
      34         6310 : }
      35              : 
      36              : 
      37              : /* Copy constructor.  */
      38              : 
      39         6310 : bit_condition::bit_condition (const bit_condition &expr)
      40              : {
      41         6310 :   bit_expression::copy (&expr);
      42         6310 :   m_code = expr.get_code ();
      43         6310 : }
      44              : 
      45              : 
      46              : /* Returns the condition's code.  */
      47              : 
      48              : tree_code
      49        14321 : bit_condition::get_code () const
      50              : {
      51        14321 :   return m_code;
      52              : }
      53              : 
      54              : 
      55              : /* Returns a copy of the condition.  */
      56              : 
      57              : value_bit *
      58         6310 : bit_condition::copy () const
      59              : {
      60         6310 :   return new bit_condition (*this);
      61              : }
      62              : 
      63              : 
      64              : /* Prints the condition's sign.  */
      65              : 
      66              : void
      67        10624 : bit_condition::print_expr_sign ()
      68              : {
      69        10624 :   switch (m_code)
      70              :     {
      71            0 :       case GT_EXPR:
      72            0 :         fprintf (dump_file, " > ");
      73            0 :         break;
      74            0 :       case LT_EXPR:
      75            0 :         fprintf (dump_file, " < ");
      76            0 :         break;
      77         7808 :       case EQ_EXPR:
      78         7808 :         fprintf (dump_file, " == ");
      79         7808 :         break;
      80         2816 :       case NE_EXPR:
      81         2816 :         fprintf (dump_file, " != ");
      82         2816 :         break;
      83            0 :       default:
      84            0 :         fprintf (dump_file, " ? ");
      85              :     }
      86        10624 : }
        

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