clang  8.0.0svn
Namespaces | Macros | Functions
IteratorChecker.cpp File Reference
#include "ClangSACheckers.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"
#include "clang/StaticAnalyzer/Core/Checker.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/DynamicTypeMap.h"
#include <utility>
Include dependency graph for IteratorChecker.cpp:

Go to the source code of this file.

Namespaces

 IteratorComparison
 

Macros

#define REGISTER_CHECKER(name)
 

Functions

 REGISTER_MAP_WITH_PROGRAMSTATE (IteratorRegionMap, const MemRegion *, IteratorPosition) REGISTER_MAP_WITH_PROGRAMSTATE(IteratorComparisonMap
 
bool IteratorComparison::isIteratorType (const QualType &Type)
 
bool IteratorComparison::isIterator (const CXXRecordDecl *CRD)
 
bool IteratorComparison::isComparisonOperator (OverloadedOperatorKind OK)
 
bool IteratorComparison::isBeginCall (const FunctionDecl *Func)
 
bool IteratorComparison::isEndCall (const FunctionDecl *Func)
 
bool IteratorComparison::isAssignCall (const FunctionDecl *Func)
 
bool IteratorComparison::isClearCall (const FunctionDecl *Func)
 
bool IteratorComparison::isPushBackCall (const FunctionDecl *Func)
 
bool IteratorComparison::isEmplaceBackCall (const FunctionDecl *Func)
 
bool IteratorComparison::isPopBackCall (const FunctionDecl *Func)
 
bool IteratorComparison::isPushFrontCall (const FunctionDecl *Func)
 
bool IteratorComparison::isEmplaceFrontCall (const FunctionDecl *Func)
 
bool IteratorComparison::isPopFrontCall (const FunctionDecl *Func)
 
bool IteratorComparison::isInsertCall (const FunctionDecl *Func)
 
bool IteratorComparison::isEraseCall (const FunctionDecl *Func)
 
bool IteratorComparison::isEraseAfterCall (const FunctionDecl *Func)
 
bool IteratorComparison::isEmplaceCall (const FunctionDecl *Func)
 
bool IteratorComparison::isAssignmentOperator (OverloadedOperatorKind OK)
 
bool IteratorComparison::isSimpleComparisonOperator (OverloadedOperatorKind OK)
 
bool IteratorComparison::isAccessOperator (OverloadedOperatorKind OK)
 
bool IteratorComparison::isDereferenceOperator (OverloadedOperatorKind OK)
 
bool IteratorComparison::isIncrementOperator (OverloadedOperatorKind OK)
 
bool IteratorComparison::isDecrementOperator (OverloadedOperatorKind OK)
 
bool IteratorComparison::isRandomIncrOrDecrOperator (OverloadedOperatorKind OK)
 
bool IteratorComparison::hasSubscriptOperator (ProgramStateRef State, const MemRegion *Reg)
 
bool IteratorComparison::frontModifiable (ProgramStateRef State, const MemRegion *Reg)
 
bool IteratorComparison::backModifiable (ProgramStateRef State, const MemRegion *Reg)
 
BinaryOperator::Opcode IteratorComparison::getOpcode (const SymExpr *SE)
 
const RegionOrSymbol IteratorComparison::getRegionOrSymbol (const SVal &Val)
 
const ProgramStateRef IteratorComparison::processComparison (ProgramStateRef State, RegionOrSymbol LVal, RegionOrSymbol RVal, bool Equal)
 
const ProgramStateRef IteratorComparison::saveComparison (ProgramStateRef State, const SymExpr *Condition, const SVal &LVal, const SVal &RVal, bool Eq)
 
const IteratorComparison * IteratorComparison::loadComparison (ProgramStateRef State, const SymExpr *Condition)
 
SymbolRef IteratorComparison::getContainerBegin (ProgramStateRef State, const MemRegion *Cont)
 
SymbolRef IteratorComparison::getContainerEnd (ProgramStateRef State, const MemRegion *Cont)
 
ProgramStateRef IteratorComparison::createContainerBegin (ProgramStateRef State, const MemRegion *Cont, const SymbolRef Sym)
 
ProgramStateRef IteratorComparison::createContainerEnd (ProgramStateRef State, const MemRegion *Cont, const SymbolRef Sym)
 
const IteratorPosition * IteratorComparison::getIteratorPosition (ProgramStateRef State, const SVal &Val)
 
const IteratorPosition * IteratorComparison::getIteratorPosition (ProgramStateRef State, RegionOrSymbol RegOrSym)
 
ProgramStateRef IteratorComparison::setIteratorPosition (ProgramStateRef State, const SVal &Val, const IteratorPosition &Pos)
 
ProgramStateRef IteratorComparison::setIteratorPosition (ProgramStateRef State, RegionOrSymbol RegOrSym, const IteratorPosition &Pos)
 
ProgramStateRef IteratorComparison::removeIteratorPosition (ProgramStateRef State, const SVal &Val)
 
ProgramStateRef IteratorComparison::adjustIteratorPosition (ProgramStateRef State, RegionOrSymbol RegOrSym, const IteratorPosition &Pos, bool Equal)
 
ProgramStateRef IteratorComparison::relateIteratorPositions (ProgramStateRef State, const IteratorPosition &Pos1, const IteratorPosition &Pos2, bool Equal)
 
ProgramStateRef IteratorComparison::invalidateAllIteratorPositions (ProgramStateRef State, const MemRegion *Cont)
 
ProgramStateRef IteratorComparison::invalidateAllIteratorPositionsExcept (ProgramStateRef State, const MemRegion *Cont, SymbolRef Offset, BinaryOperator::Opcode Opc)
 
ProgramStateRef IteratorComparison::invalidateIteratorPositions (ProgramStateRef State, SymbolRef Offset, BinaryOperator::Opcode Opc)
 
ProgramStateRef IteratorComparison::invalidateIteratorPositions (ProgramStateRef State, SymbolRef Offset1, BinaryOperator::Opcode Opc1, SymbolRef Offset2, BinaryOperator::Opcode Opc2)
 
ProgramStateRef IteratorComparison::reassignAllIteratorPositions (ProgramStateRef State, const MemRegion *Cont, const MemRegion *NewCont)
 
ProgramStateRef IteratorComparison::reassignAllIteratorPositionsUnless (ProgramStateRef State, const MemRegion *Cont, const MemRegion *NewCont, SymbolRef Offset, BinaryOperator::Opcode Opc)
 
ProgramStateRef IteratorComparison::rebaseSymbolInIteratorPositionsIf (ProgramStateRef State, SValBuilder &SVB, SymbolRef OldSym, SymbolRef NewSym, SymbolRef CondSym, BinaryOperator::Opcode Opc)
 
const ContainerData * IteratorComparison::getContainerData (ProgramStateRef State, const MemRegion *Cont)
 
ProgramStateRef IteratorComparison::setContainerData (ProgramStateRef State, const MemRegion *Cont, const ContainerData &CData)
 
bool IteratorComparison::hasLiveIterators (ProgramStateRef State, const MemRegion *Cont)
 
bool IteratorComparison::isBoundThroughLazyCompoundVal (const Environment &Env, const MemRegion *Reg)
 
bool IteratorComparison::isOutOfRange (ProgramStateRef State, const IteratorPosition &Pos)
 
bool IteratorComparison::isZero (ProgramStateRef State, const NonLoc &Val)
 
static ProgramStateRef assumeNoOverflow (ProgramStateRef State, SymbolRef Sym, long Scale)
 

Macro Definition Documentation

◆ REGISTER_CHECKER

#define REGISTER_CHECKER (   name)
Value:
void ento::register##name(CheckerManager &Mgr) { \
auto *checker = Mgr.registerChecker<IteratorChecker>(); \
checker->ChecksEnabled[IteratorChecker::CK_##name] = true; \
checker->CheckNames[IteratorChecker::CK_##name] = \
Mgr.getCurrentCheckName(); \
}

Definition at line 2352 of file IteratorChecker.cpp.

Function Documentation

◆ assumeNoOverflow()

static ProgramStateRef assumeNoOverflow ( ProgramStateRef  State,
SymbolRef  Sym,
long  Scale 
)
static

◆ REGISTER_MAP_WITH_PROGRAMSTATE()

REGISTER_MAP_WITH_PROGRAMSTATE ( IteratorRegionMap  ,
const MemRegion *  ,
IteratorPosition   
)