#include "clang/Basic/Sarif.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Basic/SourceManager.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/ConvertUTF.h"
#include "llvm/Support/JSON.h"
#include "llvm/Support/Path.h"
#include <optional>
#include <string>
#include <utility>
usingnamespaceclang;
usingnamespacellvm;
SarifArtifact;
SarifArtifactLocation;
static StringRef getFileName(FileEntryRef FE) { … }
static std::string percentEncodeURICharacter(char C) { … }
static std::string fileNameToURI(StringRef Filename) { … }
static unsigned int adjustColumnPos(FullSourceLoc Loc,
unsigned int TokenLen = 0) { … }
static json::Object createMessage(StringRef Text) { … }
static json::Object createTextRegion(const SourceManager &SM,
const CharSourceRange &R) { … }
static json::Object createLocation(json::Object &&PhysicalLocation,
StringRef Message = "") { … }
static StringRef importanceToStr(ThreadFlowImportance I) { … }
static StringRef resultLevelToStr(SarifResultLevel R) { … }
static json::Object
createThreadFlowLocation(json::Object &&Location,
const ThreadFlowImportance &Importance) { … }
json::Object
SarifDocumentWriter::createPhysicalLocation(const CharSourceRange &R) { … }
json::Object &SarifDocumentWriter::getCurrentTool() { … }
void SarifDocumentWriter::reset() { … }
void SarifDocumentWriter::endRun() { … }
json::Array
SarifDocumentWriter::createThreadFlows(ArrayRef<ThreadFlow> ThreadFlows) { … }
json::Object
SarifDocumentWriter::createCodeFlow(ArrayRef<ThreadFlow> ThreadFlows) { … }
void SarifDocumentWriter::createRun(StringRef ShortToolName,
StringRef LongToolName,
StringRef ToolVersion) { … }
json::Object &SarifDocumentWriter::getCurrentRun() { … }
size_t SarifDocumentWriter::createRule(const SarifRule &Rule) { … }
void SarifDocumentWriter::appendResult(const SarifResult &Result) { … }
json::Object SarifDocumentWriter::createDocument() { … }