clang  3.8.0
Macros | Enumerations | Functions
NullabilityChecker.cpp File Reference
#include "ClangSACheckers.h"
#include "llvm/Support/Path.h"
#include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"
#include "clang/StaticAnalyzer/Core/Checker.h"
#include "clang/StaticAnalyzer/Core/CheckerManager.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h"
Include dependency graph for NullabilityChecker.cpp:

Go to the source code of this file.

Macros

#define REGISTER_CHECKER(name, trackingRequired)
 

Enumerations

enum  Nullability : char
 
enum  ErrorKind : int
 

Functions

 REGISTER_MAP_WITH_PROGRAMSTATE (NullabilityMap, const MemRegion *, NullabilityState) enum class NullConstraint
 
static NullConstraint getNullConstraint (DefinedOrUnknownSVal Val, ProgramStateRef State)
 
static Nullability getNullabilityAnnotation (QualType Type)
 
template<typename ParamVarDeclRange >
static bool checkParamsForPreconditionViolation (const ParamVarDeclRange &Params, ProgramStateRef State, const LocationContext *LocCtxt)
 
static bool checkPreconditionViolation (ProgramStateRef State, ExplodedNode *N, CheckerContext &C)
 
static Nullability getReceiverNullability (const ObjCMethodCall &M, ProgramStateRef State)
 
static const ExprmatchValueExprForBind (const Stmt *S)
 For a given statement performing a bind, attempt to syntactically match the expression resulting in the bound value. More...
 
static bool isARCNilInitializedLocal (CheckerContext &C, const Stmt *S)
 Returns true if. More...
 

Macro Definition Documentation

#define REGISTER_CHECKER (   name,
  trackingRequired 
)
Value:
void ento::register##name##Checker(CheckerManager &mgr) { \
NullabilityChecker *checker = mgr.registerChecker<NullabilityChecker>(); \
checker->Filter.Check##name = true; \
checker->Filter.CheckName##name = mgr.getCurrentCheckName(); \
checker->NeedTracking = checker->NeedTracking || trackingRequired; \
}
CheckName getCurrentCheckName() const
CHECKER * registerChecker()
Used to register checkers.

Definition at line 1049 of file NullabilityChecker.cpp.

Enumeration Type Documentation

enum ErrorKind : int
strong

Definition at line 82 of file NullabilityChecker.cpp.

enum Nullability : char
strong

Definition at line 46 of file NullabilityChecker.cpp.

Function Documentation

template<typename ParamVarDeclRange >
static bool checkParamsForPreconditionViolation ( const ParamVarDeclRange &  Params,
ProgramStateRef  State,
const LocationContext LocCtxt 
)
static

Definition at line 332 of file NullabilityChecker.cpp.

References getNullabilityAnnotation(), and getNullConstraint().

Referenced by checkPreconditionViolation().

static bool checkPreconditionViolation ( ProgramStateRef  State,
ExplodedNode N,
CheckerContext C 
)
static
static Nullability getNullabilityAnnotation ( QualType  Type)
static
static NullConstraint getNullConstraint ( DefinedOrUnknownSVal  Val,
ProgramStateRef  State 
)
static
static Nullability getReceiverNullability ( const ObjCMethodCall M,
ProgramStateRef  State 
)
static
static bool isARCNilInitializedLocal ( CheckerContext C,
const Stmt S 
)
static

Returns true if.

Parameters
Sis a DeclStmt for a local variable that ObjC automated reference counting initialized with zero.

Definition at line 902 of file NullabilityChecker.cpp.

References clang::ento::CheckerContext::getASTContext(), clang::ASTContext::getLangOpts(), and S.

static const Expr* matchValueExprForBind ( const Stmt S)
static

For a given statement performing a bind, attempt to syntactically match the expression resulting in the bound value.

Definition at line 878 of file NullabilityChecker.cpp.

References clang::BO_Assign.

REGISTER_MAP_WITH_PROGRAMSTATE ( NullabilityMap  ,
const MemRegion ,
NullabilityState   
)

Definition at line 237 of file NullabilityChecker.cpp.

References Unknown.