clang  11.0.0git
Macros | Functions | Variables
CheckerRegistry.cpp File Reference
#include "clang/StaticAnalyzer/Frontend/CheckerRegistry.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/LLVM.h"
#include "clang/Driver/DriverDiagnostic.h"
#include "clang/Frontend/FrontendDiagnostic.h"
#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
#include "clang/StaticAnalyzer/Core/AnalyzerOptions.h"
#include "clang/StaticAnalyzer/Core/CheckerManager.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/DynamicLibrary.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include "clang/StaticAnalyzer/Checkers/Checkers.inc"
Include dependency graph for CheckerRegistry.cpp:

Go to the source code of this file.

Macros

#define GET_CHECKERS
 
#define CHECKER(FULLNAME, CLASS, HELPTEXT, DOC_URI, IS_HIDDEN)
 
#define GET_PACKAGES
 
#define PACKAGE(FULLNAME)   addPackage(FULLNAME);
 
#define GET_CHECKER_DEPENDENCIES
 
#define CHECKER_DEPENDENCY(FULLNAME, DEPENDENCY)   addDependency(FULLNAME, DEPENDENCY);
 
#define GET_CHECKER_WEAK_DEPENDENCIES
 
#define CHECKER_WEAK_DEPENDENCY(FULLNAME, DEPENDENCY)   addWeakDependency(FULLNAME, DEPENDENCY);
 
#define GET_CHECKER_OPTIONS
 
#define CHECKER_OPTION(TYPE, FULLNAME, CMDFLAG, DESC, DEFAULT_VAL, DEVELOPMENT_STATUS, IS_HIDDEN)
 
#define GET_PACKAGE_OPTIONS
 
#define PACKAGE_OPTION(TYPE, FULLNAME, CMDFLAG, DESC, DEFAULT_VAL, DEVELOPMENT_STATUS, IS_HIDDEN)
 

Functions

static bool isCompatibleAPIVersion (const char *VersionString)
 
template<typename IsEnabledFn >
static bool collectStrongDependencies (const ConstCheckerInfoList &Deps, const CheckerManager &Mgr, CheckerInfoSet &Ret, IsEnabledFn IsEnabled)
 
template<typename IsEnabledFn >
static void collectWeakDependencies (const ConstCheckerInfoList &Deps, const CheckerManager &Mgr, CheckerInfoSet &Ret, IsEnabledFn IsEnabled)
 Collects weak dependencies in enabledData.Checkers. More...
 
static void insertAndValidate (StringRef FullName, const CmdLineOption &Option, AnalyzerOptions &AnOpts, DiagnosticsEngine &Diags)
 Insert the checker/package option to AnalyzerOptions' config table, and validate it, if the user supplied it on the command line. More...
 
template<class T >
static void insertOptionToCollection (StringRef FullName, T &Collection, const CmdLineOption &Option, AnalyzerOptions &AnOpts, DiagnosticsEngine &Diags)
 
static void isOptionContainedIn (const CmdLineOptionList &OptionList, StringRef SuppliedChecker, StringRef SuppliedOption, const AnalyzerOptions &AnOpts, DiagnosticsEngine &Diags)
 

Variables

static constexpr char PackageSeparator = '.'
 

Macro Definition Documentation

◆ CHECKER

#define CHECKER (   FULLNAME,
  CLASS,
  HELPTEXT,
  DOC_URI,
  IS_HIDDEN 
)
Value:
addChecker(register##CLASS, shouldRegister##CLASS, FULLNAME, HELPTEXT, \
DOC_URI, IS_HIDDEN);

◆ CHECKER_DEPENDENCY

#define CHECKER_DEPENDENCY (   FULLNAME,
  DEPENDENCY 
)    addDependency(FULLNAME, DEPENDENCY);

◆ CHECKER_OPTION

