Lines Matching refs:RefVal
75 class RefVal { class
136 RefVal(Kind k, RetEffect::ObjKind o, unsigned cnt, unsigned acnt, QualType t, in RefVal() function in __anonbe000e510111::RefVal
198 static RefVal makeOwned(RetEffect::ObjKind o, QualType t, in makeOwned()
200 return RefVal(Owned, o, Count, 0, t, IvarAccessHistory::None); in makeOwned()
207 static RefVal makeNotOwned(RetEffect::ObjKind o, QualType t, in makeNotOwned()
209 return RefVal(NotOwned, o, Count, 0, t, IvarAccessHistory::None); in makeNotOwned()
212 RefVal operator-(size_t i) const { in operator -()
213 return RefVal(getKind(), getObjKind(), getCount() - i, in operator -()
217 RefVal operator+(size_t i) const { in operator +()
218 return RefVal(getKind(), getObjKind(), getCount() + i, in operator +()
222 RefVal operator^(Kind k) const { in operator ^()
223 return RefVal(k, getObjKind(), getCount(), getAutoreleaseCount(), in operator ^()
227 RefVal autorelease() const { in autorelease()
228 return RefVal(getKind(), getObjKind(), getCount(), getAutoreleaseCount()+1, in autorelease()
232 RefVal withIvarAccess() const { in withIvarAccess()
234 return RefVal(getKind(), getObjKind(), getCount(), getAutoreleaseCount(), in withIvarAccess()
237 RefVal releaseViaIvar() const { in releaseViaIvar()
239 return RefVal(getKind(), getObjKind(), getCount(), getAutoreleaseCount(), in releaseViaIvar()
245 bool hasSameState(const RefVal &X) const { in hasSameState()
250 bool operator==(const RefVal& X) const { in operator ==()
266 void RefVal::print(raw_ostream &Out) const { in print()
332 case RefVal::ErrorOverAutorelease: in print()
336 case RefVal::ErrorReturnedNotOwned: in print()
361 REGISTER_MAP_WITH_PROGRAMSTATE(RefBindings, SymbolRef, RefVal) in REGISTER_MAP_WITH_PROGRAMSTATE()
363 static inline const RefVal *getRefBinding(ProgramStateRef State, in REGISTER_MAP_WITH_PROGRAMSTATE()
369 SymbolRef Sym, RefVal Val) { in setRefBinding()
1485 if (const RefVal *T = getRefBinding(State, Sym)) in getInstanceMethodSummary()
1880 const RefVal* CurrT = getRefBinding(CurrSt, Sym); in VisitNode()
1883 const RefVal &CurrV = *CurrT; in VisitNode()
1884 const RefVal *PrevT = getRefBinding(PrevSt, Sym); in VisitNode()
2023 RefVal PrevV = *PrevT; in VisitNode()
2032 if (CurrV.getKind() == RefVal::Released) { in VisitNode()
2056 if (CurrV.getKind() == RefVal::Released) { in VisitNode()
2077 case RefVal::Owned: in VisitNode()
2078 case RefVal::NotOwned: in VisitNode()
2097 if (PrevV.getKind() == RefVal::Released) { in VisitNode()
2105 case RefVal::Released: in VisitNode()
2107 RefVal::IvarAccessHistory::ReleasedAfterDirectAccess && in VisitNode()
2114 case RefVal::ReturnedOwned: in VisitNode()
2123 case RefVal::ReturnedNotOwned: in VisitNode()
2318 const RefVal* RV = getRefBinding(EndN->getState(), Sym); in getEndPath()
2321 if (RV->getKind() == RefVal::ErrorLeakReturned) { in getEndPath()
2350 else if (RV->getKind() == RefVal::ErrorGCLeakReturned) { in getEndPath()
2624 ExplodedNode *Pred, RetEffect RE, RefVal X,
2631 RefVal V, ArgEffect E, RefVal::Kind &hasErr,
2635 RefVal::Kind ErrorKind, SymbolRef Sym,
2643 SymbolRef sid, RefVal V,
2649 SymbolRef Sym, RefVal V) const;
2740 const RefVal* T = getRefBinding(state, Sym); in checkPostStmt()
2744 RefVal::Kind hasErr = (RefVal::Kind) 0; in checkPostStmt()
2765 if (const RefVal* T = getRefBinding(state, sym)) { in processObjCLiterals()
2766 RefVal::Kind hasErr = (RefVal::Kind) 0; in processObjCLiterals()
2781 RefVal::makeNotOwned(RetEffect::ObjC, ResultTy)); in processObjCLiterals()
2808 RefVal::makeNotOwned(RetEffect::ObjC, ResultTy)); in checkPostStmt()
2850 if (const RefVal *RV = getRefBinding(State, Sym)) { in checkPostStmt()
2853 if (RV->getIvarAccessHistory() != RefVal::IvarAccessHistory::None || in checkPostStmt()
2863 RefVal PlusZero = RefVal::makeNotOwned(Kind, Ty); in checkPostStmt()
2960 RefVal::Kind hasErr = (RefVal::Kind) 0; in checkSummary()
2968 if (const RefVal *T = getRefBinding(state, Sym)) { in checkSummary()
2985 if (const RefVal *T = getRefBinding(state, Sym)) { in checkSummary()
3032 state = setRefBinding(state, Sym, RefVal::makeOwned(RE.getObjKind(), in checkSummary()
3049 state = setRefBinding(state, Sym, RefVal::makeNotOwned(RE.getObjKind(), in checkSummary()
3079 RefVal V, ArgEffect E, RefVal::Kind &hasErr, in updateSymbol()
3105 if (!C.isObjCGCEnabled() && V.getKind() == RefVal::Released) { in updateSymbol()
3106 V = V ^ RefVal::ErrorUseAfterRelease; in updateSymbol()
3121 V = V ^ RefVal::ErrorDeallocGC; in updateSymbol()
3129 case RefVal::Owned: in updateSymbol()
3131 V = V ^ RefVal::Released; in updateSymbol()
3134 case RefVal::NotOwned: in updateSymbol()
3135 V = V ^ RefVal::ErrorDeallocNotOwned; in updateSymbol()
3142 if (V.getKind() == RefVal::Owned) { in updateSymbol()
3143 V = V ^ RefVal::NotOwned; in updateSymbol()
3167 case RefVal::Owned: in updateSymbol()
3168 case RefVal::NotOwned: in updateSymbol()
3171 case RefVal::Released: in updateSymbol()
3174 V = (V ^ RefVal::Owned) + 1; in updateSymbol()
3187 case RefVal::Owned: in updateSymbol()
3192 RefVal::IvarAccessHistory::AccessedDirectly) in updateSymbol()
3193 V = V ^ RefVal::NotOwned; in updateSymbol()
3195 V = V ^ RefVal::Released; in updateSymbol()
3203 case RefVal::NotOwned: in updateSymbol()
3209 RefVal::IvarAccessHistory::AccessedDirectly) { in updateSymbol()
3214 V = V.releaseViaIvar() ^ RefVal::Released; in updateSymbol()
3216 V = V ^ RefVal::ErrorReleaseNotOwned; in updateSymbol()
3221 case RefVal::Released: in updateSymbol()
3224 V = V ^ RefVal::ErrorUseAfterRelease; in updateSymbol()
3235 RefVal::Kind ErrorKind, in processNonLeakError()
3244 if (const RefVal *RV = getRefBinding(St, Sym)) in processNonLeakError()
3245 if (RV->getIvarAccessHistory() != RefVal::IvarAccessHistory::None) in processNonLeakError()
3256 case RefVal::ErrorUseAfterRelease: in processNonLeakError()
3261 case RefVal::ErrorReleaseNotOwned: in processNonLeakError()
3266 case RefVal::ErrorDeallocGC: in processNonLeakError()
3271 case RefVal::ErrorDeallocNotOwned: in processNonLeakError()
3349 const RefVal *Binding = nullptr; in evalCall()
3392 const RefVal *T = getRefBinding(state, Sym); in checkPreStmt()
3397 RefVal X = *T; in checkPreStmt()
3400 case RefVal::Owned: { in checkPreStmt()
3404 X = X ^ RefVal::ReturnedOwned; in checkPreStmt()
3408 case RefVal::NotOwned: { in checkPreStmt()
3412 X = X ^ RefVal::ReturnedOwned; in checkPreStmt()
3415 X = X ^ RefVal::ReturnedNotOwned; in checkPreStmt()
3471 RetEffect RE, RefVal X, in checkReturnWithRetEffect()
3480 if (X.getIvarAccessHistory() != RefVal::IvarAccessHistory::None) in checkReturnWithRetEffect()
3493 X = X ^ RefVal::ErrorGCLeakReturned; in checkReturnWithRetEffect()
3500 X = X ^ RefVal::ErrorLeakReturned; in checkReturnWithRetEffect()
3524 RefVal::IvarAccessHistory::AccessedDirectly) { in checkReturnWithRetEffect()
3528 X.releaseViaIvar() ^ RefVal::ReturnedOwned); in checkReturnWithRetEffect()
3532 state = setRefBinding(state, Sym, X ^ RefVal::ErrorReturnedNotOwned); in checkReturnWithRetEffect()
3683 SymbolRef Sym, RefVal V) const { in handleAutoreleaseCounts()
3695 if (V.getKind() == RefVal::ReturnedOwned) in handleAutoreleaseCounts()
3701 V.getIvarAccessHistory() == RefVal::IvarAccessHistory::AccessedDirectly) { in handleAutoreleaseCounts()
3709 if (V.getKind() == RefVal::ReturnedOwned) in handleAutoreleaseCounts()
3710 V = V ^ RefVal::ReturnedNotOwned; in handleAutoreleaseCounts()
3712 V = V ^ RefVal::NotOwned; in handleAutoreleaseCounts()
3726 if (V.getIvarAccessHistory() != RefVal::IvarAccessHistory::None) in handleAutoreleaseCounts()
3731 V = V ^ RefVal::ErrorOverAutorelease; in handleAutoreleaseCounts()
3760 SymbolRef sid, RefVal V, in handleSymbolDeath()
3770 if (V.getIvarAccessHistory() != RefVal::IvarAccessHistory::None) in handleSymbolDeath()
3783 return setRefBinding(state, sid, V ^ RefVal::ErrorLeak); in handleSymbolDeath()
3874 if (const RefVal *T = B.lookup(Sym)){ in checkDeadSymbols()