]> git.ipfire.org Git - thirdparty/gcc.git/commit
diagnostics: SARIF output: add "workingDirectory" property (§3.20.19)
authorDavid Malcolm <dmalcolm@redhat.com>
Wed, 24 Jul 2024 22:07:55 +0000 (18:07 -0400)
committerThomas Koenig <tkoenig@gcc.gnu.org>
Sun, 28 Jul 2024 17:05:54 +0000 (19:05 +0200)
commitffab30cde56ac0b33b859fb2f248dc3f1f01c010
tree23cb68f60541ee7008bed6b5a64698b523b17127
parent6cce58792ba040b435c0943dff5f0781fb9b9e54
diagnostics: SARIF output: add "workingDirectory" property (§3.20.19)

gcc/ChangeLog:
* diagnostic-format-sarif.cc
(sarif_builder::make_artifact_location_object): Make public.
(sarif_invocation::sarif_invocation): Add param "builder".
Use it to potentially populate the "workingDirectory" property
with the result of pwd (§3.20.19).
(sarif_builder::sarif_builder): Pass *this to m_invocation_obj's
ctor.

gcc/testsuite/ChangeLog:
* c-c++-common/diagnostic-format-sarif-file-1.c: Verify that we have
a "workingDirectory" property.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
gcc/diagnostic-format-sarif.cc
gcc/testsuite/c-c++-common/diagnostic-format-sarif-file-1.c