clang  16.0.0git
Macros | Functions
SarifDiagnostics.cpp File Reference
#include "clang/Analysis/MacroExpansionContext.h"
#include "clang/Analysis/PathDiagnostic.h"
#include "clang/Basic/FileManager.h"
#include "clang/Basic/Sarif.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Basic/Version.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/StaticAnalyzer/Core/PathDiagnosticConsumers.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/Support/ConvertUTF.h"
#include "llvm/Support/JSON.h"
#include "llvm/Support/Path.h"
#include "clang/StaticAnalyzer/Checkers/Checkers.inc"
Include dependency graph for SarifDiagnostics.cpp:

Go to the source code of this file.

Macros

#define GET_CHECKERS
 
#define CHECKER(FULLNAME, CLASS, HELPTEXT, DOC_URI, IS_HIDDEN)   .Case(FULLNAME, HELPTEXT)
 
#define GET_CHECKERS
 
#define CHECKER(FULLNAME, CLASS, HELPTEXT, DOC_URI, IS_HIDDEN)   .Case(FULLNAME, DOC_URI)
 

Functions

static StringRef getRuleDescription (StringRef CheckName)
 
static StringRef getRuleHelpURIStr (StringRef CheckName)
 
static ThreadFlowImportance calculateImportance (const PathDiagnosticPiece &Piece)
 
static CharSourceRange convertTokenRangeToCharRange (const SourceRange &R, const SourceManager &SM, const LangOptions &LO)
 Accepts a SourceRange corresponding to a pair of the first and last tokens and converts to a Character granular CharSourceRange. More...
 
static SmallVector< ThreadFlow, 8 > createThreadFlows (const PathDiagnostic *Diag, const LangOptions &LO)
 
static StringMap< uint32_t > createRuleMapping (const std::vector< const PathDiagnostic * > &Diags, SarifDocumentWriter &SarifWriter)
 
static SarifResult createResult (const PathDiagnostic *Diag, const StringMap< uint32_t > &RuleMapping, const LangOptions &LO)
 

Macro Definition Documentation

◆ CHECKER [1/2]

#define CHECKER (   FULLNAME,
  CLASS,
  HELPTEXT,
  DOC_URI,
  IS_HIDDEN 
)    .Case(FULLNAME, HELPTEXT)

◆ CHECKER [2/2]

#define CHECKER (   FULLNAME,
  CLASS,
  HELPTEXT,
  DOC_URI,
  IS_HIDDEN 
)    .Case(FULLNAME, DOC_URI)

◆ GET_CHECKERS [1/2]

#define GET_CHECKERS

◆ GET_CHECKERS [2/2]

#define GET_CHECKERS

Function Documentation

◆ calculateImportance()

static ThreadFlowImportance calculateImportance ( const PathDiagnosticPiece &  Piece)
static

Definition at line 92 of file SarifDiagnostics.cpp.

References clang::interp::Call(), and clang::serialized_diags::Note.

Referenced by createThreadFlows().

◆ convertTokenRangeToCharRange()

static CharSourceRange convertTokenRangeToCharRange ( const SourceRange R,
const SourceManager SM,
const LangOptions LO 
)
static

Accepts a SourceRange corresponding to a pair of the first and last tokens and converts to a Character granular CharSourceRange.

Definition at line 112 of file SarifDiagnostics.cpp.

References clang::SourceRange::getBegin(), clang::SourceRange::getEnd(), and SM.

Referenced by createResult(), and createThreadFlows().

◆ createResult()

static SarifResult createResult ( const PathDiagnostic *  Diag,
const StringMap< uint32_t > &  RuleMapping,
const LangOptions LO 
)
static

◆ createRuleMapping()

static StringMap<uint32_t> createRuleMapping ( const std::vector< const PathDiagnostic * > &  Diags,
SarifDocumentWriter SarifWriter 
)
static

◆ createThreadFlows()

static SmallVector<ThreadFlow, 8> createThreadFlows ( const PathDiagnostic *  Diag,
const LangOptions LO 
)
static

◆ getRuleDescription()

static StringRef getRuleDescription ( StringRef  CheckName)
static

Definition at line 69 of file SarifDiagnostics.cpp.

Referenced by createRuleMapping().

◆ getRuleHelpURIStr()

static StringRef getRuleHelpURIStr ( StringRef  CheckName)
static

Definition at line 80 of file SarifDiagnostics.cpp.

Referenced by createRuleMapping().