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

           Branch data     Line data    Source code
       1                 :            : /* Specific flags and argument handling of the C front-end.
       2                 :            :    Copyright (C) 1999-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 "tm.h"
      24                 :            : #include "opts.h"
      25                 :            : 
      26                 :            : /* Filter command line before processing by the gcc driver proper.  */
      27                 :            : void
      28                 :      93391 : lang_specific_driver (struct cl_decoded_option **in_decoded_options ATTRIBUTE_UNUSED,
      29                 :            :                       unsigned int *in_decoded_options_count ATTRIBUTE_UNUSED,
      30                 :            :                       int *in_added_libraries ATTRIBUTE_UNUSED)
      31                 :            : {
      32                 :            :   /* Systems which use the NeXT runtime by default should arrange
      33                 :            :      for the shared libgcc to be used when -fgnu-runtime is passed
      34                 :            :      through specs.  */
      35                 :            : #if defined(ENABLE_SHARED_LIBGCC) && ! NEXT_OBJC_RUNTIME
      36                 :      93391 :   unsigned int i;
      37                 :            : 
      38                 :            :   /* The new argument list will be contained in this.  */
      39                 :      93391 :   struct cl_decoded_option *new_decoded_options;
      40                 :            : 
      41                 :            :   /* True if we should add -shared-libgcc to the command-line.  */
      42                 :      93391 :   int shared_libgcc = 0;
      43                 :            : 
      44                 :            :   /* The total number of arguments with the new stuff.  */
      45                 :      93391 :   unsigned int argc;
      46                 :            : 
      47                 :            :   /* The argument list.  */
      48                 :      93391 :   struct cl_decoded_option *decoded_options;
      49                 :            : 
      50                 :      93391 :   argc = *in_decoded_options_count;
      51                 :      93391 :   decoded_options = *in_decoded_options;
      52                 :            : 
      53                 :    1507890 :   for (i = 1; i < argc; i++)
      54                 :            :     {
      55                 :    1414550 :       switch (decoded_options[i].opt_index)
      56                 :            :         {
      57                 :            :         case OPT_static_libgcc:
      58                 :            :         case OPT_static:
      59                 :            :           return;
      60                 :            : 
      61                 :      97930 :         case OPT_SPECIAL_input_file:
      62                 :      97930 :           {
      63                 :      97930 :             const char *file = decoded_options[i].arg;
      64                 :      97930 :             int len;
      65                 :            : 
      66                 :            :             /* If the filename ends in .m or .mi, we are compiling
      67                 :            :                ObjC and want to pass -shared-libgcc.  */
      68                 :      97930 :             len = strlen (file);
      69                 :      97930 :             if ((len > 2 && file[len - 2] == '.' && file[len - 1] == 'm')
      70                 :      97930 :                 ||  (len > 3 && file[len - 3] == '.' && file[len - 2] == 'm'
      71                 :          0 :                      && file[len - 1] == 'i'))
      72                 :          0 :               shared_libgcc = 1;
      73                 :            :           }
      74                 :            :           break;
      75                 :            :         }
      76                 :            :     }
      77                 :            : 
      78                 :      93342 :   if  (shared_libgcc)
      79                 :            :     {
      80                 :          0 :       new_decoded_options = XNEWVEC (struct cl_decoded_option, argc + 1);
      81                 :            : 
      82                 :          0 :       i = 0;
      83                 :          0 :       do
      84                 :            :         {
      85                 :          0 :           new_decoded_options[i] = decoded_options[i];
      86                 :          0 :           i++;
      87                 :            :         }
      88                 :          0 :       while (i < argc);
      89                 :            : 
      90                 :          0 :       generate_option (OPT_shared_libgcc, NULL, 1, CL_DRIVER,
      91                 :          0 :                        &new_decoded_options[i++]);
      92                 :            : 
      93                 :          0 :       *in_decoded_options_count = i;
      94                 :          0 :       *in_decoded_options = new_decoded_options;
      95                 :            :     }
      96                 :            : #endif
      97                 :            : }
      98                 :            : 
      99                 :            : /* Called before linking.  Returns 0 on success and -1 on failure.  */
     100                 :            : int
     101                 :      89244 : lang_specific_pre_link (void)
     102                 :            : {
     103                 :      89244 :   return 0;  /* Not used for C.  */
     104                 :            : }
     105                 :            : 
     106                 :            : /* Number of extra output files that lang_specific_pre_link may generate.  */
     107                 :            : int lang_specific_extra_outfiles = 0;  /* Not used for C.  */

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.