#define CHECKER_OPTION (   TYPE,
  FULLNAME,
  CMDFLAG,
  DESC,
  DEFAULT_VAL,
  DEVELOPMENT_STATUS,
  IS_HIDDEN 
)
Value:
addCheckerOption(TYPE, FULLNAME, CMDFLAG, DEFAULT_VAL, DESC, \
DEVELOPMENT_STATUS, IS_HIDDEN);
#define TYPE(DERIVED, BASE)
Definition: ASTFwd.h:26

◆ CHECKER_WEAK_DEPENDENCY

#define CHECKER_WEAK_DEPENDENCY (   FULLNAME,
  DEPENDENCY 
)    addWeakDependency(FULLNAME, DEPENDENCY);

◆ GET_CHECKER_DEPENDENCIES

#define GET_CHECKER_DEPENDENCIES

◆ GET_CHECKER_OPTIONS

#define GET_CHECKER_OPTIONS

◆ GET_CHECKER_WEAK_DEPENDENCIES

#define GET_CHECKER_WEAK_DEPENDENCIES

◆ GET_CHECKERS

#define GET_CHECKERS

◆ GET_PACKAGE_OPTIONS

#define GET_PACKAGE_OPTIONS

◆ GET_PACKAGES

#define GET_PACKAGES

◆ PACKAGE

#define PACKAGE (   FULLNAME)    addPackage(FULLNAME);

◆ PACKAGE_OPTION

#define PACKAGE_OPTION (   TYPE,
  FULLNAME,
  CMDFLAG,
  DESC,
  DEFAULT_VAL,
  DEVELOPMENT_STATUS,
  IS_HIDDEN 
)
Value:
addPackageOption(TYPE, FULLNAME, CMDFLAG, DEFAULT_VAL, DESC, \
DEVELOPMENT_STATUS, IS_HIDDEN);
#define TYPE(DERIVED, BASE)
Definition: ASTFwd.h:26

Function Documentation

◆ collectStrongDependencies()

template<typename IsEnabledFn >
static bool collectStrongDependencies ( const ConstCheckerInfoList &  Deps,
const CheckerManager &  Mgr,
CheckerInfoSet &  Ret,
IsEnabledFn  IsEnabled 
)
static

◆ collectWeakDependencies()

template<typename IsEnabledFn >
static void collectWeakDependencies ( const ConstCheckerInfoList &  Deps,
const CheckerManager &  Mgr,
CheckerInfoSet &  Ret,
IsEnabledFn  IsEnabled 
)
static

Collects weak dependencies in enabledData.Checkers.

Definition at line 281 of file CheckerRegistry.cpp.

References collectStrongDependencies().

Referenced by clang::ento::CheckerRegistry::CheckerRegistry(), and clang::ento::CheckerRegistry::initializeRegistry().

◆ insertAndValidate()

static void insertAndValidate ( StringRef  FullName,
const CmdLineOption &  Option,
AnalyzerOptions AnOpts,
DiagnosticsEngine Diags 
)
static

Insert the checker/package option to AnalyzerOptions' config table, and validate it, if the user supplied it on the command line.

Definition at line 342 of file CheckerRegistry.cpp.

References clang::AnalyzerOptions::Config, clang::DiagnosticsEngine::Report(), and clang::AnalyzerOptions::ShouldEmitErrorsOnInvalidConfigValue.

Referenced by insertOptionToCollection().

◆ insertOptionToCollection()

template<class T >
static void insertOptionToCollection ( StringRef  FullName,
T &  Collection,
const CmdLineOption &  Option,
AnalyzerOptions AnOpts,
DiagnosticsEngine Diags 
)
static

◆ isCompatibleAPIVersion()

static bool isCompatibleAPIVersion ( const char *  VersionString)
static

◆ isOptionContainedIn()

static void isOptionContainedIn ( const CmdLineOptionList &  OptionList,
StringRef  SuppliedChecker,
StringRef  SuppliedOption,
const AnalyzerOptions AnOpts,
DiagnosticsEngine Diags 
)
static

Variable Documentation

◆ PackageSeparator

constexpr char PackageSeparator = '.'
static

Definition at line 45 of file CheckerRegistry.cpp.