]> git.ipfire.org Git - thirdparty/gcc.git/commit
Add json-diagnostic.{cc,h}
authorDavid Malcolm <dmalcolm@redhat.com>
Sat, 28 Feb 2026 04:35:45 +0000 (23:35 -0500)
committerDavid Malcolm <dmalcolm@redhat.com>
Sat, 28 Feb 2026 04:35:45 +0000 (23:35 -0500)
commit9a6439dabd74ba1c79110d0827570ced4fa2beaf
tree77fa94242a8a5f91dad62cfbb223a3fe57bbf8d0
parent93da530a647bb2f30d9f6cdf505e9d68bcea04a9
Add json-diagnostic.{cc,h}

This patch adds support for emitting diagnostics about JSON input files
to global_dc, showing both the file/line/columns and the JSON Pointer
for the problematic json::value.  Test coverage is added by the followup
on aarch64.

gcc/ChangeLog:
* Makefile.in (OBJS-libcommon): Add json-diagnostic.o.
* diagnostics/client-data-hooks.h
(class client_data_hooks_decorator): New.
* diagnostics/context.cc (context::set_client_data_hooks): Return
the old hooks.
* diagnostics/context.h (context::set_client_data_hooks): Update
decl likewise.
* json-diagnostic.cc: New file.
* json-diagnostic.h: New file.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
gcc/Makefile.in
gcc/diagnostics/client-data-hooks.h
gcc/diagnostics/context.cc
gcc/diagnostics/context.h
gcc/json-diagnostic.cc [new file with mode: 0644]
gcc/json-diagnostic.h [new file with mode: 0644]