clang 23.0.0git
SARIFTransformationReportFormat.h
Go to the documentation of this file.
1//===- SARIFTransformationReportFormat.h ------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// Built-in SARIF 2.1.0 transformation-report writer. Drives clang's existing
10// `SarifDocumentWriter`; emits no `fix` keys (source edits live in the
11// separate edit file).
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_CLANG_SCALABLESTATICANALYSISFRAMEWORK_SOURCETRANSFORMATION_SARIFTRANSFORMATIONREPORTFORMAT_H
16#define LLVM_CLANG_SCALABLESTATICANALYSISFRAMEWORK_SOURCETRANSFORMATION_SARIFTRANSFORMATIONREPORTFORMAT_H
17
18#include "clang/Basic/Sarif.h"
20#include "llvm/ADT/StringRef.h"
21#include "llvm/Support/Error.h"
22#include <string>
23#include <vector>
24
25namespace clang {
26class SourceManager;
27} // namespace clang
28
29namespace clang::ssaf {
30
37
39 std::string TransformationName;
41 std::vector<ReportResult> Results;
42};
43
44/// Writes \p Doc to \p Path as a SARIF JSON document.
46 llvm::StringRef Path);
47
48} // namespace clang::ssaf
49
50#endif // LLVM_CLANG_SCALABLESTATICANALYSISFRAMEWORK_SOURCETRANSFORMATION_SARIFTRANSFORMATIONREPORTFORMAT_H
Defines clang::SarifDocumentWriter, clang::SarifRule, clang::SarifResult.
Defines the clang::SourceLocation class and associated facilities.
Represents a byte-granular source range.
This class handles loading and caching of source files into memory.
llvm::Error writeSARIFTransformationReport(const ReportDocument &Doc, llvm::StringRef Path)
Writes Doc to Path as a SARIF JSON document.
The JSON file list parser is used to communicate input to InstallAPI.
SarifResultLevel
The level of severity associated with a SarifResult.
Definition Sarif.h:165