Home
last modified time | relevance | path

Searched refs:SVal (Results 1 – 25 of 129) sorted by relevance

123456

/freebsd/contrib/llvm-project/clang/include/clang/StaticAnalyzer/Core/PathSensitive/
H A DStore.h58 llvm::SmallVector<SVal, 0> FailedToBindValues;
82 virtual SVal getBinding(Store store, Loc loc, QualType T = QualType()) = 0;
94 virtual std::optional<SVal> getDefaultBinding(Store store,
105 std::optional<SVal> getDefaultBinding(nonloc::LazyCompoundVal lcv) { in getDefaultBinding()
116 virtual BindResult Bind(Store store, Loc loc, SVal val) = 0;
122 SVal V) = 0;
152 virtual SVal getLValueIvar(const ObjCIvarDecl *decl, SVal base);
154 virtual SVal getLValueField(const FieldDecl *D, SVal Base) { in getLValueField()
158 virtual SVal getLValueElement(QualType elementType, NonLoc offset, SVal Base);
162 virtual SVal ArrayToPointer(Loc Array, QualType ElementTy) = 0;
[all …]
H A DSVals.h56 class SVal {
71 explicit SVal(SValKind Kind, const void *Data = nullptr)
79 explicit SVal() = default;
102 bool operator==(SVal R) const { return Kind == R.Kind && Data == R.Data; }
103 bool operator!=(SVal R) const { return !(*this == R); }
177 inline raw_ostream &operator<<(raw_ostream &os, clang::ento::SVal V) {
185 inline constexpr auto Id##Kind = SVal::SValKind::NonLoc##Id##Kind;
192 inline constexpr auto Id##Kind = SVal::SValKind::Loc##Id##Kind;
196 class UndefinedVal : public SVal {
198 UndefinedVal() : SVal(UndefinedValKind) {} in UndefinedVal()
[all …]
H A DSValBuilder.h85 SVal evalCast(SVal V, QualType CastTy, QualType OriginalTy);
88 SVal evalIntegralCast(ProgramStateRef state, SVal val, QualType castTy,
91 SVal evalMinus(NonLoc val);
92 SVal evalComplement(NonLoc val);
96 virtual SVal evalBinOpNN(ProgramStateRef state, BinaryOperator::Opcode op,
101 virtual SVal evalBinOpLL(ProgramStateRef state, BinaryOperator::Opcode op,
107 virtual SVal evalBinOpLN(ProgramStateRef state, BinaryOperator::Opcode op,
112 virtual const llvm::APSInt *getKnownValue(ProgramStateRef state, SVal val) = 0;
118 virtual const llvm::APSInt *getMinValue(ProgramStateRef state, SVal val) = 0;
124 virtual const llvm::APSInt *getMaxValue(ProgramStateRef state, SVal val) = 0;
[all …]
H A DProgramState.h260 ConditionTruthVal isNonNull(SVal V) const;
264 ConditionTruthVal isNull(SVal V) const;
267 ConditionTruthVal areEqual(SVal Lhs, SVal Rhs) const;
280 const LocationContext *LCtx, SVal V,
283 [[nodiscard]] ProgramStateRef bindLoc(Loc location, SVal V,
287 [[nodiscard]] ProgramStateRef bindLoc(SVal location, SVal V,
297 bindDefaultInitial(SVal loc, SVal V, const LocationContext *LCtx) const;
302 bindDefaultZero(SVal loc, const LocationContext *LCtx) const;
336 invalidateRegions(ArrayRef<SVal> Values, ConstCFGElementRef Elem,
349 SVal getSelfSVal(const LocationContext *LC) const;
[all …]
H A DBasicValueFactory.h43 llvm::ImmutableList<SVal> L;
46 CompoundValData(QualType t, llvm::ImmutableList<SVal> l) : T(t), L(l) { in CompoundValData()
50 using iterator = llvm::ImmutableList<SVal>::iterator;
58 llvm::ImmutableList<SVal> L);
125 llvm::ImmutableList<SVal>::Factory SValListFactory;
237 llvm::ImmutableList<SVal> Vals);
246 llvm::ImmutableList<SVal> getEmptySValList() { in getEmptySValList()
250 llvm::ImmutableList<SVal> prependSVal(SVal X, llvm::ImmutableList<SVal> L) { in prependSVal()
272 const std::pair<SVal, uintptr_t>&
273 getPersistentSValWithData(const SVal& V, uintptr_t Data);
[all …]
H A DExprEngine.h393 ProgramStateRef processAssume(ProgramStateRef state, SVal cond,
614 SVal evalBinOp(ProgramStateRef ST, BinaryOperator::Opcode Op, in evalBinOp()
615 SVal LHS, SVal RHS, QualType T) { in evalBinOp()
637 static std::optional<SVal>
644 ProgramStateRef State, ArrayRef<std::pair<SVal, SVal>> LocAndVals,
662 SVal location, SVal Val, bool atDeclInit = false,
667 SVal Loc, SVal Val,
673 ProgramStateRef escapeValues(ProgramStateRef State, ArrayRef<SVal> Vs,
688 SVal location,
695 ExplodedNode *Pred, ProgramStateRef St, SVal TargetLV, SVal Val,
[all …]
/freebsd/contrib/llvm-project/clang/lib/StaticAnalyzer/Checkers/
H A DIteratorModeling.cpp92 ConstCFGElementRef, SVal, SVal,
93 SVal) const;
102 ConstCFGElementRef Elem, SVal RetVal, SVal LVal,
103 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;
116 SVal Offset) const;
[all …]
H A DIteratorRangeChecker.cpp38 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 DContainerModeling.cpp35 void handleBegin(CheckerContext &C, ConstCFGElementRef Elem, SVal RetVal,
36 SVal Cont) const;
37 void handleEnd(CheckerContext &C, ConstCFGElementRef Elem, SVal RetVal,
38 SVal Cont) const;
39 void handleAssignment(CheckerContext &C, SVal Cont, ConstCFGElementRef Elem,
40 SVal OldCont = UndefinedVal()) const;
41 void handleAssign(CheckerContext &C, SVal Cont, const Expr *ContE) const;
42 void handleClear(CheckerContext &C, SVal Cont, const Expr *ContE) const;
43 void handlePushBack(CheckerContext &C, SVal Cont, const Expr *ContE) const;
44 void handlePopBack(CheckerContext &C, SVal Cont, const Expr *ContE) const;
[all …]
H A DBuiltinFunctionChecker.cpp100 bool BothFeasible, SVal Arg1,
101 SVal Arg2, SVal Result) const;
105 SVal RetCal,
107 std::pair<bool, bool> checkOverflow(CheckerContext &C, SVal RetVal,
129 CheckerContext &C, bool overflow, SVal Arg1, SVal Arg2, SVal Result) const { in createBuiltinOverflowNoteTag()
147 BuiltinFunctionChecker::checkOverflow(CheckerContext &C, SVal RetVal, in checkOverflow()
164 SVal IsLeMax = SVB.evalBinOp(State, BO_LE, RetVal, MaxVal, Res); in checkOverflow()
165 SVal IsGeMin = SVB.evalBinOp(State, BO_GE, RetVal, MinVal, Res); in checkOverflow()
177 SVal RetVal, bool IsOverflow) const { in initStateAftetBuiltinOverflow()
179 SVal Arg1 = Call.getArgSVal(0); in initStateAftetBuiltinOverflow()
[all …]
H A DCStringChecker.cpp250 ProgramStateRef state, SVal V, QualType Ty);
254 SVal strLength);
255 static SVal getCStringLengthForRegion(CheckerContext &C,
260 SVal getCStringLength(CheckerContext &C,
263 SVal Buf,
269 SVal val) const;
275 SVal BufV, SVal SizeV, QualType SizeTy);
279 CheckerContext &C, ProgramStateRef S, ConstCFGElementRef Elem, SVal BufV);
284 CheckerContext &C, ProgramStateRef S, ConstCFGElementRef Elem, SVal BufV);
290 SVal BufV);
[all …]
H A DMismatchedIteratorChecker.cpp37 void verifyMatch(CheckerContext &C, SVal Iter, const MemRegion *Cont) const;
38 void verifyMatch(CheckerContext &C, SVal Iter1, SVal Iter2) const;
39 void reportBug(StringRef Message, SVal Val1, SVal Val2, CheckerContext &C,
41 void reportBug(StringRef Message, SVal Val, const MemRegion *Reg,
166 SVal LHS = UndefinedVal(); in checkPreCall()
196 SVal LVal = State->getSVal(BO->getLHS(), C.getLocationContext()); in checkPreStmt()
197 SVal RVal = State->getSVal(BO->getRHS(), C.getLocationContext()); in checkPreStmt()
201 void MismatchedIteratorChecker::verifyMatch(CheckerContext &C, SVal Iter, in verifyMatch()
237 void MismatchedIteratorChecker::verifyMatch(CheckerContext &C, SVal Iter1, in verifyMatch()
238 SVal Iter2) const { in verifyMatch()
[all …]
H A DObjCSelfInitChecker.cpp54 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()
183 SVal V = C.getSVal(Msg.getOriginExpr()); in checkPostObjCMessage()
250 SVal argV = CE.getArgSVal(i); in checkPreCall()
[all …]
H A DTestAfterDivZeroChecker.cpp79 void reportBug(SVal Val, CheckerContext &C) const;
85 void setDivZeroMap(SVal Var, CheckerContext &C) const;
86 bool hasDivZeroMap(SVal Var, const CheckerContext &C) const;
87 bool isZero(SVal S, CheckerContext &C) const;
113 SVal S = Succ->getSVal(E); in REGISTER_SET_WITH_PROGRAMSTATE()
132 bool TestAfterDivZeroChecker::isZero(SVal S, CheckerContext &C) const { in isZero()
142 void TestAfterDivZeroChecker::setDivZeroMap(SVal Var, CheckerContext &C) const { in setDivZeroMap()
153 bool TestAfterDivZeroChecker::hasDivZeroMap(SVal Var, in hasDivZeroMap()
163 void TestAfterDivZeroChecker::reportBug(SVal Val, CheckerContext &C) const { in reportBug()
198 SVal S = C.getSVal(B->getRHS()); in checkPreStmt()
[all …]
H A DInvalidatedIteratorChecker.cpp37 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()
/freebsd/contrib/llvm-project/clang/lib/StaticAnalyzer/Core/
H A DSimpleSValBuilder.cpp32 static const llvm::APSInt *getConstValue(ProgramStateRef state, SVal V);
36 static const llvm::APSInt *getConcreteValue(SVal V);
58 SVal simplifyUntilFixpoint(ProgramStateRef State, SVal Val);
64 SVal simplifySValOnce(ProgramStateRef State, SVal V);
72 SVal evalBinOpNN(ProgramStateRef state, BinaryOperator::Opcode op,
74 SVal evalBinOpLL(ProgramStateRef state, BinaryOperator::Opcode op,
76 SVal evalBinOpLN(ProgramStateRef state, BinaryOperator::Opcode op,
82 const llvm::APSInt *getKnownValue(ProgramStateRef state, SVal V) override;
87 const llvm::APSInt *getMinValue(ProgramStateRef state, SVal V) override;
92 const llvm::APSInt *getMaxValue(ProgramStateRef state, SVal V) override;
[all …]
H A DRegionStore.cpp155 typedef llvm::ImmutableMap<BindingKey, SVal> ClusterBindings;
156 typedef llvm::ImmutableMapRef<BindingKey, SVal> ClusterBindingsRef;
157 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;
248 std::pair<const MemRegion *, ImmutableMap<BindingKey, SVal>>; in printJson()
[all …]
H A DExprEngineC.cpp29 static SVal conjureOffsetSymbolOnLocation(SVal Symbol, SVal Other, in conjureOffsetSymbolOnLocation()
59 SVal LeftV = state->getSVal(LHS, LCtx); in VisitBinaryOperator()
60 SVal RightV = state->getSVal(RHS, LCtx); in VisitBinaryOperator()
74 SVal ExprVal = B->isGLValue() ? LeftV : RightV; in VisitBinaryOperator()
103 SVal Result = evalBinOp(state, Op, LeftV, RightV, B->getType()); in VisitBinaryOperator()
136 SVal location = LeftV; in VisitBinaryOperator()
142 SVal V = state->getSVal(LHS, LCtx); in VisitBinaryOperator()
159 SVal Result = svalBuilder.evalCast(evalBinOp(state, Op, V, RightV, CTy), in VisitBinaryOperator()
165 SVal LHSVal; in VisitBinaryOperator()
204 SVal V = svalBuilder.getBlockPointer(BD, T, in VisitBlockExpr()
[all …]
H A DProgramState.cpp114 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;
155 SmallVector<SVal, 8> Values; in invalidateRegions()
211 SVal ProgramState::desugarReference(SVal Val) const { in desugarReference()
222 SVal ProgramState::wrapSymbolicRegion(SVal Val) const { in wrapSymbolicRegion()
239 SVal ProgramState::getSelfSVal(const LocationContext *LCtx) const { in getSelfSVal()
242 return SVal(); in getSelfSVal()
246 SVal ProgramState::getSValAsScalarOrLoc(const MemRegion *R) const { in getSValAsScalarOrLoc()
[all …]
H A DStore.cpp234 static bool regionMatchesCXXRecordType(SVal V, QualType Ty) { in regionMatchesCXXRecordType()
254 SVal StoreManager::evalDerivedToBase(SVal Derived, const CastExpr *Cast) { in evalDerivedToBase()
261 SVal Result = Derived; in evalDerivedToBase()
268 SVal StoreManager::evalDerivedToBase(SVal Derived, const CXXBasePath &Path) { in evalDerivedToBase()
270 SVal Result = Derived; in evalDerivedToBase()
277 SVal StoreManager::evalDerivedToBase(SVal Derived, QualType BaseType, in evalDerivedToBase()
318 std::optional<SVal> StoreManager::evalBaseToDerived(SVal Base, in evalBaseToDerived()
400 SVal StoreManager::getLValueFieldOrIvar(const Decl *D, SVal Base) { in getLValueFieldOrIvar()
441 SVal StoreManager::getLValueIvar(const ObjCIvarDecl *decl, SVal base) { in getLValueIvar()
445 SVal StoreManager::getLValueElement(QualType elementType, NonLoc Offset, in getLValueElement()
[all …]
H A DSValBuilder.cpp117 SVal SValBuilder::convertToArrayIndex(SVal val) { in convertToArrayIndex()
328 std::optional<SVal> SValBuilder::getConstantVal(const Expr *E) { in getConstantVal()
401 std::optional<SVal> Val = getConstantVal(SE); in getConstantVal()
430 SVal SValBuilder::makeSymExprValNN(BinaryOperator::Opcode Op, in makeSymExprValNN()
457 SVal SValBuilder::evalMinus(NonLoc X) { in evalMinus()
469 SVal SValBuilder::evalComplement(NonLoc X) { in evalComplement()
481 SVal SValBuilder::evalUnaryOp(ProgramStateRef state, UnaryOperator::Opcode opc, in evalUnaryOp()
482 SVal operand, QualType type) { in evalUnaryOp()
494 SVal SValBuilder::evalBinOp(ProgramStateRef state, BinaryOperator::Opcode op, in evalBinOp()
495 SVal lhs, SVal rhs, QualType type) { in evalBinOp()
[all …]
H A DSVals.cpp45 const FunctionDecl *SVal::getAsFunctionDecl() const { in getAsFunctionDecl()
67 SymbolRef SVal::getAsLocSymbol(bool IncludeBaseRegions) const { in getAsLocSymbol()
79 SymbolRef SVal::getLocSymbolInBase() const { in getLocSymbolInBase()
103 SymbolRef SVal::getAsSymbol(bool IncludeBaseRegions) const { in getAsSymbol()
111 const llvm::APSInt *SVal::getAsInteger() const { in getAsInteger()
119 const MemRegion *SVal::getAsRegion() const { in getAsRegion()
180 QualType SVal::getType(const ASTContext &Context) const { in getType()
245 bool SVal::isConstant() const { in isConstant()
249 bool SVal::isConstant(int I) const { in isConstant()
257 bool SVal::isZeroConstant() const { in isZeroConstant()
[all …]
H A DBasicValueFactory.cpp33 llvm::ImmutableList<SVal> L) { in Profile()
52 using SValData = std::pair<SVal, uintptr_t>;
53 using SValPair = std::pair<SVal, SVal>;
126 llvm::ImmutableList<SVal> Vals) { in getCompoundValData()
332 const std::pair<SVal, uintptr_t>&
333 BasicValueFactory::getPersistentSValWithData(const SVal& V, uintptr_t Data) { in getPersistentSValWithData()
356 const std::pair<SVal, SVal>&
357 BasicValueFactory::getPersistentSValPair(const SVal& V1, const SVal& V2) { in getPersistentSValPair()
380 const SVal* BasicValueFactory::getPersistentSVal(SVal X) { in getPersistentSVal()
H A DExprEngineCXX.cpp49 SVal ThisVal; in performTrivialCopy()
76 SVal V = Call.getArgSVal(0); in performTrivialCopy()
110 SVal ExprEngine::makeElementRegion(ProgramStateRef State, SVal LValue, in makeElementRegion()
131 SVal ExprEngine::computeObjectUnderConstruction( in computeObjectUnderConstruction()
158 SVal ThisVal = State->getSVal(ThisPtr); in computeObjectUnderConstruction()
172 SVal FieldVal; in computeObjectUnderConstruction()
189 SVal V = *getObjectUnderConstruction(State, NE, LCtx); in computeObjectUnderConstruction()
275 SVal V = computeObjectUnderConstruction( in computeObjectUnderConstruction()
326 SVal Base = loc::MemRegionVal( in computeObjectUnderConstruction()
347 auto getArgLoc = [&](CallEventRef<> Caller) -> std::optional<SVal> { in computeObjectUnderConstruction()
[all …]
H A DCallEvent.cpp241 SmallVector<SVal, 8> ValuesToInvalidate; in invalidateRegions()
307 SVal CallEvent::getArgSVal(unsigned Index) const { in getArgSVal()
321 SVal CallEvent::getReturnValue() const { in getReturnValue()
399 static SVal processArgument(SVal Value, const Expr *ArgumentExpr, in processArgument()
418 llvm::ImmutableList<SVal> CompoundSVals = BVF.getEmptySValList(); in processArgument()
434 static SVal castArgToParamTypeIfNeeded(const CallEvent &Call, unsigned ArgIdx, in castArgToParamTypeIfNeeded()
435 SVal ArgVal, SValBuilder &SVB) { in castArgToParamTypeIfNeeded()
483 SVal ArgVal = Call.getArgSVal(Idx); in addParameterValuesToBindings()
539 std::optional<SVal> CallEvent::getReturnValueUnderConstruction() const { in getReturnValueUnderConstruction()
546 SVal RetVal = Engine.computeObjectUnderConstruction( in getReturnValueUnderConstruction()
[all …]

123456