clang 24.0.0git
Sarif.h
Go to the documentation of this file.
1//== clang/Basic/Sarif.h - SARIF Diagnostics Object Model -------*- 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/// \file
9/// Defines clang::SarifDocumentWriter, clang::SarifRule, clang::SarifResult.
10///
11/// The document built can be accessed as a JSON Object.
12/// Several value semantic types are also introduced which represent properties
13/// of the SARIF standard, such as 'artifact', 'result', 'rule'.
14///
15/// A SARIF (Static Analysis Results Interchange Format) document is JSON
16/// document that describes in detail the results of running static analysis
17/// tools on a project. Each (non-trivial) document consists of at least one
18/// "run", which are themselves composed of details such as:
19/// * Tool: The tool that was run
20/// * Rules: The rules applied during the tool run, represented by
21/// \c reportingDescriptor objects in SARIF
22/// * Results: The matches for the rules applied against the project(s) being
23/// evaluated, represented by \c result objects in SARIF
24///
25/// Reference:
26/// 1. <a href="https://docs.oasis-open.org/sarif/sarif/v2.1.0/os/sarif-v2.1.0-os.html">The SARIF standard</a>
27/// 2. <a href="https://docs.oasis-open.org/sarif/sarif/v2.1.0/os/sarif-v2.1.0-os.html#_Toc34317836">SARIF<pre>reportingDescriptor</pre></a>
28/// 3. <a href="https://docs.oasis-open.org/sarif/sarif/v2.1.0/os/sarif-v2.1.0-os.html#_Toc34317638">SARIF<pre>result</pre></a>
29//===----------------------------------------------------------------------===//
30
31#ifndef LLVM_CLANG_BASIC_SARIF_H
32#define LLVM_CLANG_BASIC_SARIF_H
33
35#include "clang/Basic/Version.h"
36#include "llvm/ADT/ArrayRef.h"
37#include "llvm/ADT/SmallVector.h"
38#include "llvm/ADT/StringMap.h"
39#include "llvm/ADT/StringRef.h"
40#include "llvm/Support/JSON.h"
41#include <cassert>
42#include <cstddef>
43#include <cstdint>
44#include <initializer_list>
45#include <optional>
46#include <string>
47
48namespace clang {
49
51class SourceManager;
52
53namespace detail {
54
55/// \internal
56/// An artifact location is SARIF's way of describing the complete location
57/// of an artifact encountered during analysis. The \c artifactLocation object
58/// typically consists of a URI, and/or an index to reference the artifact it
59/// locates.
60///
61/// This builder makes an additional assumption: that every artifact encountered
62/// by \c clang will be a physical, top-level artifact. Which is why the static
63/// creation method \ref SarifArtifactLocation::create takes a mandatory URI
64/// parameter. The official standard states that either a \c URI or \c Index
65/// must be available in the object, \c clang picks the \c URI as a reasonable
66/// default, because it intends to deal in physical artifacts for now.
67///
68/// Reference:
69/// 1. <a href="https://docs.oasis-open.org/sarif/sarif/v2.1.0/os/sarif-v2.1.0-os.html#_Toc34317427">artifactLocation object</a>
70/// 2. \ref SarifArtifact
71class SarifArtifactLocation {
72private:
74
75 std::optional<uint32_t> Index;
76 std::string URI;
77
78 SarifArtifactLocation() = delete;
79 explicit SarifArtifactLocation(const std::string &URI) : URI(URI) {}
80
81public:
82 static SarifArtifactLocation create(llvm::StringRef URI) {
83 return SarifArtifactLocation{URI.str()};
84 }
85
86 SarifArtifactLocation setIndex(uint32_t Idx) {
87 Index = Idx;
88 return *this;
89 }
90};
91
92/// \internal
93/// An artifact in SARIF is any object (a sequence of bytes) addressable by
94/// a URI (RFC 3986). The most common type of artifact for clang's use-case
95/// would be source files. SARIF's artifact object is described in detail in
96/// section 3.24.
97//
98/// Since every clang artifact MUST have a location (there being no nested
99/// artifacts), the creation method \ref SarifArtifact::create requires a
100/// \ref SarifArtifactLocation object.
101///
102/// Reference:
103/// 1. <a href="https://docs.oasis-open.org/sarif/sarif/v2.1.0/os/sarif-v2.1.0-os.html#_Toc34317611">artifact object</a>
104class SarifArtifact {
105private:
107
108 std::optional<uint32_t> Offset;
109 std::optional<size_t> Length;
110 std::string MimeType;
111 SarifArtifactLocation Location;
113
114 SarifArtifact() = delete;
115
116 explicit SarifArtifact(const SarifArtifactLocation &Loc) : Location(Loc) {}
117
118public:
119 static SarifArtifact create(const SarifArtifactLocation &Loc) {
120 return SarifArtifact{Loc};
121 }
122
123 SarifArtifact setOffset(uint32_t ArtifactOffset) {
124 Offset = ArtifactOffset;
125 return *this;
126 }
127
128 SarifArtifact setLength(size_t NumBytes) {
129 Length = NumBytes;
130 return *this;
131 }
132
133 SarifArtifact setRoles(std::initializer_list<llvm::StringRef> ArtifactRoles) {
134 Roles.assign(ArtifactRoles.begin(), ArtifactRoles.end());
135 return *this;
136 }
137
138 SarifArtifact setMimeType(llvm::StringRef ArtifactMimeType) {
139 MimeType = ArtifactMimeType.str();
140 return *this;
141 }
142};
143
144} // namespace detail
145
147
148/// The level of severity associated with a \ref SarifResult.
149///
150/// Of all the levels, \c None is the only one that is not associated with
151/// a failure.
152///
153/// A typical mapping for clang's DiagnosticKind to SarifResultLevel would look
154/// like:
155/// * \c None: \ref clang::DiagnosticsEngine::Level::Remark, \ref clang::DiagnosticsEngine::Level::Ignored
156/// * \c Note: \ref clang::DiagnosticsEngine::Level::Note
157/// * \c Warning: \ref clang::DiagnosticsEngine::Level::Warning
158/// * \c Error could be generated from one of:
159/// - \ref clang::DiagnosticsEngine::Level::Warning with \c -Werror
160/// - \ref clang::DiagnosticsEngine::Level::Error
161/// - \ref clang::DiagnosticsEngine::Level::Fatal when \ref clang::DiagnosticsEngine::ErrorsAsFatal is set.
162///
163/// Reference:
164/// 1. <a href="https://docs.oasis-open.org/sarif/sarif/v2.1.0/os/sarif-v2.1.0-os.html#_Toc34317648">level property</a>
166
167/// A thread flow is a sequence of code locations that specify a possible path
168/// through a single thread of execution.
169/// A thread flow in SARIF is related to a code flow which describes
170/// the progress of one or more programs through one or more thread flows.
171///
172/// Reference:
173/// 1. <a href="https://docs.oasis-open.org/sarif/sarif/v2.1.0/os/sarif-v2.1.0-os.html#_Toc34317744">threadFlow object</a>
174/// 2. <a href="https://docs.oasis-open.org/sarif/sarif/v2.1.0/os/sarif-v2.1.0-os.html#_Toc34317740">codeFlow object</a>
175class ThreadFlow {
177
178 CharSourceRange Range;
179 ThreadFlowImportance Importance;
180 std::string Message;
181
182 ThreadFlow() = default;
183
184public:
185 static ThreadFlow create() { return {}; }
186
187 ThreadFlow setRange(const CharSourceRange &ItemRange) {
188 assert(ItemRange.isCharRange() &&
189 "ThreadFlows require a character granular source range!");
190 Range = ItemRange;
191 return *this;
192 }
193
194 ThreadFlow setImportance(const ThreadFlowImportance &ItemImportance) {
195 Importance = ItemImportance;
196 return *this;
197 }
198
199 ThreadFlow setMessage(llvm::StringRef ItemMessage) {
200 Message = ItemMessage.str();
201 return *this;
202 }
203};
204
205/// A SARIF Reporting Configuration (\c reportingConfiguration) object contains
206/// properties for a \ref SarifRule that can be configured at runtime before
207/// analysis begins.
208///
209/// Reference:
210/// 1. <a href="https://docs.oasis-open.org/sarif/sarif/v2.1.0/os/sarif-v2.1.0-os.html#_Toc34317852">reportingConfiguration object</a>
211class SarifReportingConfiguration {
213
214 bool Enabled = true;
216 float Rank = -1.0f;
217
218 SarifReportingConfiguration() = default;
219
220public:
221 static SarifReportingConfiguration create() { return {}; };
222
223 SarifReportingConfiguration disable() {
224 Enabled = false;
225 return *this;
226 }
227
228 SarifReportingConfiguration enable() {
229 Enabled = true;
230 return *this;
231 }
232
233 SarifReportingConfiguration setLevel(SarifResultLevel TheLevel) {
234 Level = TheLevel;
235 return *this;
236 }
237
238 SarifReportingConfiguration setRank(float TheRank) {
239 assert(TheRank >= 0.0f && "Rule rank cannot be smaller than 0.0");
240 assert(TheRank <= 100.0f && "Rule rank cannot be larger than 100.0");
241 Rank = TheRank;
242 return *this;
243 }
244};
245
246/// A SARIF rule (\c reportingDescriptor object) contains information that
247/// describes a reporting item generated by a tool. A reporting item is
248/// either a result of analysis or notification of a condition encountered by
249/// the tool. Rules are arbitrary but are identifiable by a hierarchical
250/// rule-id.
251///
252/// This builder provides an interface to create SARIF \c reportingDescriptor
253/// objects via the \ref SarifRule::create static method.
254///
255/// Reference:
256/// 1. <a href="https://docs.oasis-open.org/sarif/sarif/v2.1.0/os/sarif-v2.1.0-os.html#_Toc34317836">reportingDescriptor object</a>
257class SarifRule {
259
260 std::string Name;
261 std::string Id;
262 std::string Description;
263 std::string HelpURI;
264 std::vector<std::string> DeprecatedIds;
265 SarifReportingConfiguration DefaultConfiguration;
266
267 SarifRule() : DefaultConfiguration(SarifReportingConfiguration::create()) {}
268
269public:
270 static SarifRule create() { return {}; }
271
272 SarifRule setName(llvm::StringRef RuleName) {
273 Name = RuleName.str();
274 return *this;
275 }
276
277 SarifRule setRuleId(llvm::StringRef RuleId) {
278 Id = RuleId.str();
279 return *this;
280 }
281
282 SarifRule setDescription(llvm::StringRef RuleDesc) {
283 Description = RuleDesc.str();
284 return *this;
285 }
286
287 SarifRule setHelpURI(llvm::StringRef RuleHelpURI) {
288 HelpURI = RuleHelpURI.str();
289 return *this;
290 }
291
294 DeprecatedIds.assign(RuleDeprecatedIds.begin(), RuleDeprecatedIds.end());
295 return *this;
296 }
297
300 DefaultConfiguration = Configuration;
301 return *this;
302 }
303};
304
305/// A SARIF result (also called a "reporting item") is a unit of output
306/// produced when one of the tool's \c reportingDescriptor encounters a match
307/// on the file being analysed by the tool.
308///
309/// This builder provides a \ref SarifResult::create static method that can be
310/// used to create an empty shell onto which attributes can be added using the
311/// \c setX(...) methods.
312///
313/// For example:
314/// \code{.cpp}
315/// SarifResult result = SarifResult::create(...)
316/// .setRuleId(...)
317/// .setDiagnosticMessage(...);
318/// \endcode
319///
320/// Reference:
321/// 1. <a href="https://docs.oasis-open.org/sarif/sarif/v2.1.0/os/sarif-v2.1.0-os.html#_Toc34317638">SARIF<pre>result</pre></a>
322class SarifResult {
324
325 // NOTE:
326 // This type cannot fit all possible indexes representable by JSON, but is
327 // chosen because it is the largest unsigned type that can be safely
328 // converted to an \c int64_t.
329 uint32_t RuleIdx;
330 std::string RuleId;
331 std::string DiagnosticMessage;
332 std::string HostedViewerURI;
333 llvm::SmallDenseMap<StringRef, std::string, 4> PartialFingerprints;
337 std::optional<SarifResultLevel> LevelOverride;
338 llvm::StringMap<std::string> Properties;
339
340 SarifResult() = delete;
341 explicit SarifResult(uint32_t RuleIdx) : RuleIdx(RuleIdx) {}
342
343public:
344 static SarifResult create(uint32_t RuleIdx) { return SarifResult{RuleIdx}; }
345
346 SarifResult setIndex(uint32_t Idx) {
347 RuleIdx = Idx;
348 return *this;
349 }
350
351 SarifResult setRuleId(llvm::StringRef Id) {
352 RuleId = Id.str();
353 return *this;
354 }
355
356 SarifResult setDiagnosticMessage(llvm::StringRef Message) {
357 DiagnosticMessage = Message.str();
358 return *this;
359 }
360
361 SarifResult setHostedViewerURI(llvm::StringRef URI) {
362 HostedViewerURI = URI.str();
363 return *this;
364 }
365
367#ifndef NDEBUG
368 for (const auto &Loc : DiagLocs) {
369 assert(Loc.isCharRange() &&
370 "SARIF Results require character granular source ranges!");
371 }
372#endif
373 Locations.append(DiagLocs.begin(), DiagLocs.end());
374 return *this;
375 }
376
378 llvm::StringRef Message = "") {
379#ifndef NDEBUG
380 for (const auto &Loc : DiagLocs) {
381 assert(
382 Loc.isCharRange() &&
383 "SARIF RelatedLocations require character granular source ranges!");
384 }
385#endif
386 for (const CharSourceRange &Loc : DiagLocs)
387 RelatedLocations.emplace_back(Loc, Message.str());
388 return *this;
389 }
390
391 SarifResult setThreadFlows(llvm::ArrayRef<ThreadFlow> ThreadFlowResults) {
392 ThreadFlows.assign(ThreadFlowResults.begin(), ThreadFlowResults.end());
393 return *this;
394 }
395
396 SarifResult setDiagnosticLevel(const SarifResultLevel &TheLevel) {
397 LevelOverride = TheLevel;
398 return *this;
399 }
400
401 SarifResult addProperty(llvm::StringRef Key, llvm::StringRef Value) {
402 Properties[Key] = Value.str();
403 return *this;
404 }
405
406 SarifResult addPartialFingerprint(llvm::StringRef key,
407 llvm::StringRef value) {
408 PartialFingerprints[key] = value;
409 return *this;
410 }
411};
412
413/// This class handles creating a valid SARIF document given various input
414/// attributes. However, it requires an ordering among certain method calls:
415///
416/// 1. Because every SARIF document must contain at least 1 \c run, callers
417/// must ensure that \ref SarifDocumentWriter::createRun is called before
418/// any other methods.
419/// 2. If SarifDocumentWriter::endRun is called, callers MUST call
420/// SarifDocumentWriter::createRun, before invoking any of the result
421/// aggregation methods such as SarifDocumentWriter::appendResult etc.
423private:
424 const llvm::StringRef SchemaURI{
425 "https://docs.oasis-open.org/sarif/sarif/v2.1.0/cos02/schemas/"
426 "sarif-schema-2.1.0.json"};
427 const llvm::StringRef SchemaVersion{"2.1.0"};
428
429 /// \internal
430 /// Return a pointer to the current tool. Asserts that a run exists.
431 llvm::json::Object &getCurrentTool();
432
433 /// \internal
434 /// Reset portions of the internal state so that the document is ready to
435 /// receive data for a new run.
436 void reset();
437
438 /// \internal
439 /// Return a mutable reference to the current run, after asserting it exists.
440 ///
441 /// \note It is undefined behavior to call this if a run does not exist in
442 /// the SARIF document.
443 llvm::json::Object &getCurrentRun();
444
445 /// Create a code flow object for the given threadflows.
446 /// See \ref ThreadFlow.
447 ///
448 /// \note It is undefined behavior to call this if a run does not exist in
449 /// the SARIF document.
450 llvm::json::Object
451 createCodeFlow(const llvm::ArrayRef<ThreadFlow> ThreadFlows);
452
453 /// Add the given threadflows to the ones this SARIF document knows about.
454 llvm::json::Array
455 createThreadFlows(const llvm::ArrayRef<ThreadFlow> ThreadFlows);
456
457 /// Add the given \ref CharSourceRange to the SARIF document as a physical
458 /// location, with its corresponding artifact. Returns std::nullopt if \p R
459 /// is invalid or does not map to a file.
460 std::optional<llvm::json::Object>
461 createPhysicalLocation(const CharSourceRange &R);
462
463public:
465
466 /// Create a new empty SARIF document with the given source manager.
467 SarifDocumentWriter(const SourceManager &SourceMgr) : SourceMgr(SourceMgr) {}
468
469 /// Release resources held by this SARIF document.
471
472 /// Create a new run with which any upcoming analysis will be associated.
473 /// Each run requires specifying the tool that is generating reporting items.
474 void createRun(const llvm::StringRef ShortToolName,
475 const llvm::StringRef LongToolName,
476 const llvm::StringRef ToolVersion = CLANG_VERSION_STRING,
477 const llvm::StringRef InformationUri =
478 "https://clang.llvm.org/docs/UsersManual.html");
479
480 /// If there is a current run, end it.
481 ///
482 /// This method collects various book-keeping required to clear and close
483 /// resources associated with the current run, but may also allocate some
484 /// for the next run.
485 ///
486 /// Calling \ref endRun before associating a run through \ref createRun leads
487 /// to undefined behaviour.
488 void endRun();
489
490 /// Associate the given rule with the current run.
491 ///
492 /// Returns an integer rule index for the created rule that is unique within
493 /// the current run, which can then be used to create a \ref SarifResult
494 /// to add to the current run. Note that a rule must exist before being
495 /// referenced by a result.
496 ///
497 /// \pre
498 /// There must be a run associated with the document, failing to do so will
499 /// cause undefined behaviour.
500 size_t createRule(const SarifRule &Rule);
501
502 /// Append a new result to the currently in-flight run.
503 ///
504 /// \pre
505 /// There must be a run associated with the document, failing to do so will
506 /// cause undefined behaviour.
507 /// \pre
508 /// \c RuleIdx used to create the result must correspond to a rule known by
509 /// the SARIF document. It must be the value returned by a previous call
510 /// to \ref createRule.
512
513 /// Return the SARIF document in its current state.
514 /// Calling this will trigger a copy of the internal state including all
515 /// reported diagnostics, resulting in an expensive call.
516 llvm::json::Object createDocument();
517
518 static std::string fileNameToURI(llvm::StringRef Filename);
519
520private:
521 /// Source Manager to use for the current SARIF document.
522 const SourceManager &SourceMgr;
523
524 /// Flag to track the state of this document:
525 /// A closed document is one on which a new runs must be created.
526 /// This could be a document that is freshly created, or has recently
527 /// finished writing to a previous run.
528 bool Closed = true;
529
530 /// A sequence of SARIF runs.
531 /// Each run object describes a single run of an analysis tool and contains
532 /// the output of that run.
533 ///
534 /// Reference: <a href="https://docs.oasis-open.org/sarif/sarif/v2.1.0/os/sarif-v2.1.0-os.html#_Toc34317484">run object</a>
535 llvm::json::Array Runs;
536
537 /// The list of rules associated with the most recent active run. These are
538 /// defined using the diagnostics passed to the SarifDocument. Each rule
539 /// need not be unique through the result set. E.g. there may be several
540 /// 'syntax' errors throughout code under analysis, each of which has its
541 /// own specific diagnostic message (and consequently, RuleId). Rules are
542 /// also known as "reportingDescriptor" objects in SARIF.
543 ///
544 /// Reference: <a href="https://docs.oasis-open.org/sarif/sarif/v2.1.0/os/sarif-v2.1.0-os.html#_Toc34317556">rules property</a>
546
547 /// The list of artifacts that have been encountered on the most recent active
548 /// run. An artifact is defined in SARIF as a sequence of bytes addressable
549 /// by a URI. A common example for clang's case would be files named by
550 /// filesystem paths.
551 llvm::StringMap<detail::SarifArtifact> CurrentArtifacts;
552};
553} // namespace clang
554
555#endif // LLVM_CLANG_BASIC_SARIF_H
Defines the clang::SourceLocation class and associated facilities.
Defines version macros and version-related utility functions for Clang.
Represents a byte-granular source range.
This class handles creating a valid SARIF document given various input attributes.
Definition Sarif.h:422
~SarifDocumentWriter()=default
Release resources held by this SARIF document.
SarifDocumentWriter(const SourceManager &SourceMgr)
Create a new empty SARIF document with the given source manager.
Definition Sarif.h:467
void createRun(const llvm::StringRef ShortToolName, const llvm::StringRef LongToolName, const llvm::StringRef ToolVersion=CLANG_VERSION_STRING, const llvm::StringRef InformationUri="https://clang.llvm.org/docs/UsersManual.html")
Create a new run with which any upcoming analysis will be associated.
Definition Sarif.cpp:355
size_t createRule(const SarifRule &Rule)
Associate the given rule with the current run.
Definition Sarif.cpp:390
static std::string fileNameToURI(llvm::StringRef Filename)
Definition Sarif.cpp:70
llvm::json::Object createDocument()
Return the SARIF document in its current state.
Definition Sarif.cpp:459
void endRun()
If there is a current run, end it.
Definition Sarif.cpp:266
void appendResult(const SarifResult &SarifResult)
Append a new result to the currently in-flight run.
Definition Sarif.cpp:396
A SARIF Reporting Configuration (reportingConfiguration) object contains properties for a SarifRule t...
Definition Sarif.h:211
static SarifReportingConfiguration create()
Definition Sarif.h:221
SarifReportingConfiguration disable()
Definition Sarif.h:223
SarifReportingConfiguration enable()
Definition Sarif.h:228
SarifReportingConfiguration setLevel(SarifResultLevel TheLevel)
Definition Sarif.h:233
SarifReportingConfiguration setRank(float TheRank)
Definition Sarif.h:238
A SARIF result (also called a "reporting item") is a unit of output produced when one of the tool's r...
Definition Sarif.h:322
SarifResult setIndex(uint32_t Idx)
Definition Sarif.h:346
SarifResult setHostedViewerURI(llvm::StringRef URI)
Definition Sarif.h:361
SarifResult addProperty(llvm::StringRef Key, llvm::StringRef Value)
Definition Sarif.h:401
SarifResult setThreadFlows(llvm::ArrayRef< ThreadFlow > ThreadFlowResults)
Definition Sarif.h:391
SarifResult setDiagnosticMessage(llvm::StringRef Message)
Definition Sarif.h:356
SarifResult setRuleId(llvm::StringRef Id)
Definition Sarif.h:351
SarifResult addPartialFingerprint(llvm::StringRef key, llvm::StringRef value)
Definition Sarif.h:406
SarifResult addLocations(llvm::ArrayRef< CharSourceRange > DiagLocs)
Definition Sarif.h:366
SarifResult setDiagnosticLevel(const SarifResultLevel &TheLevel)
Definition Sarif.h:396
SarifResult addRelatedLocations(llvm::ArrayRef< CharSourceRange > DiagLocs, llvm::StringRef Message="")
Definition Sarif.h:377
static SarifResult create(uint32_t RuleIdx)
Definition Sarif.h:344
A SARIF rule (reportingDescriptor object) contains information that describes a reporting item genera...
Definition Sarif.h:257
SarifRule setDescription(llvm::StringRef RuleDesc)
Definition Sarif.h:282
SarifRule setHelpURI(llvm::StringRef RuleHelpURI)
Definition Sarif.h:287
SarifRule setDeprecatedIds(llvm::ArrayRef< llvm::StringRef > RuleDeprecatedIds)
Definition Sarif.h:293
SarifRule setRuleId(llvm::StringRef RuleId)
Definition Sarif.h:277
static SarifRule create()
Definition Sarif.h:270
SarifRule setDefaultConfiguration(const SarifReportingConfiguration &Configuration)
Definition Sarif.h:299
SarifRule setName(llvm::StringRef RuleName)
Definition Sarif.h:272
This class handles loading and caching of source files into memory.
friend class SarifDocumentWriter
Definition Sarif.h:176
ThreadFlow setImportance(const ThreadFlowImportance &ItemImportance)
Definition Sarif.h:194
ThreadFlow setRange(const CharSourceRange &ItemRange)
Definition Sarif.h:187
static ThreadFlow create()
Definition Sarif.h:185
ThreadFlow setMessage(llvm::StringRef ItemMessage)
Definition Sarif.h:199
SarifArtifactLocation setIndex(uint32_t Idx)
Definition Sarif.h:86
static SarifArtifactLocation create(llvm::StringRef URI)
Definition Sarif.h:82
SarifArtifact setOffset(uint32_t ArtifactOffset)
Definition Sarif.h:123
SarifArtifact setMimeType(llvm::StringRef ArtifactMimeType)
Definition Sarif.h:138
static SarifArtifact create(const SarifArtifactLocation &Loc)
Definition Sarif.h:119
SarifArtifact setRoles(std::initializer_list< llvm::StringRef > ArtifactRoles)
Definition Sarif.h:133
SarifArtifact setLength(size_t NumBytes)
Definition Sarif.h:128
Top level wrappers for InstallAPI frontend operations.
SarifResultLevel
The level of severity associated with a SarifResult.
Definition Sarif.h:165
ThreadFlowImportance
Definition Sarif.h:146