Lines Matching defs:SVal
148 typedef llvm::ImmutableMap<BindingKey, SVal> ClusterBindings;
149 typedef llvm::ImmutableMapRef<BindingKey, SVal> ClusterBindingsRef;
150 typedef std::pair<BindingKey, SVal> BindingPair;
198 RegionBindingsRef addBinding(BindingKey K, SVal V) const;
201 BindingKey::Kind k, SVal V) const;
203 const SVal *lookup(BindingKey K) const;
204 const SVal *lookup(const MemRegion *R, BindingKey::Kind k) const;
217 std::optional<SVal> getDirectBinding(const MemRegion *R) const;
219 /// getDefaultBinding - Returns an SVal* representing an optional default
221 std::optional<SVal> getDefaultBinding(const MemRegion *R) const;
250 std::pair<const MemRegion *, ImmutableMap<BindingKey, SVal>>;
251 using Binding = std::pair<BindingKey, SVal>;
327 std::optional<SVal>
329 const SVal *V = lookup(R, BindingKey::Direct);
330 return V ? std::optional<SVal>(*V) : std::nullopt;
333 std::optional<SVal>
335 const SVal *V = lookup(R, BindingKey::Default);
336 return V ? std::optional<SVal>(*V) : std::nullopt;
339 RegionBindingsRef RegionBindingsRef::addBinding(BindingKey K, SVal V) const {
353 SVal V) const {
357 const SVal *RegionBindingsRef::lookup(BindingKey K) const {
364 const SVal *RegionBindingsRef::lookup(const MemRegion *R,
398 typedef std::vector<SVal> SValListTy;
427 ArrayRef<SVal> Values,
448 /// to a pointer, and the returned SVal represents the decayed
452 SVal ArrayToPointer(Loc Array, QualType ElementTy) override;
474 StoreRef invalidateRegions(Store store, ArrayRef<SVal> Values, const Stmt *S,
486 std::optional<SVal>
489 std::optional<SVal>
493 SVal getSValFromStringLiteral(const StringLiteral *SL, uint64_t Offset,
498 StoreRef Bind(Store store, Loc LV, SVal V) override {
502 RegionBindingsRef bind(RegionBindingsConstRef B, Loc LV, SVal V);
507 SVal V) override {
534 SVal V = svalBuilder.makeZeroVal(Ctx.CharTy);
556 const TypedValueRegion* R, SVal V);
560 const TypedValueRegion* R, SVal V);
568 SVal V);
574 SVal DefaultVal);
607 SVal getBinding(Store S, Loc L, QualType T) override {
611 std::optional<SVal> getUniqueDefaultBinding(RegionBindingsConstRef B,
613 std::optional<SVal>
616 std::optional<SVal> getDefaultBinding(Store S, const MemRegion *R) override {
624 SVal getBinding(RegionBindingsConstRef B, Loc L, QualType T = QualType());
626 SVal getBindingForElement(RegionBindingsConstRef B, const ElementRegion *R);
628 SVal getBindingForField(RegionBindingsConstRef B, const FieldRegion *R);
630 SVal getBindingForObjCIvar(RegionBindingsConstRef B, const ObjCIvarRegion *R);
632 SVal getBindingForVar(RegionBindingsConstRef B, const VarRegion *R);
634 SVal getBindingForLazySymbol(const TypedValueRegion *R);
636 SVal getBindingForFieldOrElementCommon(RegionBindingsConstRef B,
640 SVal getLazyBinding(const SubRegion *LazyBindingRegion,
648 SVal getBindingForStruct(RegionBindingsConstRef B, const TypedValueRegion *R);
649 SVal getBindingForArray(RegionBindingsConstRef B, const TypedValueRegion *R);
657 std::optional<SVal>
675 /// symbols, but may omit constants and other kinds of SVal.
906 /// \c second is the value (an SVal).
925 SVal Extent = Top->getMemRegionManager().getStaticSize(Top, SVB);
1058 void VisitBinding(SVal V);
1081 void InvalidateRegionsWorker::VisitBinding(SVal V) {
1097 for (SVal V : RM.getInterestingValues(*LCS))
1113 for (SVal Val : llvm::make_second_range(*C))
1162 SVal V = RM.getBinding(B, loc::MemRegionVal(VR));
1319 SVal V =
1335 ArrayRef<SVal> Values,
1337 for (SVal V : Values) {
1339 for (SVal S : getInterestingValues(*LCS))
1356 Store store, ArrayRef<SVal> Values, const Stmt *S, unsigned Count,
1411 /// to a pointer, and the returned SVal represents the decayed
1415 SVal RegionStoreManager::ArrayToPointer(Loc Array, QualType T) {
1432 SVal RegionStoreManager::getBinding(RegionBindingsConstRef B, Loc L, QualType T) {
1538 const SVal *V = B.lookup(R, BindingKey::Direct);
1580 std::optional<SVal> V = B.getDefaultBinding(R);
1684 static std::pair<SmallVector<SVal, 2>, const MemRegion *>
1688 SmallVector<SVal, 2> SValOffsets;
1699 /// Convert array of offsets from `SVal` to `uint64_t` in consideration of
1701 /// \param SrcOffsets [in] The array of offsets of type `SVal` in reversed
1707 /// - `UndefinedVal` or `UnknownVal` otherwise. It's expected that this SVal
1718 static std::optional<SVal>
1719 convertOffsetsFromSvalToUnsigneds(const SmallVector<SVal, 2> &SrcOffsets,
1743 for (SVal V : llvm::reverse(SrcOffsets)) {
1761 std::optional<SVal> RegionStoreManager::getConstantValFromConstArrayInitializer(
1766 SmallVector<SVal, 2> SValOffsets;
1818 if (std::optional<SVal> V = convertOffsetsFromSvalToUnsigneds(
1840 /// Returns an SVal, if possible, for the specified position of an
1846 /// \param ElemT The type of the result SVal expression.
1847 /// \return Optional SVal for the particular position in the initialization
1849 /// - {1, 1} returns SVal{4}, because it's the second position in the second
1851 /// - {3, 0} returns SVal{0}, because there's no explicit value at this
1854 /// NOTE: Inorder to get a valid SVal, a caller shall guarantee valid offsets
1855 /// for the given initialization list. Otherwise SVal can be an equivalent to 0
1857 std::optional<SVal> RegionStoreManager::getSValFromInitListExpr(
1896 /// Returns an SVal, if possible, for the specified position in a string
1903 /// - 1 returns SVal{b}, because it's the second position in the string.
1904 /// - 42 returns SVal{0}, because there's no explicit value at this
1906 /// \param ElemT The type of the result SVal expression.
1921 SVal RegionStoreManager::getSValFromStringLiteral(const StringLiteral *SL,
1932 static std::optional<SVal> getDerivedSymbolForBinding(
1940 if (const std::optional<SVal> &ParentValue =
1957 SVal RegionStoreManager::getBindingForElement(RegionBindingsConstRef B,
1960 if (const std::optional<SVal> &V = B.getDirectBinding(R))
1981 if (std::optional<SVal> V = getConstantValFromConstArrayInitializer(B, R))
2008 SVal RegionStoreManager::getBindingForField(RegionBindingsConstRef B,
2012 if (const std::optional<SVal> &V = B.getDirectBinding(R))
2032 if (std::optional<SVal> V = svalBuilder.getConstantVal(FieldInit))
2063 std::optional<SVal> RegionStoreManager::getBindingForDerivedDefaultValue(
2067 if (const std::optional<SVal> &D = B.getDefaultBinding(superR)) {
2068 SVal val = *D;
2089 SVal RegionStoreManager::getLazyBinding(const SubRegion *LazyBindingRegion,
2091 SVal Result;
2118 SVal
2157 if (std::optional<SVal> D =
2200 if (const std::optional<SVal> &V = B.getDefaultBinding(R))
2210 SVal RegionStoreManager::getBindingForObjCIvar(RegionBindingsConstRef B,
2213 if (const std::optional<SVal> &V = B.getDirectBinding(R))
2219 if (const std::optional<SVal> &V = B.getDefaultBinding(superR)) {
2230 SVal RegionStoreManager::getBindingForVar(RegionBindingsConstRef B,
2234 if (std::optional<SVal> V = B.getDirectBinding(R))
2237 if (std::optional<SVal> V = B.getDefaultBinding(R))
2251 if (std::optional<SVal> V = svalBuilder.getConstantVal(Init))
2272 if (std::optional<SVal> V = svalBuilder.getConstantVal(Init))
2282 if (std::optional<SVal> V = getBindingForDerivedDefaultValue(B, MS, R, T)) {
2293 SVal RegionStoreManager::getBindingForLazySymbol(const TypedValueRegion *R) {
2320 for (SVal V : llvm::make_second_range(Bindings)) {
2344 SVal RegionStoreManager::getBindingForStruct(RegionBindingsConstRef B,
2357 if (std::optional<SVal> Val = getUniqueDefaultBinding(B, R))
2362 SVal RegionStoreManager::getBindingForArray(RegionBindingsConstRef B,
2384 SVal D = CI.getData();
2410 RegionStoreManager::bind(RegionBindingsConstRef B, Loc L, SVal V) {
2456 SVal V;
2504 SVal V = getBindingForElement(getRegionBindings(LCV.getStore()), SrcER);
2516 SVal Init) {
2529 SVal V = getBinding(B.asStore(), *MRV, R->getValueType());
2580 SVal V) {
2618 std::optional<SVal>
2629 return Key.isDirect() ? std::optional<SVal>{} : Value;
2632 std::optional<SVal>
2655 if (std::optional<SVal> Val = getUniqueDefaultBinding(LCV)) {
2691 SVal V = getBindingForField(getRegionBindings(LCV.getStore()), SourceFR);
2702 SVal V) {
2820 SVal Val) {
2855 void VisitBinding(SVal V);
2917 void RemoveDeadBindingsWorker::VisitBinding(SVal V) {
2923 for (SVal V : RM.getInterestingValues(*LCS)) {