[clang] Enable output of SARIF diagnostics
authorAbraham Corea Diaz <abrahamcd@google.com>
Fri, 26 Aug 2022 18:31:38 +0000 (18:31 +0000)
committerChristopher Di Bella <cjdb@google.com>
Fri, 26 Aug 2022 18:49:29 +0000 (18:49 +0000)
commit82e893c47c77430ca59f92d7a814a336e3873a35
tree7cbf70b06ba58685ddb67947eb0c5e7e990d69a1
parent47166968db5c5c677bda996e0c5e40e94d8ef09f
[clang] Enable output of SARIF diagnostics

Enables Clang to emit diagnostics in SARIF format when
`-fdiagnostics-format=sarif`. Adds a new DiagnosticConsumer named
SARIFDiagnosticPrinter and a new DiagnosticRenderer named SARIFDiagnostic
to constuct and emit a SARIF object containing the run's basic diagnostic info.

Reviewed By: cjdb, denik, aaron.ballman

Differential Revision: https://reviews.llvm.org/D131632
clang/include/clang/Frontend/SARIFDiagnostic.h [new file with mode: 0644]
clang/include/clang/Frontend/SARIFDiagnosticPrinter.h [new file with mode: 0644]
clang/lib/Frontend/CMakeLists.txt
clang/lib/Frontend/CompilerInstance.cpp
clang/lib/Frontend/FrontendAction.cpp
clang/lib/Frontend/SARIFDiagnostic.cpp [new file with mode: 0644]
clang/lib/Frontend/SARIFDiagnosticPrinter.cpp [new file with mode: 0644]
clang/test/Frontend/sarif-diagnostics.cpp [new file with mode: 0644]