No functional change intended.
gcc/ChangeLog:
* diagnostic.h (struct diagnostic_info): Move to
diagnostics/diagnostic-info.h as diagnostics::diagnostic_info.
Add typedef bringing it back into root namespace, for now.
* diagnostics/diagnostic-info.h: New file, based on the above.
* langhooks-def.h: Update for diagnostic_info moving into
namespace diagnostics.
* langhooks.h: Likewise.
gcc/jit/ChangeLog:
* jit-playback.cc: Update for diagnostic_info moving into
namespace diagnostics.
* jit-playback.h: Likewise.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
DIAGNOSTICS_TEXT_ART_CHARSET_EMOJI
};
-/* A diagnostic is described by the MESSAGE to send, the FILE and LINE of
- its context and its KIND (ice, error, warning, note, ...) See complete
- list in diagnostic.def. */
-struct diagnostic_info
-{
- diagnostic_info ()
- : m_message (),
- m_richloc (),
- m_metadata (),
- m_x_data (),
- m_kind (),
- m_option_id (),
- m_iinfo ()
- { }
-
- /* Text to be formatted. */
- text_info m_message;
-
- /* The location at which the diagnostic is to be reported. */
- rich_location *m_richloc;
-
- /* An optional bundle of metadata associated with the diagnostic
- (or NULL). */
- const diagnostics::metadata *m_metadata;
-
- /* Auxiliary data for client. */
- void *m_x_data;
- /* The kind of diagnostic it is about. */
- diagnostic_t m_kind;
- /* Which OPT_* directly controls this diagnostic. */
- diagnostic_option_id m_option_id;
-
- /* Inlining context containing locations for each call site along
- the inlining stack. */
- struct inlining_info
- {
- /* Locations along the inlining stack. */
- auto_vec<location_t, 8> m_ilocs;
- /* The abstract origin of the location. */
- void *m_ao;
- /* Set if every M_ILOCS element is in a system header. */
- bool m_allsyslocs;
- } m_iinfo;
-};
+#include "diagnostics/diagnostic-info.h"
+typedef diagnostics::diagnostic_info diagnostic_info;
/* Forward declarations. */
class diagnostic_location_print_policy;
--- /dev/null
+/* Various declarations for language-independent diagnostics subroutines.
+ Copyright (C) 2000-2025 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#ifndef GCC_DIAGNOSTICS_DIAGNOSTIC_INFO_H
+#define GCC_DIAGNOSTICS_DIAGNOSTIC_INFO_H
+
+namespace diagnostics {
+
+class metadata;
+
+/* A diagnostic is described by the MESSAGE to send, the FILE and LINE of
+ its context and its KIND (ice, error, warning, note, ...) See complete
+ list in diagnostic.def. */
+
+struct diagnostic_info
+{
+ diagnostic_info ()
+ : m_message (),
+ m_richloc (),
+ m_metadata (),
+ m_x_data (),
+ m_kind (),
+ m_option_id (),
+ m_iinfo ()
+ { }
+
+ /* Text to be formatted. */
+ text_info m_message;
+
+ /* The location at which the diagnostic is to be reported. */
+ rich_location *m_richloc;
+
+ /* An optional bundle of metadata associated with the diagnostic
+ (or NULL). */
+ const metadata *m_metadata;
+
+ /* Auxiliary data for client. */
+ void *m_x_data;
+ /* The kind of diagnostic it is about. */
+ diagnostic_t m_kind;
+ /* Which OPT_* directly controls this diagnostic. */
+ diagnostic_option_id m_option_id;
+
+ /* Inlining context containing locations for each call site along
+ the inlining stack. */
+ struct inlining_info
+ {
+ /* Locations along the inlining stack. */
+ auto_vec<location_t, 8> m_ilocs;
+ /* The abstract origin of the location. */
+ void *m_ao;
+ /* Set if every M_ILOCS element is in a system header. */
+ bool m_allsyslocs;
+ } m_iinfo;
+};
+
+} // namespace diagnostics
+
+#endif /* ! GCC_DIAGNOSTICS_DIAGNOSTIC_INFO_H */
void
playback::context::
add_diagnostic (const char *text,
- const diagnostic_info &diagnostic)
+ const diagnostics::diagnostic_info &diagnostic)
{
/* Get location information (if any) from the diagnostic.
The recording::context::add_error[_va] methods require a
#include "jit-recording.h"
class diagnostic_context;
-struct diagnostic_info;
+namespace diagnostics { struct diagnostic_info; }
namespace gcc {
void
add_diagnostic (const char *text,
- const diagnostic_info &diagnostic);
+ const diagnostics::diagnostic_info &diagnostic);
void
set_tree_location (tree t, location *loc);
#include "hooks.h"
-struct diagnostic_info;
+namespace diagnostics { struct diagnostic_info; }
class substring_loc;
/* Note to creators of new hooks:
extern int lhd_types_compatible_p (tree, tree);
extern void lhd_print_error_function (diagnostics::text_sink &,
const char *,
- const struct diagnostic_info *);
+ const diagnostics::diagnostic_info *);
extern void lhd_set_decl_assembler_name (tree decl);
extern void lhd_overwrite_decl_assembler_name (tree decl, tree name);
extern bool lhd_warn_unused_global_decl (const_tree);
/* FIXME: This file should be #include-d after tree.h (for enum tree_code). */
-struct diagnostic_info;
+namespace diagnostics { struct diagnostic_info; }
struct gimplify_omp_ctx;
for textual diagnostic output. */
void (*print_error_function) (diagnostics::text_sink &,
const char *,
- const struct diagnostic_info *);
+ const diagnostics::diagnostic_info *);
/* Convert a character from the host's to the target's character
set. The character should be in what C calls the "basic source