aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2025-08-08 16:55:44 -0400
committerDavid Malcolm <dmalcolm@redhat.com>2025-08-08 16:55:44 -0400
commitd7d0ea918fad92aa6403b3d6998e81b45bc93ba5 (patch)
treeefcb68d3d02df9ba47d0cee6469b2c234ad68818 /gcc
parent5edb251951a3a250b54a22fbd24c4f65f19f76fb (diff)
downloadgcc-d7d0ea918fad92aa6403b3d6998e81b45bc93ba5.zip
gcc-d7d0ea918fad92aa6403b3d6998e81b45bc93ba5.tar.gz
gcc-d7d0ea918fad92aa6403b3d6998e81b45bc93ba5.tar.bz2
diagnostics: update signature of some callbacks
No functional change intended. gcc/cp/ChangeLog: * error.cc (cp_adjust_diagnostic_info): Convert "context" arg from ptr to const &. gcc/ChangeLog: * diagnostics/context.cc (context::get_any_inlining_info): Convert "context" arg of m_set_locations_cb from ptr to const &. (context::report_diagnostic): Convert "context" arg of m_adjust_diagnostic_info from ptr to const &. * diagnostics/context.h (context::set_locations_callback_t): Likewise. (context::set_adjust_diagnostic_info_callback): Likewise. (context::m_adjust_diagnostic_info): Likewise. * tree-diagnostic.cc (set_inlining_locations): Likewise. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/error.cc4
-rw-r--r--gcc/diagnostics/context.cc4
-rw-r--r--gcc/diagnostics/context.h6
-rw-r--r--gcc/tree-diagnostic.cc2
4 files changed, 8 insertions, 8 deletions
diff --git a/gcc/cp/error.cc b/gcc/cp/error.cc
index c427163..cd35c7a 100644
--- a/gcc/cp/error.cc
+++ b/gcc/cp/error.cc
@@ -250,7 +250,7 @@ erroneous_templates_t *erroneous_templates;
issue an error if we later need to instantiate the template. */
static void
-cp_adjust_diagnostic_info (diagnostics::context *context,
+cp_adjust_diagnostic_info (const diagnostics::context &context,
diagnostics::diagnostic_info *diagnostic)
{
if (diagnostic->m_kind == diagnostics::kind::error)
@@ -258,7 +258,7 @@ cp_adjust_diagnostic_info (diagnostics::context *context,
{
diagnostic->m_option_id = OPT_Wtemplate_body;
- if (context->m_permissive)
+ if (context.m_permissive)
diagnostic->m_kind = diagnostics::kind::warning;
bool existed;
diff --git a/gcc/diagnostics/context.cc b/gcc/diagnostics/context.cc
index b05e078..a8ccbf6 100644
--- a/gcc/diagnostics/context.cc
+++ b/gcc/diagnostics/context.cc
@@ -1108,7 +1108,7 @@ context::get_any_inlining_info (diagnostic_info *diagnostic)
/* Retrieve the locations into which the expression about to be
diagnosed has been inlined, including those of all the callers
all the way down the inlining stack. */
- m_set_locations_cb (this, diagnostic);
+ m_set_locations_cb (*this, diagnostic);
else
{
/* When there's no callback use just the one location provided
@@ -1259,7 +1259,7 @@ context::report_diagnostic (diagnostic_info *diagnostic)
}
if (m_adjust_diagnostic_info)
- m_adjust_diagnostic_info (this, diagnostic);
+ m_adjust_diagnostic_info (*this, diagnostic);
if (diagnostic->m_kind == kind::pedwarn)
{
diff --git a/gcc/diagnostics/context.h b/gcc/diagnostics/context.h
index 961a872..df44a9b 100644
--- a/gcc/diagnostics/context.h
+++ b/gcc/diagnostics/context.h
@@ -264,7 +264,7 @@ public:
friend class text_sink;
friend class buffer;
- typedef void (*set_locations_callback_t) (context *,
+ typedef void (*set_locations_callback_t) (const context &,
diagnostic_info *);
void initialize (int n_opts);
@@ -571,7 +571,7 @@ public:
}
void
- set_adjust_diagnostic_info_callback (void (*cb) (context *,
+ set_adjust_diagnostic_info_callback (void (*cb) (const context &,
diagnostic_info *))
{
m_adjust_diagnostic_info = cb;
@@ -710,7 +710,7 @@ private:
/* Client hook to adjust properties of the given diagnostic that we're
about to issue, such as its kind. */
- void (*m_adjust_diagnostic_info)(context *, diagnostic_info *);
+ void (*m_adjust_diagnostic_info)(const context &, diagnostic_info *);
/* Owned by the context; this would be a std::unique_ptr if
context had a proper ctor. */
diff --git a/gcc/tree-diagnostic.cc b/gcc/tree-diagnostic.cc
index 3761fc0..20183c8 100644
--- a/gcc/tree-diagnostic.cc
+++ b/gcc/tree-diagnostic.cc
@@ -110,7 +110,7 @@ default_tree_printer (pretty_printer *pp, text_info *text, const char *spec,
to the DIAGNOSTIC location. */
static void
-set_inlining_locations (diagnostics::context *,
+set_inlining_locations (const diagnostics::context &,
diagnostics::diagnostic_info *diagnostic)
{
location_t loc = diagnostic_location (diagnostic);