LCOV - code coverage report
Current view: top level - gcc - range.cc (source / functions) Hit Total Coverage
Test: gcc.info Lines: 5 17 29.4 %
Date: 2020-03-28 11:57:23 Functions: 2 4 50.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : /* Misc range functions.
       2                 :            :    Copyright (C) 2017-2020 Free Software Foundation, Inc.
       3                 :            :    Contributed by Aldy Hernandez <aldyh@redhat.com>.
       4                 :            : 
       5                 :            : This file is part of GCC.
       6                 :            : 
       7                 :            : GCC is free software; you can redistribute it and/or modify it under
       8                 :            : the terms of the GNU General Public License as published by the Free
       9                 :            : Software Foundation; either version 3, or (at your option) any later
      10                 :            : version.
      11                 :            : 
      12                 :            : GCC is distributed in the hope that it will be useful, but WITHOUT ANY
      13                 :            : WARRANTY; without even the implied warranty of MERCHANTABILITY or
      14                 :            : FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
      15                 :            :  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                 :            : #include "config.h"
      22                 :            : #include "system.h"
      23                 :            : #include "coretypes.h"
      24                 :            : #include "backend.h"
      25                 :            : #include "tree.h"
      26                 :            : #include "gimple.h"
      27                 :            : #include "gimple-pretty-print.h"
      28                 :            : #include "fold-const.h"
      29                 :            : #include "ssa.h"
      30                 :            : #include "range.h"
      31                 :            : 
      32                 :            : value_range
      33                 :     311562 : range_zero (tree type)
      34                 :            : {
      35                 :     311562 :   return value_range (build_zero_cst (type), build_zero_cst (type));
      36                 :            : }
      37                 :            : 
      38                 :            : value_range
      39                 :    2347770 : range_nonzero (tree type)
      40                 :            : {
      41                 :    2347770 :   return value_range (build_zero_cst (type), build_zero_cst (type),
      42                 :    2347770 :                       VR_ANTI_RANGE);
      43                 :            : }
      44                 :            : 
      45                 :            : value_range
      46                 :          0 : range_positives (tree type)
      47                 :            : {
      48                 :          0 :   unsigned prec = TYPE_PRECISION (type);
      49                 :          0 :   signop sign = TYPE_SIGN (type);
      50                 :          0 :   return value_range (type, wi::zero (prec), wi::max_value (prec, sign));
      51                 :            : }
      52                 :            : 
      53                 :            : value_range
      54                 :          0 : range_negatives (tree type)
      55                 :            : {
      56                 :          0 :   unsigned prec = TYPE_PRECISION (type);
      57                 :          0 :   signop sign = TYPE_SIGN (type);
      58                 :          0 :   value_range r;
      59                 :          0 :   if (sign == UNSIGNED)
      60                 :          0 :     r.set_undefined ();
      61                 :            :   else
      62                 :          0 :     r = value_range (type, wi::min_value (prec, sign), wi::minus_one (prec));
      63                 :          0 :   return r;
      64                 :            : }

Generated by: LCOV version 1.0

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 --enable-host-shared. GCC test suite is run with the built compiler.