clang 20.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/CallDescription.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/DynamicType.h"
#include <optional>
#include <utility>

Go to the source code of this file.

Functions

static bool isInfeasibleCast (const DynamicCastInfo *CastInfo, bool CastSucceeds)
 
static const NoteTaggetNoteTag (CheckerContext &C, const DynamicCastInfo *CastInfo, QualType CastToTy, const Expr *Object, bool CastSucceeds, bool IsKnownCast)
 
static const NoteTaggetNoteTag (CheckerContext &C, SmallVector< QualType, 4 > CastToTyVec, const Expr *Object, 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 341 of file CastValueChecker.cpp.

References addCastTransition(), clang::C, and clang::Call.

◆ evalNonNullParamNullReturn()

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

Definition at line 349 of file CastValueChecker.cpp.

References addCastTransition(), clang::C, and clang::Call.

◆ evalNullParamNullReturn()

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

Definition at line 356 of file CastValueChecker.cpp.

References clang::C, and clang::Call.

◆ evalZeroParamNonNullReturn()

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

Definition at line 400 of file CastValueChecker.cpp.

References addCastTransition(), clang::C, and clang::Call.

◆ evalZeroParamNullReturn()

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

Definition at line 408 of file CastValueChecker.cpp.

References addCastTransition(), clang::C, and clang::Call.

◆ getNoteTag() [1/2]

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

◆ getNoteTag() [2/2]

static const NoteTag * getNoteTag ( CheckerContext C,
SmallVector< QualType, 4 >  CastToTyVec,
const Expr Object,
bool  IsKnownCast 
)
static

Definition at line 139 of file CastValueChecker.cpp.

References clang::C, and clang::First.

◆ isInfeasibleCast()

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