LCOV - code coverage report
Current view: top level - gcc/lto - lto-symtab.h (source / functions) Coverage Total Hit
Test: gcc.info Lines: 100.0 % 14 14
Test Date: 2024-05-04 14:01:55 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                 :             : /* LTO symbol table merging.
       2                 :             :    Copyright (C) 2009-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                 :             : extern void lto_symtab_merge_decls (void);
      21                 :             : extern void lto_symtab_merge_symbols (void);
      22                 :             : extern tree lto_symtab_prevailing_decl (tree decl);
      23                 :             : extern tree lto_symtab_prevailing_virtual_decl (tree decl);
      24                 :             : 
      25                 :             : /* Mark DECL to be previailed by PREVAILING.
      26                 :             :    Use DECL_LANG_FLAG_0 and DECL_CHAIN as special markers; those do not
      27                 :             :    disturb debug_tree and diagnostics.
      28                 :             :    We are safe to modify them as we wish, because the declarations disappear
      29                 :             :    from the IL after the merging.  */
      30                 :             : 
      31                 :             : inline void
      32                 :        1652 : lto_symtab_prevail_decl (tree prevailing, tree decl)
      33                 :             : {
      34                 :        1652 :   gcc_checking_assert (! DECL_LANG_FLAG_0 (decl));
      35                 :        1652 :   gcc_assert (TREE_PUBLIC (decl) || DECL_EXTERNAL (decl));
      36                 :        1652 :   DECL_CHAIN (decl) = prevailing;
      37                 :        1652 :   DECL_LANG_FLAG_0 (decl) = 1;
      38                 :        1652 : }
      39                 :             : 
      40                 :             : /* Given the decl DECL, return the prevailing decl with the same name. */
      41                 :             : 
      42                 :             : inline tree
      43                 :      421400 : lto_symtab_prevailing_decl (tree decl)
      44                 :             : {
      45                 :      421400 :   if (DECL_LANG_FLAG_0 (decl))
      46                 :        5838 :     return DECL_CHAIN (decl);
      47                 :             :   else
      48                 :             :     {
      49                 :      354850 :       if ((VAR_P (decl) || TREE_CODE (decl) == FUNCTION_DECL)
      50                 :      415562 :           && DECL_VIRTUAL_P (decl)
      51                 :        7111 :           && (TREE_PUBLIC (decl) || DECL_EXTERNAL (decl))
      52                 :      422673 :           && !symtab_node::get (decl))
      53                 :         992 :         return lto_symtab_prevailing_virtual_decl (decl);
      54                 :             :       return decl;
      55                 :             :     }
      56                 :             : }
        

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.