LCOV - code coverage report
Current view: top level - gcc - run-rtl-passes.c (source / functions) Hit Total Coverage
Test: gcc.info Lines: 23 23 100.0 %
Date: 2020-03-28 11:57:23 Functions: 1 1 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : /* run-rtl-passes.c - Run RTL passes directly from frontend
       2                 :            :    Copyright (C) 2016-2020 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                 :            : #include "config.h"
      21                 :            : #include "system.h"
      22                 :            : #include "coretypes.h"
      23                 :            : #include "target.h"
      24                 :            : #include "rtl.h"
      25                 :            : #include "function.h"
      26                 :            : #include "basic-block.h"
      27                 :            : #include "tree-pass.h"
      28                 :            : #include "context.h"
      29                 :            : #include "pass_manager.h"
      30                 :            : #include "bitmap.h"
      31                 :            : #include "df.h"
      32                 :            : #include "regs.h"
      33                 :            : #include "output.h"
      34                 :            : #include "debug.h" /* for debug_hooks.  */
      35                 :            : #include "insn-attr-common.h" /* for INSN_SCHEDULING.  */
      36                 :            : #include "insn-attr.h" /* for init_sched_attrs.  */
      37                 :            : #include "run-rtl-passes.h"
      38                 :            : 
      39                 :            : /* Run the backend passes, starting at the given pass.
      40                 :            :    Take ownership of INITIAL_PASS_NAME.  */
      41                 :            : 
      42                 :            : void
      43                 :         16 : run_rtl_passes (char *initial_pass_name)
      44                 :            : {
      45                 :         16 :   cfun->pass_startwith = initial_pass_name;
      46                 :         16 :   max_regno = max_reg_num ();
      47                 :            : 
      48                 :            :   /* cgraphunit.c normally handles this.  */
      49                 :         16 :   switch_to_section (text_section);
      50                 :         16 :   (*debug_hooks->assembly_start) ();
      51                 :            : 
      52                 :         16 :   if (initial_pass_name)
      53                 :            :     {
      54                 :            :       /* Pass "expand" normally sets this up.  */
      55                 :            : #ifdef INSN_SCHEDULING
      56                 :         14 :       init_sched_attrs ();
      57                 :            : #endif
      58                 :         14 :       bitmap_obstack_initialize (NULL);
      59                 :         14 :       bitmap_obstack_initialize (&reg_obstack);
      60                 :         14 :       opt_pass *rest_of_compilation
      61                 :         14 :         = g->get_passes ()->get_rest_of_compilation ();
      62                 :         14 :       gcc_assert (rest_of_compilation);
      63                 :         14 :       execute_pass_list (cfun, rest_of_compilation);
      64                 :            : 
      65                 :         14 :       opt_pass *clean_slate = g->get_passes ()->get_clean_slate ();
      66                 :         14 :       gcc_assert (clean_slate);
      67                 :         14 :       execute_pass_list (cfun, clean_slate);
      68                 :         14 :       bitmap_obstack_release (&reg_obstack);
      69                 :            :     }
      70                 :            :   else
      71                 :            :     {
      72                 :          2 :       opt_pass *clean_slate = g->get_passes ()->get_clean_slate ();
      73                 :          2 :       gcc_assert (clean_slate);
      74                 :          2 :       execute_pass_list (cfun, clean_slate);
      75                 :            :     }
      76                 :            : 
      77                 :         16 :   cfun->curr_properties |= PROP_rtl;
      78                 :         16 :   free (initial_pass_name);
      79                 :         16 : }

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.