14#ifndef LLVM_CLANG_FRONTEND_SARIFDIAGNOSTICPRINTER_H
15#define LLVM_CLANG_FRONTEND_SARIFDIAGNOSTICPRINTER_H
20#include "llvm/ADT/IntrusiveRefCntPtr.h"
21#include "llvm/ADT/StringRef.h"
25class DiagnosticOptions;
28class SarifDocumentWriter;
48 assert(Writer &&
"SarifWriter not set!");
53 Writer = std::move(SarifWriter);
66 std::unique_ptr<SARIFDiagnostic> SARIFDiag;
71 std::unique_ptr<SarifDocumentWriter> Writer;
Defines the Diagnostic-related interfaces.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Defines clang::SarifDocumentWriter, clang::SarifRule, clang::SarifResult.
Abstract interface, implemented by clients of the front-end, which formats and prints fully processed...
Options for controlling the compiler diagnostics engine.
A little helper class (which is basically a smart pointer that forwards info from DiagnosticsEngine) ...
Level
The level of the diagnostic, after it has been through mapping.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Engages in a tight little dance with the lexer to efficiently preprocess tokens.
void setPrefix(llvm::StringRef Value)
setPrefix - Set the diagnostic printer prefix string, which will be printed at the start of any diagn...
void EndSourceFile() override
Callback to inform the diagnostic client that processing of a source file has ended.
void setSarifWriter(std::unique_ptr< SarifDocumentWriter > SarifWriter)
bool hasSarifWriter() const
void HandleDiagnostic(DiagnosticsEngine::Level Level, const Diagnostic &Info) override
Handle this diagnostic, reporting it to the user or capturing it to a log as needed.
~SARIFDiagnosticPrinter()=default
void BeginSourceFile(const LangOptions &LO, const Preprocessor *PP) override
Callback to inform the diagnostic client that processing of a source file is beginning.
SARIFDiagnosticPrinter(const SARIFDiagnosticPrinter &)=delete
SarifDocumentWriter & getSarifWriter() const
SARIFDiagnosticPrinter & operator=(const SARIFDiagnosticPrinter &)=delete
SARIFDiagnosticPrinter(SARIFDiagnosticPrinter &&)=delete
SARIFDiagnosticPrinter & operator=(const SARIFDiagnosticPrinter &&)=delete
This class handles creating a valid SARIF document given various input attributes.
The JSON file list parser is used to communicate input to InstallAPI.