llvm-project/clang/unittests/Basic
Vaibhav Yenamandra 7b6fe711b2 Refactor StaticAnalyzer to use `clang::SarifDocumentWriter`
Refactor StaticAnalyzer to use clang::SarifDocumentWriter for
serializing sarif diagnostics.

Uses clang::SarifDocumentWriter to generate SARIF output in the
StaticAnalyzer.

Various bugfixes are also made to clang::SarifDocumentWriter.

Summary of changes:

clang/lib/Basic/Sarif.cpp:
  * Fix bug in adjustColumnPos introduced from prev move, it now uses
    FullSourceLoc::getDecomposedExpansionLoc which provides the correct
    location (in the presence of macros) instead of
    FullSourceLoc::getDecomposedLoc.
  * Fix createTextRegion so that it handles caret ranges correctly,
    this should bring it to parity with the previous implementation.

clang/test/Analysis/diagnostics/Inputs/expected-sarif:
  * Update the schema URL to the offical website
  * Add the emitted defaultConfiguration sections to all rules
  * Annotate results with the "level" property

clang/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp:
  * Update SarifDiagnostics class to hold a clang::SarifDocumentWriter
    that it uses to convert diagnostics to SARIF.
2022-11-17 14:47:02 -05:00
..
CMakeLists.txt [clang] Emit SARIF Diagnostics: Create `clang::SarifDocumentWriter` interface 2022-07-18 08:37:59 -04:00
CharInfoTest.cpp Cleanup identifier parsing; NFC 2021-09-14 09:12:22 -04:00
DarwinSDKInfoTest.cpp [clang, clang-tools-extra] Use has_value instead of hasValue (NFC) 2022-07-12 22:47:41 -07:00
DiagnosticTest.cpp Implement soft reset of the diagnostics engine. 2022-06-24 14:46:54 +00:00
FileEntryTest.cpp [clang] Add FileEntryRef::getNameAsRequested() 2022-08-03 09:41:08 -07:00
FileManagerTest.cpp [clang] Fix redirection behaviour for cached FileEntryRef 2022-08-05 12:23:38 -07:00
LineOffsetMappingTest.cpp [clang][unittest] Don't hardcode the string "Assertion" 2020-10-26 18:10:56 +01:00
SanitizersTest.cpp [clang][cli] Generate and round-trip language options 2021-02-09 10:18:55 +01:00
SarifTest.cpp Refactor StaticAnalyzer to use `clang::SarifDocumentWriter` 2022-11-17 14:47:02 -05:00
SourceManagerTest.cpp Fix SourceManager::isBeforeInTranslationUnit bug with token-pasting 2022-10-05 18:29:01 +02:00