]> 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)
committerDavid Malcolm <dmalcolm@redhat.com>
Wed, 24 Jul 2024 22:07:55 +0000 (18:07 -0400)
commit8c07814f46ca617ccc5f9fbf2b220dc41ae228c2
treece4677a3fcd61792d421543843f7eb948f7cd0fb
parent148066bd0560b5136692991dacba15c9f21caf96
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