]> git.ipfire.org Git - thirdparty/gcc.git/commit
diagnostics: SARIF output: tweak output for UNKNOWN_LOCATION
authorDavid Malcolm <dmalcolm@redhat.com>
Wed, 24 Jul 2024 22:07:57 +0000 (18:07 -0400)
committerThomas Koenig <tkoenig@gcc.gnu.org>
Sun, 28 Jul 2024 17:05:55 +0000 (19:05 +0200)
commitbd5eaa3ed9c6beecc107aab42227dec759cb6161
treec7a714bb051abfb700f25ba3e2b20761cbd6168c
parente82aa0832a9ef222ce4a9340c2986019c168b8c0
diagnostics: SARIF output: tweak output for UNKNOWN_LOCATION

gcc/ChangeLog:
* diagnostic-format-sarif.cc (sarif_builder::make_locations_arr):
Don't add entirely empty location objects, such as for
UNKNOWN_LOCATION.
(test_sarif_diagnostic_context::test_sarif_diagnostic_context):
Add param "main_input_filename".
(selftest::test_simple_log): Provide above param.  Verify that
"locations" is empty.
(selftest::test_simple_log_2): New.
(selftest::diagnostic_format_sarif_cc_tests): Call it.

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