aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/CommandLineTest.cpp
diff options
context:
space:
mode:
authorDave Bartolomeo <dave_bartolomeo@apple.com>2025-09-25 13:47:51 -0400
committerGitHub <noreply@github.com>2025-09-25 10:47:51 -0700
commit30402c7dea57d35ead80387c061cda6977ba98ef (patch)
tree3456ff77b918a76f4b4eb77d6f54264356c84e0c /llvm/unittests/Support/CommandLineTest.cpp
parent80d3a8015513e2a64c47e173addda6ce816bf85c (diff)
downloadllvm-30402c7dea57d35ead80387c061cda6977ba98ef.zip
llvm-30402c7dea57d35ead80387c061cda6977ba98ef.tar.gz
llvm-30402c7dea57d35ead80387c061cda6977ba98ef.tar.bz2
[analyzer] Emit IssueHash in SARIF (#159445)
This change adds two new properties to each `result` object in the SARIF log: `partialFingerprints`: Contains the "issue hash" that the analyzer already generates for each result, which can help identify a result across runs even if surrounding code changes. `hostedViewUri`: If running with `-analyzer-format=sarif-html`, this property will now be emitted with the `file:` URL of the generated HTML report for that result. Along the way, I discovered an existing bug where the HTML diagnostic consumer does not record the path to the generated report if another compilation already created that report. This caused both the SARIF and Plist consumers to be missing the link to the file in all but one of the compilations in case of a warning in a header file. I added a new test to ensure that the generated SARIF for each compilation contains the property. Finally, I made a few changes to the `normalize_sarif` processing in the tests. I switched to `sed` to allow substitutions. The normalization now removes directory components from `file:` URLs, replaces the `length` property of the source file with a constant `-1`, and puts placeholders in the values of the `version` properties rather than just deleting them. The URL transformation in particular lets us verify that the right filename is generated for each HTML report. Fixes #158159 rdar://160410408
Diffstat (limited to 'llvm/unittests/Support/CommandLineTest.cpp')
0 files changed, 0 insertions, 0 deletions