]> git.ipfire.org Git - thirdparty/gcc.git/commit
diagnostics: JSON output: use std::unique_ptr throughout
authorDavid Malcolm <dmalcolm@redhat.com>
Wed, 24 Jul 2024 22:07:54 +0000 (18:07 -0400)
committerThomas Koenig <tkoenig@gcc.gnu.org>
Sun, 28 Jul 2024 17:05:54 +0000 (19:05 +0200)
commitda87cbedcdf76a6cbc7910fba604efd50e8cc48e
tree6b3aa8bfda39b750dd642512e69c030ff45b2f20
parent8485fe1b546f755616c6152fd5b6aa2520ac58ef
diagnostics: JSON output: use std::unique_ptr throughout

No functional change intended.

gcc/ChangeLog:
* diagnostic-format-json.cc: Include "make-unique.h".
(json_output_format::m_toplevel_array): Convert to
std::unique_ptr.
(json_output_format::json_output_format): Update accordingly.
(json_output_format::~json_output_format): Remove manual
"delete" of field.
(json_from_expanded_location): Convert return type to
std::unique_ptr.
(json_from_location_range): Likewise.  Use nullptr rather than
NULL.
(json_from_fixit_hint): Convert return type to std::unique_ptr.
(json_from_metadata): Likewise.
(make_json_for_path): Likewise.
(json_output_format::on_end_diagnostic): Use std::unique_ptr
throughout.
(json_file_output_format::~json_file_output_format): Use nullptr.
(selftest::test_unknown_location): Update to use std::unique_ptr.
(selftest::test_bad_endpoints): Likewise.  Replace NULL with
nullptr.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
gcc/diagnostic-format-json.cc