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

           Branch data     Line data    Source code
       1                 :            : // go-gcc-diagnostics.cc -- GCC implementation of go diagnostics interface.
       2                 :            : // Copyright (C) 2016-2020 Free Software Foundation, Inc.
       3                 :            : // Contributed by Than McIntosh, Google.
       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 "go-system.h"
      22                 :            : #include "go-diagnostics.h"
      23                 :            : 
      24                 :            : void
      25                 :       6175 : go_be_error_at(const Location location, const std::string& errmsg)
      26                 :            : {
      27                 :       6175 :   location_t gcc_loc = location.gcc_location();
      28                 :       6175 :   error_at(gcc_loc, "%s", errmsg.c_str());
      29                 :       6175 : }
      30                 :            : 
      31                 :            : 
      32                 :            : void
      33                 :         15 : go_be_warning_at(const Location location,
      34                 :            :                  int opt, const std::string& warningmsg)
      35                 :            : {
      36                 :         15 :   location_t gcc_loc = location.gcc_location();
      37                 :         15 :   warning_at(gcc_loc, opt, "%s", warningmsg.c_str());
      38                 :         15 : }
      39                 :            : 
      40                 :            : void
      41                 :          0 : go_be_fatal_error(const Location location,
      42                 :            :                   const std::string& fatalmsg)
      43                 :            : {
      44                 :          0 :   location_t gcc_loc = location.gcc_location();
      45                 :          0 :   fatal_error(gcc_loc, "%s", fatalmsg.c_str());
      46                 :            : }
      47                 :            : 
      48                 :            : void
      49                 :         79 : go_be_inform(const Location location,
      50                 :            :              const std::string& infomsg)
      51                 :            : {
      52                 :         79 :   location_t gcc_loc = location.gcc_location();
      53                 :         79 :   inform(gcc_loc, "%s", infomsg.c_str());
      54                 :         79 : }
      55                 :            : 
      56                 :            : void
      57                 :        102 : go_be_get_quotechars(const char** open_qu, const char** close_qu)
      58                 :            : {
      59                 :        102 :   *open_qu = open_quote;
      60                 :        102 :   *close_qu = close_quote;
      61                 :        102 : }

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.