aboutsummaryrefslogtreecommitdiff
path: root/gcc/diagnostics/text-sink.cc
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2025-09-02 15:58:26 -0700
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2025-09-02 15:58:26 -0700
commit071b4126c613881f4cb25b4e5c39032964827f88 (patch)
tree7ed805786566918630d1d617b1ed8f7310f5fd8e /gcc/diagnostics/text-sink.cc
parent845d23f3ea08ba873197c275a8857eee7edad996 (diff)
parentcaa1c2f42691d68af4d894a5c3e700ecd2dba080 (diff)
downloadgcc-devel/gfortran-test.zip
gcc-devel/gfortran-test.tar.gz
gcc-devel/gfortran-test.tar.bz2
Merge branch 'master' into gfortran-testdevel/gfortran-test
Diffstat (limited to 'gcc/diagnostics/text-sink.cc')
-rw-r--r--gcc/diagnostics/text-sink.cc32
1 files changed, 20 insertions, 12 deletions
diff --git a/gcc/diagnostics/text-sink.cc b/gcc/diagnostics/text-sink.cc
index bcf91cf..d4cfb89 100644
--- a/gcc/diagnostics/text-sink.cc
+++ b/gcc/diagnostics/text-sink.cc
@@ -33,6 +33,8 @@ along with GCC; see the file COPYING3. If not see
#include "diagnostics/diagram.h"
#include "diagnostics/text-sink.h"
#include "diagnostics/buffering.h"
+#include "diagnostics/dumping.h"
+#include "diagnostics/logging.h"
#include "text-art/theme.h"
/* Disable warnings about quoting issues in the pp_xxx calls below
@@ -76,7 +78,7 @@ text_sink_buffer::text_sink_buffer (sink &sink_)
void
text_sink_buffer::dump (FILE *out, int indent) const
{
- fprintf (out, "%*stext_sink_buffer:\n", indent, "");
+ dumping::emit_heading (out, indent, "text_sink_buffer");
m_output_buffer.dump (out, indent + 2);
}
@@ -156,18 +158,19 @@ text_sink::~text_sink ()
}
void
-text_sink::dump (FILE *out, int indent) const
-{
- fprintf (out, "%*stext_sink\n", indent, "");
- fprintf (out, "%*sm_follows_reference_printer: %s\n",
- indent, "",
- m_follows_reference_printer ? "true" : "false");
- sink::dump (out, indent);
- fprintf (out, "%*ssaved_output_buffer:\n", indent + 2, "");
+text_sink::dump (FILE *outfile, int indent) const
+{
+ DIAGNOSTICS_DUMPING_EMIT_BOOL_FIELD (m_follows_reference_printer);
+ DIAGNOSTICS_DUMPING_EMIT_BOOL_FIELD (m_show_nesting);
+ DIAGNOSTICS_DUMPING_EMIT_BOOL_FIELD (m_show_locations_in_nesting);
+ DIAGNOSTICS_DUMPING_EMIT_BOOL_FIELD (m_show_nesting_levels);
+
+ sink::dump (outfile, indent);
+ dumping::emit_heading (outfile, indent, "saved_output_buffer");
if (m_saved_output_buffer)
- m_saved_output_buffer->dump (out, indent + 4);
+ m_saved_output_buffer->dump (outfile, indent + 2);
else
- fprintf (out, "%*s(none):\n", indent + 4, "");
+ dumping::emit_none (outfile, indent + 2);
}
void
@@ -203,6 +206,11 @@ void
text_sink::on_report_diagnostic (const diagnostic_info &diagnostic,
enum kind orig_diag_kind)
{
+ auto logger = get_logger ();
+ DIAGNOSTICS_LOG_SCOPE_PRINTF0
+ (logger,
+ "diagnostics::text_sink::on_report_diagnostic");
+
pretty_printer *pp = get_printer ();
(*text_starter (&m_context)) (*this, &diagnostic);
@@ -612,7 +620,7 @@ text_sink::get_location_text (const expanded_location &s) const
The result is a statically allocated buffer. */
const char *
-maybe_line_and_column (int line, int col)
+text_sink::maybe_line_and_column (int line, int col)
{
static char result[32];