1 // go-gcc-diagnostics.cc -- GCC implementation of go diagnostics interface.
2 // Copyright (C) 2016-2024 Free Software Foundation, Inc.
3 // Contributed by Than McIntosh, Google.
5 // This file is part of GCC.
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
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
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/>.
21 #include "go-system.h"
22 #include "go-diagnostics.h"
25 go_be_error_at(const Location location
, const std::string
& errmsg
)
27 location_t gcc_loc
= location
.gcc_location();
28 error_at(gcc_loc
, "%s", errmsg
.c_str());
33 go_be_warning_at(const Location location
,
34 int opt
, const std::string
& warningmsg
)
36 location_t gcc_loc
= location
.gcc_location();
37 warning_at(gcc_loc
, opt
, "%s", warningmsg
.c_str());
41 go_be_fatal_error(const Location location
,
42 const std::string
& fatalmsg
)
44 location_t gcc_loc
= location
.gcc_location();
45 fatal_error(gcc_loc
, "%s", fatalmsg
.c_str());
49 go_be_inform(const Location location
,
50 const std::string
& infomsg
)
52 location_t gcc_loc
= location
.gcc_location();
53 inform(gcc_loc
, "%s", infomsg
.c_str());
57 go_be_get_quotechars(const char** open_qu
, const char** close_qu
)
59 *open_qu
= open_quote
;
60 *close_qu
= close_quote
;