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

No functional change intended.

gcc/analyzer/ChangeLog:
* checker-event.cc (maybe_add_sarif_properties): Update setting
of "original_fndecl" to use typesafe unique_ptr variant of
json::object::set.

gcc/ChangeLog:
* diagnostic-format-sarif.cc: Include "make-unique.h".  Convert
raw pointers to std::unique_ptr throughout to indicate ownership,
adding comments in the few places where pointers are borrowed.
Use typesafe unique_ptr variants of json::object::set and
json::array::append throughout to make types of properties more
explicit, whilst using "auto" to reduce typing.
Use "nullptr" rather than "NULL" throughout.
* diagnostic-format-sarif.h (make_sarif_logical_location_object):
Use std::unique_ptr for return type.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
gcc/analyzer/checker-event.cc
gcc/diagnostic-format-sarif.cc
gcc/diagnostic-format-sarif.h