]> 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)
committerDavid Malcolm <dmalcolm@redhat.com>
Wed, 24 Jul 2024 22:07:54 +0000 (18:07 -0400)
commitae4f4f767efc156aac4b2e7a874648fdc60307f3
tree14f98db982b69f2f04178fff92a81ce2cf7a9797
parentee2dad94acc88c2ea78a91b7eb8914e7c1bae829
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