clang: lib/Basic/Sarif.cpp File Reference (original) (raw)

This file contains the declaration of the SARIFDocumentWriter class, and associated builders such as: More...

#include "[clang/Basic/Sarif.h](Sarif%5F8h%5Fsource.html)"
#include "[clang/Basic/SourceLocation.h](SourceLocation%5F8h%5Fsource.html)"
#include "[clang/Basic/SourceManager.h](SourceManager%5F8h%5Fsource.html)"
#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>

Go to the source code of this file.

Functions
static StringRef getFileName (FileEntryRef FE)
static unsigned int adjustColumnPos (FullSourceLoc Loc, unsigned int TokenLen=0)
Calculate the column position expressed in the number of UTF-8 code points from column start to the source location.
URI
static std::string percentEncodeURICharacter (char C)
static std::string fileNameToURI (StringRef Filename)
SARIF Utilities
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)

This file contains the declaration of the SARIFDocumentWriter class, and associated builders such as:

Definition in file Sarif.cpp.

adjustColumnPos()

Calculate the column position expressed in the number of UTF-8 code points from column start to the source location.

Parameters

Loc The source location whose column needs to be calculated.
TokenLen Optional hint for when the token is multiple bytes long.

Returns

The column number as a UTF-8 aware byte offset from column start to the effective source location.

Definition at line 117 of file Sarif.cpp.

References clang::SourceLocation::isInvalid(), and Loc.

Referenced by createTextRegion().

createLocation()

static json::Object createLocation ( json::Object && PhysicalLocation, StringRef Message = "" ) static

createMessage()

static json::Object createMessage ( StringRef Text) static

createTextRegion()

createThreadFlowLocation()

static json::Object createThreadFlowLocation ( json::Object && Location, const ThreadFlowImportance & Importance ) static

fileNameToURI()

static std::string fileNameToURI ( StringRef Filename) static

getFileName()

importanceToStr()

percentEncodeURICharacter()

static std::string percentEncodeURICharacter ( char C) static

resultLevelToStr()