aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-diagnostic-client-data-hooks.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-diagnostic-client-data-hooks.cc')
-rw-r--r--gcc/tree-diagnostic-client-data-hooks.cc31
1 files changed, 17 insertions, 14 deletions
diff --git a/gcc/tree-diagnostic-client-data-hooks.cc b/gcc/tree-diagnostic-client-data-hooks.cc
index 84bd4b5..77eb292 100644
--- a/gcc/tree-diagnostic-client-data-hooks.cc
+++ b/gcc/tree-diagnostic-client-data-hooks.cc
@@ -1,4 +1,4 @@
-/* Implementation of diagnostic_client_data_hooks for the compilers
+/* Implementation of diagnostics::client_data_hooks for the compilers
(e.g. with knowledge of "tree", lang_hooks, and timevars).
Copyright (C) 2022-2025 Free Software Foundation, Inc.
Contributed by David Malcolm <dmalcolm@redhat.com>.
@@ -26,18 +26,18 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
#include "diagnostic.h"
#include "tree-logical-location.h"
-#include "diagnostic-client-data-hooks.h"
-#include "diagnostic-format-sarif.h"
+#include "diagnostics/client-data-hooks.h"
+#include "diagnostics/sarif-sink.h"
#include "langhooks.h"
#include "plugin.h"
#include "timevar.h"
-/* Concrete class for supplying a diagnostic_context with information
+/* Concrete class for supplying a diagnostics::context with information
about a specific plugin within the client, when the client is the
compiler (i.e. a GCC plugin). */
class compiler_diagnostic_client_plugin_info
- : public diagnostic_client_plugin_info
+ : public diagnostics::client_plugin_info
{
public:
compiler_diagnostic_client_plugin_info (const plugin_name_args *args)
@@ -67,7 +67,7 @@ private:
/* Concrete subclass of client_version_info for use by compilers proper,
(i.e. using lang_hooks, and with knowledge of GCC plugins). */
-class compiler_version_info : public client_version_info
+class compiler_version_info : public diagnostics::client_version_info
{
public:
const char *get_tool_name () const final override
@@ -112,23 +112,26 @@ private:
}
};
-/* Subclass of diagnostic_client_data_hooks for use by compilers proper
+/* Subclass of diagnostics::client_data_hooks for use by compilers proper
i.e. with knowledge of "tree", access to langhooks, timevars etc. */
-class compiler_data_hooks : public diagnostic_client_data_hooks
+class compiler_data_hooks : public diagnostics::client_data_hooks
{
public:
- const client_version_info *get_any_version_info () const final override
+ const diagnostics::client_version_info *
+ get_any_version_info () const final override
{
return &m_version_info;
}
- const logical_location_manager *get_logical_location_manager () const final override
+ const diagnostics::logical_locations::manager *
+ get_logical_location_manager () const final override
{
return &m_logical_location_manager;
}
- logical_location_manager::key get_current_logical_location () const final override
+ diagnostics::logical_locations::key
+ get_current_logical_location () const final override
{
return m_logical_location_manager.key_from_tree (current_function_decl);
}
@@ -140,13 +143,13 @@ public:
}
void
- add_sarif_invocation_properties (sarif_object &invocation_obj)
+ add_sarif_invocation_properties (diagnostics::sarif_object &invocation_obj)
const final override
{
if (g_timer)
if (auto timereport_val = g_timer->make_json ())
{
- sarif_property_bag &bag_obj
+ auto &bag_obj
= invocation_obj.get_or_create_properties ();
bag_obj.set ("gcc/timeReport", std::move (timereport_val));
@@ -167,7 +170,7 @@ private:
/* Create a compiler_data_hooks (so that the class can be local
to this file). */
-std::unique_ptr<diagnostic_client_data_hooks>
+std::unique_ptr<diagnostics::client_data_hooks>
make_compiler_data_hooks ()
{
return std::make_unique<compiler_data_hooks> ();