clang  12.0.0git
Functions
CastValueChecker.cpp File Reference
#include "clang/AST/DeclTemplate.h"
#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
#include "clang/StaticAnalyzer/Core/Checker.h"
#include "clang/StaticAnalyzer/Core/CheckerManager.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/DynamicType.h"
#include "llvm/ADT/Optional.h"
#include <utility>
Include dependency graph for CastValueChecker.cpp:

Go to the source code of this file.

Functions

static bool isInfeasibleCast (const DynamicCastInfo *CastInfo, bool CastSucceeds)
 
static const NoteTag * getNoteTag (CheckerContext &C, const DynamicCastInfo *CastInfo, QualType CastToTy, const Expr *Object, bool CastSucceeds, bool IsKnownCast)
 
static QualType alignReferenceTypes (QualType toAlign, QualType alignTowards, ASTContext &ACtx)
 
static void addCastTransition (const CallEvent &Call, DefinedOrUnknownSVal DV, CheckerContext &C, bool IsNonNullParam, bool IsNonNullReturn, bool IsCheckedCast=false)
 
static void addInstanceOfTransition (const CallEvent &Call, DefinedOrUnknownSVal DV, ProgramStateRef State, CheckerContext &C, bool IsInstanceOf)
 
static void evalNonNullParamNonNullReturn (const CallEvent &Call, DefinedOrUnknownSVal DV, CheckerContext &C, bool IsCheckedCast=false)
 
static void evalNonNullParamNullReturn (const CallEvent &Call, DefinedOrUnknownSVal DV, CheckerContext &C)
 
static void evalNullParamNullReturn (const CallEvent &Call, DefinedOrUnknownSVal DV, CheckerContext &C)
 
static void evalZeroParamNonNullReturn (const CallEvent &Call, DefinedOrUnknownSVal DV, CheckerContext &C, bool IsCheckedCast=false)
 
static void evalZeroParamNullReturn (const CallEvent &Call, DefinedOrUnknownSVal DV, CheckerContext &C)
 

Function Documentation

◆ addCastTransition()

static void addCastTransition ( const CallEvent &  Call,
DefinedOrUnknownSVal  DV,
CheckerContext &  C,
bool  IsNonNullParam,
bool  IsNonNullReturn,
bool  IsCheckedCast = false 
)
static

◆ addInstanceOfTransition()

static void addInstanceOfTransition ( const CallEvent &  Call,
DefinedOrUnknownSVal  DV,
ProgramStateRef  State,
CheckerContext &  C,
bool  IsInstanceOf 
)
static

◆ alignReferenceTypes()

static QualType alignReferenceTypes ( QualType  toAlign,
QualType  alignTowards,
ASTContext ACtx 
)
static

◆ evalNonNullParamNonNullReturn()

static void evalNonNullParamNonNullReturn ( const CallEvent &  Call,
DefinedOrUnknownSVal  DV,
CheckerContext &  C,
bool  IsCheckedCast = false 
)
static

Definition at line 263 of file CastValueChecker.cpp.

References addCastTransition().

Referenced by evalNullParamNullReturn().

◆ evalNonNullParamNullReturn()

static void evalNonNullParamNullReturn ( const CallEvent &  Call,
DefinedOrUnknownSVal  DV,
CheckerContext &  C 
)
static

Definition at line 271 of file CastValueChecker.cpp.

References addCastTransition().

Referenced by evalNullParamNullReturn().

◆ evalNullParamNullReturn()

static void evalNullParamNullReturn ( const CallEvent &  Call,
DefinedOrUnknownSVal  DV,
CheckerContext &  C 
)
static

◆ evalZeroParamNonNullReturn()

static void evalZeroParamNonNullReturn ( const CallEvent &  Call,
DefinedOrUnknownSVal  DV,
CheckerContext &  C,
bool  IsCheckedCast = false 
)
static

Definition at line 320 of file CastValueChecker.cpp.

References addCastTransition().

Referenced by evalZeroParamNullReturn().

◆ evalZeroParamNullReturn()

static void evalZeroParamNullReturn ( const CallEvent &  Call,
DefinedOrUnknownSVal  DV,
CheckerContext &  C 
)
static

◆ getNoteTag()

static const NoteTag* getNoteTag ( CheckerContext &  C,
const DynamicCastInfo *  CastInfo,
QualType  CastToTy,
const Expr Object,
bool  CastSucceeds,
bool  IsKnownCast 
)
static

◆ isInfeasibleCast()

static bool isInfeasibleCast ( const DynamicCastInfo *  CastInfo,
bool  CastSucceeds 
)
static

Definition at line 96 of file CastValueChecker.cpp.

Referenced by addCastTransition(), and addInstanceOfTransition().