LCOV - code coverage report
Current view: top level - gcc - tree-phinodes.h (source / functions) Coverage Total Hit
Test: gcc.info Lines: 100.0 % 15 15
Test Date: 2024-04-20 14:03:02 Functions: 100.0 % 2 2
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: - 0 0

             Branch data     Line data    Source code
       1                 :             : /* Header file for PHI node routines
       2                 :             :    Copyright (C) 2013-2024 Free Software Foundation, Inc.
       3                 :             : 
       4                 :             : This file is part of GCC.
       5                 :             : 
       6                 :             : GCC is free software; you can redistribute it and/or modify it under
       7                 :             : the terms of the GNU General Public License as published by the Free
       8                 :             : Software Foundation; either version 3, or (at your option) any later
       9                 :             : version.
      10                 :             : 
      11                 :             : GCC is distributed in the hope that it will be useful, but WITHOUT ANY
      12                 :             : WARRANTY; without even the implied warranty of MERCHANTABILITY or
      13                 :             : FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
      14                 :             :  for more details.
      15                 :             : 
      16                 :             : You should have received a copy of the GNU General Public License
      17                 :             : along with GCC; see the file COPYING3.  If not see
      18                 :             : <http://www.gnu.org/licenses/>.  */
      19                 :             : 
      20                 :             : #ifndef GCC_TREE_PHINODES_H
      21                 :             : #define GCC_TREE_PHINODES_H
      22                 :             : 
      23                 :             : extern void phinodes_print_statistics (void);
      24                 :             : extern void reserve_phi_args_for_new_edge (basic_block);
      25                 :             : extern gphi *create_phi_node (tree, basic_block);
      26                 :             : extern void add_phi_arg (gphi *, tree, edge, location_t);
      27                 :             : extern void remove_phi_args (edge);
      28                 :             : extern void remove_phi_node (gimple_stmt_iterator *, bool);
      29                 :             : extern void remove_phi_nodes (basic_block);
      30                 :             : extern tree degenerate_phi_result (gphi *);
      31                 :             : extern void set_phi_nodes (basic_block, gimple_seq);
      32                 :             : 
      33                 :             : inline use_operand_p
      34                 :  1835640359 : gimple_phi_arg_imm_use_ptr (gimple *gs, int i)
      35                 :             : {
      36                 :  2033407160 :   return &gimple_phi_arg (gs, i)->imm_use;
      37                 :             : }
      38                 :             : 
      39                 :             : inline use_operand_p
      40                 :   216633484 : gimple_phi_arg_imm_use_ptr_from_edge (gimple *gs, const_edge e)
      41                 :             : {
      42                 :   216633484 :   gcc_checking_assert (e->dest == gimple_bb (gs));
      43                 :   216633484 :   return &gimple_phi_arg (gs, e->dest_idx)->imm_use;
      44                 :             : }
      45                 :             : 
      46                 :             : /* Return the phi argument which contains the specified use.  */
      47                 :             : 
      48                 :             : inline int
      49                 :   190776036 : phi_arg_index_from_use (use_operand_p use)
      50                 :             : {
      51                 :   190776036 :   struct phi_arg_d *element, *root;
      52                 :   190776036 :   size_t index;
      53                 :   190776036 :   gimple *phi;
      54                 :             : 
      55                 :             :   /* Since the use is the first thing in a PHI argument element, we can
      56                 :             :      calculate its index based on casting it to an argument, and performing
      57                 :             :      pointer arithmetic.  */
      58                 :             : 
      59                 :   190776036 :   phi = USE_STMT (use);
      60                 :             : 
      61                 :   190776036 :   element = (struct phi_arg_d *)use;
      62                 :   190776036 :   root = gimple_phi_arg (phi, 0);
      63                 :   190776036 :   index = element - root;
      64                 :             : 
      65                 :             :   /* Make sure the calculation doesn't have any leftover bytes.  If it does,
      66                 :             :      then imm_use is likely not the first element in phi_arg_d.  */
      67                 :   381552072 :   gcc_checking_assert ((((char *)element - (char *)root)
      68                 :             :                         % sizeof (struct phi_arg_d)) == 0
      69                 :             :                        && index < gimple_phi_capacity (phi));
      70                 :             : 
      71                 :   190776036 :  return index;
      72                 :             : }
      73                 :             : 
      74                 :             : #endif /* GCC_TREE_PHINODES_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.