| /openbsd-src/gnu/llvm/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 | 72 class SVal { 89 explicit SVal(const void *d, bool isLoc, unsigned ValKind) in SVal() function 92 explicit SVal(BaseKind k, const void *D = nullptr) : Data(D), Kind(k) {} in Data() 95 explicit SVal() = default; 118 bool operator==(SVal R) const { 122 bool operator!=(SVal R) const { return !(*this == R); } 209 inline raw_ostream &operator<<(raw_ostream &os, clang::ento::SVal V) { 214 class UndefinedVal : public SVal { 216 UndefinedVal() : SVal(UndefinedValKind) {} in UndefinedVal() 217 static bool classof(SVal V) { return V.getBaseKind() == UndefinedValKind; } in classof() [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; 116 virtual SVal simplifySVal(ProgramStateRef State, SVal Val) = 0; 119 SVal makeSymExprValNN(BinaryOperator::Opcode op, [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 | SVals.def | 1 //===-- SVals.def - Metadata about SVal kinds -------------------*- C++ -*-===// 9 // The list of symbolic values (SVal kinds and sub-kinds) used in the Static 10 // Analyzer. The distinction between loc:: and nonloc:: SVal namespaces is 15 // BASIC_SVAL(Id, Parent) - for specific SVal sub-kinds, which are 19 // ABSTRACT_SVAL(Id, Parent) - for abstract SVal classes which are 22 // ABSTRACT_SVAL_WITH_KIND(Id, Parent) - for SVal classes which are also 54 BASIC_SVAL(UndefinedVal, SVal) 55 ABSTRACT_SVAL(DefinedOrUnknownSVal, SVal)
|
| H A D | ExprEngine.h | 393 ProgramStateRef processAssume(ProgramStateRef state, SVal cond, 616 SVal evalBinOp(ProgramStateRef ST, BinaryOperator::Opcode Op, in evalBinOp() 617 SVal LHS, SVal RHS, QualType T) { in evalBinOp() 639 static std::optional<SVal> 646 ProgramStateRef State, ArrayRef<std::pair<SVal, SVal>> LocAndVals, 664 SVal location, SVal Val, bool atDeclInit = false, 669 SVal Loc, SVal Val, 674 ProgramStateRef escapeValues(ProgramStateRef State, ArrayRef<SVal> Vs, 690 SVal location, 697 ExplodedNode *Pred, ProgramStateRef St, SVal TargetLV, SVal Val, [all …]
|
| /openbsd-src/gnu/llvm/clang/lib/StaticAnalyzer/Checkers/ |
| H A D | IteratorModeling.cpp | 93 SVal, SVal, SVal) const; 101 void handleComparison(CheckerContext &C, const Expr *CE, SVal RetVal, 102 const SVal &LVal, const SVal &RVal, 105 SymbolRef Sym1, SymbolRef Sym2, const SVal &RetVal, 107 void handleIncrement(CheckerContext &C, const SVal &RetVal, const SVal &Iter, 109 void handleDecrement(CheckerContext &C, const SVal &RetVal, const SVal &Iter, 112 OverloadedOperatorKind Op, const SVal &RetVal, 113 const SVal &Iterator, const 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 | 37 void verifyDereference(CheckerContext &C, SVal Val) const; 38 void verifyIncrement(CheckerContext &C, SVal Iter) const; 39 void verifyDecrement(CheckerContext &C, SVal Iter) const; 41 SVal LHS, SVal RHS) const; 42 void verifyAdvance(CheckerContext &C, SVal LHS, SVal RHS) const; 43 void verifyPrev(CheckerContext &C, SVal LHS, SVal RHS) const; 44 void verifyNext(CheckerContext &C, SVal LHS, SVal RHS) const; 45 void reportBug(const StringRef &Message, SVal Val, CheckerContext &C, 57 using AdvanceFn = void (IteratorRangeChecker::*)(CheckerContext &, SVal, 58 SVal) const; [all …]
|
| H A D | GTestChecker.cpp | 112 SVal 114 SVal Instance, 117 static ProgramStateRef assumeValuesEqual(SVal Val1, SVal Val2, 136 SVal BooleanArgVal = Call->getArgSVal(0); in modelAssertionResultBoolConstructor() 144 SVal ThisVal = Call->getCXXThisVal(); in modelAssertionResultBoolConstructor() 146 SVal ThisSuccess = getAssertionResultSuccessFieldValue( in modelAssertionResultBoolConstructor() 166 SVal OtherVal = Call->getArgSVal(0); in modelAssertionResultCopyConstructor() 167 SVal ThisVal = Call->getCXXThisVal(); in modelAssertionResultCopyConstructor() 172 SVal ThisSuccess = getAssertionResultSuccessFieldValue(AssertResultClassDecl, in modelAssertionResultCopyConstructor() 174 SVal OtherSuccess = getAssertionResultSuccessFieldValue(AssertResultClassDecl, in modelAssertionResultCopyConstructor() [all …]
|
| H A D | ArrayBoundCheckerV2.cpp | 43 void checkLocation(SVal l, bool isLoad, const Stmt*S, 51 SVal byteOffset; 57 RegionRawOffsetV2(const SubRegion* base, SVal offset) in RegionRawOffsetV2() 65 SVal location); 72 static SVal computeExtentBegin(SValBuilder &svalBuilder, in computeExtentBegin() 117 void ArrayBoundCheckerV2::checkLocation(SVal location, bool isLoad, in checkLocation() 145 SVal extentBegin = computeExtentBegin(svalBuilder, rawOffset.getRegion()); in checkLocation() 156 SVal lowerBound = svalBuilder.evalBinOpNN(state, BO_LT, rawOffsetVal, *NV, in checkLocation() 194 SVal upperbound = svalBuilder.evalBinOpNN(state, BO_GE, rawOffsetVal, in checkLocation() 208 SVal ByteOffset = rawOffset.getByteOffset(); in checkLocation() [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 | MismatchedIteratorChecker.cpp | 35 void verifyMatch(CheckerContext &C, const SVal &Iter, 37 void verifyMatch(CheckerContext &C, const SVal &Iter1, 38 const SVal &Iter2) const; 39 void reportBug(const StringRef &Message, const SVal &Val1, 40 const SVal &Val2, CheckerContext &C, 42 void reportBug(const StringRef &Message, const SVal &Val, 170 SVal LHS = UndefinedVal(); in checkPreCall() 200 SVal LVal = State->getSVal(BO->getLHS(), C.getLocationContext()); in checkPreStmt() 201 SVal RVal = State->getSVal(BO->getRHS(), C.getLocationContext()); in checkPreStmt() 205 void MismatchedIteratorChecker::verifyMatch(CheckerContext &C, const SVal &Iter, in verifyMatch() [all …]
|
| H A D | CStringChecker.cpp | 234 ProgramStateRef state, SVal V, QualType Ty); 238 SVal strLength); 239 static SVal getCStringLengthForRegion(CheckerContext &C, 244 SVal getCStringLength(CheckerContext &C, 247 SVal Buf, 253 SVal val) const; 257 const Expr *Ex, SVal V, 264 static bool memsetAux(const Expr *DstBuffer, SVal CharE, 270 AnyArgExpr Arg, SVal l) const; 272 AnyArgExpr Buffer, SVal Element, [all …]
|
| H A D | ObjCSelfInitChecker.cpp | 54 static bool isSelfVar(SVal location, CheckerContext &C); 74 void checkLocation(SVal location, bool isLoad, const Stmt *S, 76 void checkBind(SVal loc, SVal val, const Stmt *S, CheckerContext &C) const; 106 static SelfFlagEnum getSelfFlags(SVal val, ProgramStateRef state) { in REGISTER_MAP_WITH_PROGRAMSTATE() 113 static SelfFlagEnum getSelfFlags(SVal val, CheckerContext &C) { in getSelfFlags() 117 static void addSelfFlag(ProgramStateRef state, SVal val, in addSelfFlag() 127 static bool hasSelfFlag(SVal val, SelfFlagEnum flag, CheckerContext &C) { in hasSelfFlag() 135 SVal exprVal = C.getSVal(E); in isInvalidSelf() 186 SVal V = C.getSVal(Msg.getOriginExpr()); in checkPostObjCMessage() 253 SVal argV = CE.getArgSVal(i); in checkPreCall() [all …]
|
| H A D | TestAfterDivZeroChecker.cpp | 82 void reportBug(SVal Val, CheckerContext &C) const; 88 void setDivZeroMap(SVal Var, CheckerContext &C) const; 89 bool hasDivZeroMap(SVal Var, const CheckerContext &C) const; 90 bool isZero(SVal S, CheckerContext &C) const; 116 SVal S = Succ->getSVal(E); in REGISTER_SET_WITH_PROGRAMSTATE() 135 bool TestAfterDivZeroChecker::isZero(SVal S, CheckerContext &C) const { in isZero() 145 void TestAfterDivZeroChecker::setDivZeroMap(SVal Var, CheckerContext &C) const { in setDivZeroMap() 156 bool TestAfterDivZeroChecker::hasDivZeroMap(SVal Var, in hasDivZeroMap() 166 void TestAfterDivZeroChecker::reportBug(SVal Val, CheckerContext &C) const { in reportBug() 206 SVal S = C.getSVal(B->getRHS()); in checkPreStmt() [all …]
|
| H A D | InvalidatedIteratorChecker.cpp | 36 void verifyAccess(CheckerContext &C, const SVal &Val) const; 37 void reportBug(const StringRef &Message, const SVal &Val, 82 SVal SubVal = State->getSVal(UO->getSubExpr(), C.getLocationContext()); in checkPreStmt() 93 SVal LVal = State->getSVal(BO->getLHS(), C.getLocationContext()); in checkPreStmt() 103 SVal LVal = State->getSVal(ASE->getLHS(), C.getLocationContext()); in checkPreStmt() 113 SVal BaseVal = State->getSVal(ME->getBase(), C.getLocationContext()); in checkPreStmt() 117 void InvalidatedIteratorChecker::verifyAccess(CheckerContext &C, const SVal &Val) const { in verifyAccess() 130 const SVal &Val, CheckerContext &C, in reportBug()
|
| /openbsd-src/gnu/llvm/clang/lib/StaticAnalyzer/Core/ |
| H A D | SimpleSValBuilder.cpp | 31 const llvm::APSInt *getConstValue(ProgramStateRef state, SVal V); 53 SVal simplifyUntilFixpoint(ProgramStateRef State, SVal Val); 59 SVal simplifySValOnce(ProgramStateRef State, SVal V); 67 SVal evalBinOpNN(ProgramStateRef state, BinaryOperator::Opcode op, 69 SVal evalBinOpLL(ProgramStateRef state, BinaryOperator::Opcode op, 71 SVal evalBinOpLN(ProgramStateRef state, BinaryOperator::Opcode op, 77 const llvm::APSInt *getKnownValue(ProgramStateRef state, SVal V) override; 79 SVal simplifySVal(ProgramStateRef State, SVal V) override; 81 SVal MakeSymIntVal(const SymExpr *LHS, BinaryOperator::Opcode op, 113 SVal SimpleSValBuilder::MakeSymIntVal(const SymExpr *LHS, in MakeSymIntVal() [all …]
|
| H A D | RegionStore.cpp | 146 typedef llvm::ImmutableMap<BindingKey, SVal> ClusterBindings; 147 typedef llvm::ImmutableMapRef<BindingKey, SVal> ClusterBindingsRef; 148 typedef std::pair<BindingKey, SVal> BindingPair; 196 RegionBindingsRef addBinding(BindingKey K, SVal V) const; 199 BindingKey::Kind k, SVal V) const; 201 const SVal *lookup(BindingKey K) const; 202 const SVal *lookup(const MemRegion *R, BindingKey::Kind k) const; 215 std::optional<SVal> getDirectBinding(const MemRegion *R) const; 219 std::optional<SVal> getDefaultBinding(const MemRegion *R) const; 265 std::optional<SVal> [all …]
|
| H A D | Store.cpp | 231 static bool regionMatchesCXXRecordType(SVal V, QualType Ty) { in regionMatchesCXXRecordType() 251 SVal StoreManager::evalDerivedToBase(SVal Derived, const CastExpr *Cast) { in evalDerivedToBase() 258 SVal Result = Derived; in evalDerivedToBase() 267 SVal StoreManager::evalDerivedToBase(SVal Derived, const CXXBasePath &Path) { in evalDerivedToBase() 269 SVal Result = Derived; in evalDerivedToBase() 276 SVal StoreManager::evalDerivedToBase(SVal Derived, QualType BaseType, in evalDerivedToBase() 317 std::optional<SVal> StoreManager::evalBaseToDerived(SVal Base, in evalBaseToDerived() 399 SVal StoreManager::getLValueFieldOrIvar(const Decl *D, SVal Base) { in getLValueFieldOrIvar() 440 SVal StoreManager::getLValueIvar(const ObjCIvarDecl *decl, SVal base) { in getLValueIvar() 444 SVal StoreManager::getLValueElement(QualType elementType, NonLoc Offset, in getLValueElement() [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() 141 SVal V = state->getSVal(LHS, LCtx); in VisitBinaryOperator() 158 SVal Result = svalBuilder.evalCast(evalBinOp(state, Op, V, RightV, CTy), in VisitBinaryOperator() 164 SVal LHSVal; in VisitBinaryOperator() [all …]
|
| H A D | SValBuilder.cpp | 121 SVal SValBuilder::convertToArrayIndex(SVal val) { in convertToArrayIndex() 322 std::optional<SVal> SValBuilder::getConstantVal(const Expr *E) { in getConstantVal() 392 std::optional<SVal> Val = getConstantVal(SE); in getConstantVal() 422 SVal SValBuilder::makeSymExprValNN(BinaryOperator::Opcode Op, in makeSymExprValNN() 449 SVal SValBuilder::evalMinus(NonLoc X) { in evalMinus() 461 SVal SValBuilder::evalComplement(NonLoc X) { in evalComplement() 473 SVal SValBuilder::evalUnaryOp(ProgramStateRef state, UnaryOperator::Opcode opc, in evalUnaryOp() 474 SVal operand, QualType type) { in evalUnaryOp() 486 SVal SValBuilder::evalBinOp(ProgramStateRef state, BinaryOperator::Opcode op, in evalBinOp() 487 SVal lhs, SVal rhs, QualType type) { in evalBinOp() [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() 184 QualType SVal::getType(const ASTContext &Context) const { in getType() 249 bool SVal::isConstant() const { in isConstant() 253 bool SVal::isConstant(int I) const { in isConstant() 261 bool SVal::isZeroConstant() const { in isZeroConstant() [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() 238 SVal ProgramState::getSelfSVal(const LocationContext *LCtx) const { in getSelfSVal() 241 return SVal(); in getSelfSVal() 245 SVal ProgramState::getSValAsScalarOrLoc(const MemRegion *R) const { in getSValAsScalarOrLoc() 261 SVal ProgramState::getSVal(Loc location, QualType T) const { in getSVal() 262 SVal V = getRawSVal(location, T); in getSVal() [all …]
|
| H A D | BasicValueFactory.cpp | 33 llvm::ImmutableList<SVal> L) { in Profile() 52 using SValData = std::pair<SVal, uintptr_t>; 53 using SValPair = std::pair<SVal, SVal>; 127 llvm::ImmutableList<SVal> Vals) { in getCompoundValData() 344 const std::pair<SVal, uintptr_t>& 345 BasicValueFactory::getPersistentSValWithData(const SVal& V, uintptr_t Data) { in getPersistentSValWithData() 369 const std::pair<SVal, SVal>& 370 BasicValueFactory::getPersistentSValPair(const SVal& V1, const SVal& V2) { in getPersistentSValPair() 394 const SVal* BasicValueFactory::getPersistentSVal(SVal X) { in getPersistentSVal()
|