LCOV - code coverage report
Current view: top level - gcc/go - go-gcc-diagnostics.cc (source / functions) Coverage Total Hit
Test: gcc.info Lines: 84.2 % 19 16
Test Date: 2026-02-28 14:20:25 Functions: 80.0 % 5 4
Legend: Lines:     hit not hit

            Line data    Source code
       1              : // go-gcc-diagnostics.cc -- GCC implementation of go diagnostics interface.
       2              : // Copyright (C) 2016-2026 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         6789 : go_be_error_at(const Location location, const std::string& errmsg)
      26              : {
      27         6789 :   location_t gcc_loc = location.gcc_location();
      28         6789 :   error_at(gcc_loc, "%s", errmsg.c_str());
      29         6789 : }
      30              : 
      31              : 
      32              : void
      33           17 : go_be_warning_at(const Location location,
      34              :                  int opt, const std::string& warningmsg)
      35              : {
      36           17 :   location_t gcc_loc = location.gcc_location();
      37           17 :   warning_at(gcc_loc, opt, "%s", warningmsg.c_str());
      38           17 : }
      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           99 : go_be_inform(const Location location,
      50              :              const std::string& infomsg)
      51              : {
      52           99 :   location_t gcc_loc = location.gcc_location();
      53           99 :   inform(gcc_loc, "%s", infomsg.c_str());
      54           99 : }
      55              : 
      56              : void
      57          191 : go_be_get_quotechars(const char** open_qu, const char** close_qu)
      58              : {
      59          191 :   *open_qu = open_quote;
      60          191 :   *close_qu = close_quote;
      61          191 : }
        

Generated by: LCOV version 2.4-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.