/freebsd/contrib/llvm-project/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ |
H A D | Store.h | 74 virtual SVal getBinding(Store store, Loc loc, QualType T = QualType()) = 0; 86 virtual std::optional<SVal> getDefaultBinding(Store store, 97 std::optional<SVal> getDefaultBinding(nonloc::LazyCompoundVal lcv) { in getDefaultBinding() 108 virtual StoreRef Bind(Store store, Loc loc, SVal val) = 0; 114 SVal V) = 0; 144 virtual SVal getLValueIvar(const ObjCIvarDecl *decl, SVal base); 146 virtual SVal getLValueField(const FieldDecl *D, SVal Base) { in getLValueField() 150 virtual SVal getLValueElement(QualType elementType, NonLoc offset, SVal Base); 154 virtual SVal ArrayToPointer(Loc Array, QualType ElementTy) = 0; 158 SVal evalDerivedToBase(SVal Derived, const CastExpr *Cast); [all …]
|
H A D | SVals.h | 55 class SVal { 70 explicit SVal(SValKind Kind, const void *Data = nullptr) 78 explicit SVal() = default; 99 bool operator==(SVal R) const { return Kind == R.Kind && Data == R.Data; } 100 bool operator!=(SVal R) const { return !(*this == R); } 174 inline raw_ostream &operator<<(raw_ostream &os, clang::ento::SVal V) { 182 inline constexpr auto Id##Kind = SVal::SValKind::NonLoc##Id##Kind; 189 inline constexpr auto Id##Kind = SVal::SValKind::Loc##Id##Kind; 193 class UndefinedVal : public SVal { 195 UndefinedVal() : SVal(UndefinedValKind) {} in UndefinedVal() [all …]
|
H A D | SValBuilder.h | 84 SVal evalCast(SVal V, QualType CastTy, QualType OriginalTy); 87 SVal evalIntegralCast(ProgramStateRef state, SVal val, QualType castTy, 90 SVal evalMinus(NonLoc val); 91 SVal evalComplement(NonLoc val); 95 virtual SVal evalBinOpNN(ProgramStateRef state, BinaryOperator::Opcode op, 100 virtual SVal evalBinOpLL(ProgramStateRef state, BinaryOperator::Opcode op, 106 virtual SVal evalBinOpLN(ProgramStateRef state, BinaryOperator::Opcode op, 111 virtual const llvm::APSInt *getKnownValue(ProgramStateRef state, SVal val) = 0; 117 virtual const llvm::APSInt *getMinValue(ProgramStateRef state, SVal val) = 0; 123 virtual const llvm::APSInt *getMaxValue(ProgramStateRef state, SVal val) = 0; [all …]
|
H A D | ProgramState.h | 261 ConditionTruthVal isNonNull(SVal V) const; 265 ConditionTruthVal isNull(SVal V) const; 268 ConditionTruthVal areEqual(SVal Lhs, SVal Rhs) const; 281 const LocationContext *LCtx, SVal V, 284 [[nodiscard]] ProgramStateRef bindLoc(Loc location, SVal V, 288 [[nodiscard]] ProgramStateRef bindLoc(SVal location, SVal V, 298 bindDefaultInitial(SVal loc, SVal V, const LocationContext *LCtx) const; 303 bindDefaultZero(SVal loc, const LocationContext *LCtx) const; 333 invalidateRegions(ArrayRef<SVal> Regions, const Expr *E, unsigned BlockCount, 346 SVal getSelfSVal(const LocationContext *LC) const; [all …]
|
H A D | BasicValueFactory.h | 42 llvm::ImmutableList<SVal> L; 45 CompoundValData(QualType t, llvm::ImmutableList<SVal> l) : T(t), L(l) { in CompoundValData() 49 using iterator = llvm::ImmutableList<SVal>::iterator; 57 llvm::ImmutableList<SVal> L); 124 llvm::ImmutableList<SVal>::Factory SValListFactory; 245 llvm::ImmutableList<SVal> Vals); 254 llvm::ImmutableList<SVal> getEmptySValList() { in getEmptySValList() 258 llvm::ImmutableList<SVal> prependSVal(SVal X, llvm::ImmutableList<SVal> L) { in prependSVal() 280 const std::pair<SVal, uintptr_t>& 281 getPersistentSValWithData(const SVal& V, uintptr_t Data); [all …]
|
H A D | ExprEngine.h | 385 ProgramStateRef processAssume(ProgramStateRef state, SVal cond, 601 SVal evalBinOp(ProgramStateRef ST, BinaryOperator::Opcode Op, in evalBinOp() 602 SVal LHS, SVal RHS, QualType T) { in evalBinOp() 624 static std::optional<SVal> 631 ProgramStateRef State, ArrayRef<std::pair<SVal, SVal>> LocAndVals, 649 SVal location, SVal Val, bool atDeclInit = false, 654 SVal Loc, SVal Val, 659 ProgramStateRef escapeValues(ProgramStateRef State, ArrayRef<SVal> Vs, 675 SVal location, 682 ExplodedNode *Pred, ProgramStateRef St, SVal TargetLV, SVal Val, [all …]
|
/freebsd/contrib/llvm-project/clang/lib/StaticAnalyzer/Checkers/ |
H A D | IteratorModeling.cpp | 94 SVal, SVal, SVal) const; 102 void handleComparison(CheckerContext &C, const Expr *CE, SVal RetVal, 103 SVal LVal, SVal RVal, OverloadedOperatorKind Op) const; 105 SymbolRef Sym1, SymbolRef Sym2, SVal RetVal, 107 void handleIncrement(CheckerContext &C, SVal RetVal, SVal Iter, 109 void handleDecrement(CheckerContext &C, SVal RetVal, SVal Iter, 112 OverloadedOperatorKind Op, SVal RetVal, 113 SVal Iterator, SVal Amount) const; 115 OverloadedOperatorKind OK, SVal Offset) const; 116 void handleAdvance(CheckerContext &C, const Expr *CE, SVal RetVal, SVal Iter, [all …]
|
H A D | IteratorRangeChecker.cpp | 38 void verifyDereference(CheckerContext &C, SVal Val) const; 39 void verifyIncrement(CheckerContext &C, SVal Iter) const; 40 void verifyDecrement(CheckerContext &C, SVal Iter) const; 42 SVal LHS, SVal RHS) const; 43 void verifyAdvance(CheckerContext &C, SVal LHS, SVal RHS) const; 44 void verifyPrev(CheckerContext &C, SVal LHS, SVal RHS) const; 45 void verifyNext(CheckerContext &C, SVal LHS, SVal RHS) const; 46 void reportBug(StringRef Message, SVal Val, CheckerContext &C, 56 using AdvanceFn = void (IteratorRangeChecker::*)(CheckerContext &, SVal, 57 SVal) const; [all …]
|
H A D | ContainerModeling.cpp | 36 void handleBegin(CheckerContext &C, const Expr *CE, SVal RetVal, 37 SVal Cont) const; 38 void handleEnd(CheckerContext &C, const Expr *CE, SVal RetVal, 39 SVal Cont) const; 40 void handleAssignment(CheckerContext &C, SVal Cont, const Expr *CE = nullptr, 41 SVal OldCont = UndefinedVal()) const; 42 void handleAssign(CheckerContext &C, SVal Cont, const Expr *ContE) const; 43 void handleClear(CheckerContext &C, SVal Cont, const Expr *ContE) const; 44 void handlePushBack(CheckerContext &C, SVal Cont, const Expr *ContE) const; 45 void handlePopBack(CheckerContext &C, SVal Cont, const Expr *ContE) const; [all …]
|
H A D | CStringChecker.cpp | 251 ProgramStateRef state, SVal V, QualType Ty); 255 SVal strLength); 256 static SVal getCStringLengthForRegion(CheckerContext &C, 261 SVal getCStringLength(CheckerContext &C, 264 SVal Buf, 270 SVal val) const; 275 const Expr *BufE, SVal BufV, SVal SizeV, 280 CheckerContext &C, ProgramStateRef S, const Expr *BufE, SVal BufV); 285 CheckerContext &C, ProgramStateRef S, const Expr *BufE, SVal BufV); 290 const Expr *BufE, SVal BufV); [all …]
|
H A D | InvalidatedIteratorChecker.cpp | 37 void verifyAccess(CheckerContext &C, SVal Val) const; 38 void reportBug(StringRef Message, SVal Val, CheckerContext &C, 77 SVal SubVal = State->getSVal(UO->getSubExpr(), C.getLocationContext()); in checkPreStmt() 88 SVal LVal = State->getSVal(BO->getLHS(), C.getLocationContext()); in checkPreStmt() 98 SVal LVal = State->getSVal(ASE->getLHS(), C.getLocationContext()); in checkPreStmt() 108 SVal BaseVal = State->getSVal(ME->getBase(), C.getLocationContext()); in checkPreStmt() 113 SVal Val) const { in verifyAccess() 125 void InvalidatedIteratorChecker::reportBug(StringRef Message, SVal Val, in reportBug()
|
H A D | VLASizeChecker.cpp | 49 const VariableArrayType *VLA, SVal &ArraySize) const; 58 CheckerContext &C, SVal TaintedSVal) const; 70 SVal &ArraySize) const { in checkVLA() 117 SVal Mul = SVB.evalBinOpNN(State, BO_Mul, ArrSize, IndexLength, SizeTy); in checkVLA() 155 SVal SizeV = C.getSVal(SizeE); in checkVLAIndexSize() 187 SVal LessThanZeroVal = in checkVLAIndexSize() 212 CheckerContext &C, SVal TaintedSVal) const { in reportTaintBug() 288 SVal ArraySize; in checkPreStmt() 328 SVal ArraySize; in checkPreStmt()
|
H A D | CheckObjCDealloc.cpp | 126 ProgramStateRef evalAssume(ProgramStateRef State, SVal Cond, 159 bool isInInstanceDealloc(const CheckerContext &C, SVal &SelfValOut) const; 161 SVal &SelfValOut) const; 163 SVal &InstanceValOut) const; 264 SVal SelfVal; in checkBeginFunction() 290 SVal LVal = State->getLValue(PropImpl->getPropertyIvarDecl(), SelfVal); in checkBeginFunction() 295 SVal InitialVal = State->getSVal(*LValLoc); in checkBeginFunction() 339 SVal DeallocedInstance; in checkPreObjCMessage() 412 ProgramStateRef ObjCDeallocChecker::evalAssume(ProgramStateRef State, SVal Cond, in evalAssume() 498 SVal SelfVal; in diagnoseMissingReleases() [all …]
|
H A D | NonnullGlobalConstantsChecker.cpp | 45 void checkLocation(SVal l, bool isLoad, const Stmt *S, 51 bool isGlobalConstString(SVal V) const; 70 void NonnullGlobalConstantsChecker::checkLocation(SVal location, bool isLoad, in checkLocation() 80 SVal V = State->getSVal(location.castAs<Loc>()); in checkLocation() 95 bool NonnullGlobalConstantsChecker::isGlobalConstString(SVal V) const { in isGlobalConstString()
|
H A D | CheckPlacementNew.cpp | 36 SVal getExtentSizeOfNewTarget(const CXXNewExpr *NE, CheckerContext &C, 40 SVal getExtentSizeOfPlace(const CXXNewExpr *NE, CheckerContext &C) const; 64 SVal PlacementNewChecker::getExtentSizeOfPlace(const CXXNewExpr *NE, in getExtentSizeOfPlace() 70 SVal PlacementNewChecker::getExtentSizeOfNewTarget(const CXXNewExpr *NE, in getExtentSizeOfNewTarget() 82 SVal ElementCount = C.getSVal(SizeExpr); in getExtentSizeOfNewTarget() 105 SVal SizeOfTarget = getExtentSizeOfNewTarget(NE, C, IsArrayTypeAllocated); in checkPlaceCapacityIsSufficient() 106 SVal SizeOfPlace = getExtentSizeOfPlace(NE, C); in checkPlaceCapacityIsSufficient() 282 SVal PlaceVal = C.getSVal(Place); in checkPlaceIsAlignedProperly()
|
H A D | UnixAPIChecker.cpp | 56 EnsurePtrNotNull(SVal PtrVal, const Expr *PtrExpr, CheckerContext &C, 62 SVal LinePtrPtrSVal, SVal SizePtrSVal, const Expr *LinePtrPtrExpr, 114 SVal PtrVal, const Expr *PtrExpr, CheckerContext &C, ProgramStateRef State, in EnsurePtrNotNull() 271 const SVal V = Call.getArgSVal(FlagsArgIndex); in CheckOpenVariant() 281 SVal maskedFlagsUC = C.getSValBuilder().evalBinOpNN(state, BO_And, in CheckOpenVariant() 315 SVal LinePtrPtrSVal, SVal SizePtrSVal, const Expr *LinePtrPtrExpr, in EnsureGetdelimBufferAndSizeCorrect() 376 SVal SizePtrSval = Call.getArgSVal(1); in CheckGetDelim() 382 SVal LinePtrPtrSVal = Call.getArgSVal(0); in CheckGetDelim() 450 const SVal argVal, in IsZeroByteAllocation() 499 SVal argVal = C.getSVal(arg); in BasicAllocationCheck() [all …]
|
/freebsd/contrib/llvm-project/clang/lib/StaticAnalyzer/Core/ |
H A D | RegionStore.cpp | 147 typedef llvm::ImmutableMap<BindingKey, SVal> ClusterBindings; 148 typedef llvm::ImmutableMapRef<BindingKey, SVal> ClusterBindingsRef; 149 typedef std::pair<BindingKey, SVal> BindingPair; 197 RegionBindingsRef addBinding(BindingKey K, SVal V) const; 200 BindingKey::Kind k, SVal V) const; 202 const SVal *lookup(BindingKey K) const; 203 const SVal *lookup(const MemRegion *R, BindingKey::Kind k) const; 216 std::optional<SVal> getDirectBinding(const MemRegion *R) const; 220 std::optional<SVal> getDefaultBinding(const MemRegion *R) const; 267 std::optional<SVal> [all …]
|
H A D | ExprEngineC.cpp | 29 static SVal conjureOffsetSymbolOnLocation( in conjureOffsetSymbolOnLocation() 30 SVal Symbol, SVal Other, Expr* Expression, SValBuilder &svalBuilder, in conjureOffsetSymbolOnLocation() 58 SVal LeftV = state->getSVal(LHS, LCtx); in VisitBinaryOperator() 59 SVal RightV = state->getSVal(RHS, LCtx); in VisitBinaryOperator() 73 SVal ExprVal = B->isGLValue() ? LeftV : RightV; in VisitBinaryOperator() 100 SVal Result = evalBinOp(state, Op, LeftV, RightV, B->getType()); in VisitBinaryOperator() 133 SVal location = LeftV; in VisitBinaryOperator() 139 SVal V = state->getSVal(LHS, LCtx); in VisitBinaryOperator() 156 SVal Result = svalBuilder.evalCast(evalBinOp(state, Op, V, RightV, CTy), in VisitBinaryOperator() 162 SVal LHSVal; in VisitBinaryOperator() [all …]
|
H A D | Store.cpp | 232 static bool regionMatchesCXXRecordType(SVal V, QualType Ty) { in regionMatchesCXXRecordType() 252 SVal StoreManager::evalDerivedToBase(SVal Derived, const CastExpr *Cast) { in evalDerivedToBase() 259 SVal Result = Derived; in evalDerivedToBase() 266 SVal StoreManager::evalDerivedToBase(SVal Derived, const CXXBasePath &Path) { in evalDerivedToBase() 268 SVal Result = Derived; in evalDerivedToBase() 275 SVal StoreManager::evalDerivedToBase(SVal Derived, QualType BaseType, in evalDerivedToBase() 316 std::optional<SVal> StoreManager::evalBaseToDerived(SVal Base, in evalBaseToDerived() 398 SVal StoreManager::getLValueFieldOrIvar(const Decl *D, SVal Base) { in getLValueFieldOrIvar() 439 SVal StoreManager::getLValueIvar(const ObjCIvarDecl *decl, SVal base) { in getLValueIvar() 443 SVal StoreManager::getLValueElement(QualType elementType, NonLoc Offset, in getLValueElement() [all …]
|
H A D | ProgramState.cpp | 115 SVal V, in bindLoc() 129 ProgramState::bindDefaultInitial(SVal loc, SVal V, in bindDefaultInitial() 139 ProgramState::bindDefaultZero(SVal loc, const LocationContext *LCtx) const { in bindDefaultZero() 148 typedef ArrayRef<SVal> ValueList; 158 SmallVector<SVal, 8> Values; in invalidateRegions() 233 SVal ProgramState::wrapSymbolicRegion(SVal Val) const { in wrapSymbolicRegion() 251 SVal ProgramState::getSelfSVal(const LocationContext *LCtx) const { in getSelfSVal() 254 return SVal(); in getSelfSVal() 258 SVal ProgramState::getSValAsScalarOrLoc(const MemRegion *R) const { in getSValAsScalarOrLoc() 274 SVal ProgramState::getSVal(Loc location, QualType T) const { in getSVal() [all …]
|
H A D | SVals.cpp | 46 const FunctionDecl *SVal::getAsFunctionDecl() const { in getAsFunctionDecl() 68 SymbolRef SVal::getAsLocSymbol(bool IncludeBaseRegions) const { in getAsLocSymbol() 80 SymbolRef SVal::getLocSymbolInBase() const { in getLocSymbolInBase() 104 SymbolRef SVal::getAsSymbol(bool IncludeBaseRegions) const { in getAsSymbol() 112 const llvm::APSInt *SVal::getAsInteger() const { in getAsInteger() 120 const MemRegion *SVal::getAsRegion() const { in getAsRegion() 181 QualType SVal::getType(const ASTContext &Context) const { in getType() 246 bool SVal::isConstant() const { in isConstant() 250 bool SVal::isConstant(int I) const { in isConstant() 258 bool SVal::isZeroConstant() const { in isZeroConstant() [all …]
|
H A D | ExprEngineCXX.cpp | 46 SVal ThisVal; in performTrivialCopy() 76 SVal V = Call.getArgSVal(0); in performTrivialCopy() 100 SVal ExprEngine::makeElementRegion(ProgramStateRef State, SVal LValue, in makeElementRegion() 121 SVal ExprEngine::computeObjectUnderConstruction( in computeObjectUnderConstruction() 148 SVal ThisVal = State->getSVal(ThisPtr); in computeObjectUnderConstruction() 162 SVal FieldVal; in computeObjectUnderConstruction() 179 SVal V = *getObjectUnderConstruction(State, NE, LCtx); in computeObjectUnderConstruction() 265 SVal V = computeObjectUnderConstruction( in computeObjectUnderConstruction() 316 SVal Base = loc::MemRegionVal( in computeObjectUnderConstruction() 337 auto getArgLoc = [&](CallEventRef<> Caller) -> std::optional<SVal> { in computeObjectUnderConstruction() [all …]
|
H A D | CallEvent.cpp | 242 SmallVector<SVal, 8> ValuesToInvalidate; in invalidateRegions() 308 SVal CallEvent::getArgSVal(unsigned Index) const { in getArgSVal() 322 SVal CallEvent::getReturnValue() const { in getReturnValue() 400 static SVal processArgument(SVal Value, const Expr *ArgumentExpr, in processArgument() 419 llvm::ImmutableList<SVal> CompoundSVals = BVF.getEmptySValList(); in processArgument() 435 static SVal castArgToParamTypeIfNeeded(const CallEvent &Call, unsigned ArgIdx, in castArgToParamTypeIfNeeded() 436 SVal ArgVal, SValBuilder &SVB) { in castArgToParamTypeIfNeeded() 484 SVal ArgVal = Call.getArgSVal(Idx); in addParameterValuesToBindings() 540 std::optional<SVal> CallEvent::getReturnValueUnderConstruction() const { in getReturnValueUnderConstruction() 547 SVal RetVal = Engine.computeObjectUnderConstruction( in getReturnValueUnderConstruction() [all …]
|
H A D | ExprEngine.cpp | 185 typedef llvm::ImmutableMap<ConstructedObjectKey, SVal> 269 SVal V = state->getSVal(loc::MemRegionVal(R)); in getInitialState() 270 SVal Constraint_untested = evalBinOp(state, BO_GT, V, in getInitialState() 292 SVal V = state->getSVal(loc::MemRegionVal(R)); in getInitialState() 309 SVal V = state->getSVal(L); in getInitialState() 330 SVal InitValWithAdjustments = State->getSVal(InitWithAdjustments, LC); in createTemporaryRegionIfNeeded() 386 if (std::optional<SVal> V = getObjectUnderConstruction(State, MT, LC)) { in createTemporaryRegionIfNeeded() 408 SVal Reg = loc::MemRegionVal(TR); in createTemporaryRegionIfNeeded() 409 SVal BaseReg = Reg; in createTemporaryRegionIfNeeded() 437 SVal InitVal = State->getSVal(Init, LC); in createTemporaryRegionIfNeeded() [all …]
|
/freebsd/contrib/llvm-project/clang/include/clang/StaticAnalyzer/Checkers/ |
H A D | Taint.h | 35 [[nodiscard]] ProgramStateRef addTaint(ProgramStateRef State, SVal V, 48 [[nodiscard]] ProgramStateRef removeTaint(ProgramStateRef State, SVal V); 70 bool isTainted(ProgramStateRef State, SVal V, 88 std::vector<SymbolRef> getTaintedSymbols(ProgramStateRef State, SVal V, 107 std::vector<SymbolRef> getTaintedSymbolsImpl(ProgramStateRef State, SVal V,
|