]> git.ipfire.org Git - thirdparty/gcc.git/commit
diagnostics: SARIF output: add sarif_object subclasses throughout
authorDavid Malcolm <dmalcolm@redhat.com>
Wed, 24 Jul 2024 22:07:52 +0000 (18:07 -0400)
committerDavid Malcolm <dmalcolm@redhat.com>
Wed, 24 Jul 2024 22:07:52 +0000 (18:07 -0400)
commit5342c63f4fb49c110c6252538cb954779c6ff156
tree579e90b02c3d6536e5b60444dbd6d963e8b7ffa5
parentda0def223e82a4a9400915b2957e96f9f060f5af
diagnostics: SARIF output: add sarif_object subclasses throughout

No functional change intended.

gcc/ChangeLog:
* diagnostic-format-sarif.cc: Introduce subclasses of sarif_object
for all aspects of the spec that we're using.  Replace almost all
usage of json::object with uses of these subclasses, the only
remaining use of json::object being for originalUriBaseIds, as per
SARIF 2.1.0 ยง3.14.14.  This stronger typing makes it considerably
easier to maintain validity against the schema.
* diagnostic-format-sarif.h (class sarif_logical_location): New.
(make_sarif_logical_location_object): Convert return type from
json::object * to sarif_logical_location *.

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