SarifDocumentWriter;
75std::optional<uint32_t> Index;
108std::optional<uint32_t> Offset;
109std::optional<size_t> Length;
110std::string MimeType;
124Offset = ArtifactOffset;
134Roles.assign(ArtifactRoles.begin(), ArtifactRoles.end());
139MimeType = ArtifactMimeType.str();
189 "ThreadFlows require a character granular source range!");
195Importance = ItemImportance;
200Message = ItemMessage.str();
214 boolEnabled =
true;
239assert(TheRank >= 0.0f &&
"Rule rank cannot be smaller than 0.0");
240assert(TheRank <= 100.0f &&
"Rule rank cannot be larger than 100.0");
262std::string Description;
272Name = RuleName.str();
282Description = RuleDesc.str();
287HelpURI = RuleHelpURI.str();
293DefaultConfiguration = Configuration;
324std::string DiagnosticMessage;
327std::optional<SarifResultLevel> LevelOverride;
330 explicit SarifResult(uint32_t RuleIdx) : RuleIdx(RuleIdx) {}
346DiagnosticMessage = Message.str();
352 for(
const auto&
Loc: DiagLocs) {
353assert(
Loc.isCharRange() &&
354 "SARIF Results require character granular source ranges!");
357Locations.assign(DiagLocs.begin(), DiagLocs.end());
361ThreadFlows.assign(ThreadFlowResults.begin(), ThreadFlowResults.end());
366LevelOverride = TheLevel;
382 constllvm::StringRef SchemaURI{
383 "https://docs.oasis-open.org/sarif/sarif/v2.1.0/cos02/schemas/" 384 "sarif-schema-2.1.0.json"};
385 constllvm::StringRef SchemaVersion{
"2.1.0"};
389llvm::json::Object &getCurrentTool();
395 boolhasRun()
const;
407llvm::json::Object &getCurrentRun();
436 void createRun(
constllvm::StringRef ShortToolName,
437 constllvm::StringRef LongToolName,
438 constllvm::StringRef ToolVersion = CLANG_VERSION_STRING);
493llvm::json::Array Runs;
509llvm::StringMap<detail::SarifArtifact> CurrentArtifacts;
Defines the clang::SourceLocation class and associated facilities.
Defines version macros and version-related utility functions for Clang.
Represents a character-granular source range.
This class handles creating a valid SARIF document given various input attributes.
~SarifDocumentWriter()=default
Release resources held by this SARIF document.
SarifDocumentWriter()=delete
SarifDocumentWriter(const SourceManager &SourceMgr)
Create a new empty SARIF document with the given source manager.
void createRun(const llvm::StringRef ShortToolName, const llvm::StringRef LongToolName, const llvm::StringRef ToolVersion=CLANG_VERSION_STRING)
Create a new run with which any upcoming analysis will be associated.
size_t createRule(const SarifRule &Rule)
Associate the given rule with the current run.
llvm::json::Object createDocument()
Return the SARIF document in its current state.
void endRun()
If there is a current run, end it.
void appendResult(const SarifResult &SarifResult)
Append a new result to the currently in-flight run.
A SARIF Reporting Configuration (reportingConfiguration) object contains properties for a SarifRule t...
static SarifReportingConfiguration create()
SarifReportingConfiguration disable()
SarifReportingConfiguration enable()
SarifReportingConfiguration setLevel(SarifResultLevel TheLevel)
SarifReportingConfiguration setRank(float TheRank)
A SARIF result (also called a "reporting item") is a unit of output produced when one of the tool's r...
SarifResult setIndex(uint32_t Idx)
SarifResult setThreadFlows(llvm::ArrayRef< ThreadFlow > ThreadFlowResults)
SarifResult setDiagnosticMessage(llvm::StringRef Message)
SarifResult setRuleId(llvm::StringRef Id)
SarifResult setLocations(llvm::ArrayRef< CharSourceRange > DiagLocs)
SarifResult setDiagnosticLevel(const SarifResultLevel &TheLevel)
static SarifResult create(uint32_t RuleIdx)
A SARIF rule (reportingDescriptor object) contains information that describes a reporting item genera...
SarifRule setDescription(llvm::StringRef RuleDesc)
SarifRule setHelpURI(llvm::StringRef RuleHelpURI)
SarifRule setRuleId(llvm::StringRef RuleId)
static SarifRule create()
SarifRule setDefaultConfiguration(const SarifReportingConfiguration &Configuration)
SarifRule setName(llvm::StringRef RuleName)
This class handles loading and caching of source files into memory.
A thread flow is a sequence of code locations that specify a possible path through a single thread of...
ThreadFlow setImportance(const ThreadFlowImportance &ItemImportance)
ThreadFlow setRange(const CharSourceRange &ItemRange)
static ThreadFlow create()
ThreadFlow setMessage(llvm::StringRef ItemMessage)
SarifArtifactLocation setIndex(uint32_t Idx)
static SarifArtifactLocation create(llvm::StringRef URI)
Since every clang artifact MUST have a location (there being no nested artifacts),...
SarifArtifact setOffset(uint32_t ArtifactOffset)
SarifArtifact setMimeType(llvm::StringRef ArtifactMimeType)
static SarifArtifact create(const SarifArtifactLocation &Loc)
SarifArtifact setRoles(std::initializer_list< llvm::StringRef > ArtifactRoles)
SarifArtifact setLength(size_t NumBytes)
The JSON file list parser is used to communicate input to InstallAPI.
SarifResultLevel
The level of severity associated with a SarifResult.
@ None
The alignment was not explicit in code.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4