clang API Documentation
A FactSet is the set of facts that are known to be true at a particular program point. FactSets must be small, because they are frequently copied, and are thus implemented as a set of indices into a table maintained by a FactManager. A typical FactSet only holds 1 or 2 locks, so we can get away with doing a linear search for lookup. Note that a hashtable or map is inappropriate in this case, because lookups may involve partial pattern matches, rather than exact matches. More...
Public Types | |
| typedef FactVec::iterator | iterator |
| typedef FactVec::const_iterator | const_iterator |
Public Member Functions | |
| iterator | begin () |
| const_iterator | begin () const |
| iterator | end () |
| const_iterator | end () const |
| bool | isEmpty () const |
| bool | isEmpty (FactManager &FactMan) const |
| void | addLockByID (FactID ID) |
| FactID | addLock (FactManager &FM, std::unique_ptr< FactEntry > Entry) |
| bool | removeLock (FactManager &FM, const CapabilityExpr &CapE) |
| iterator | findLockIter (FactManager &FM, const CapabilityExpr &CapE) |
| FactEntry * | findLock (FactManager &FM, const CapabilityExpr &CapE) const |
| FactEntry * | findLockUniv (FactManager &FM, const CapabilityExpr &CapE) const |
| FactEntry * | findPartialMatch (FactManager &FM, const CapabilityExpr &CapE) const |
A FactSet is the set of facts that are known to be true at a particular program point. FactSets must be small, because they are frequently copied, and are thus implemented as a set of indices into a table maintained by a FactManager. A typical FactSet only holds 1 or 2 locks, so we can get away with doing a linear search for lookup. Note that a hashtable or map is inappropriate in this case, because lookups may involve partial pattern matches, rather than exact matches.
Definition at line 158 of file ThreadSafety.cpp.
| typedef FactVec::const_iterator clang::threadSafety::FactSet::const_iterator |
Definition at line 166 of file ThreadSafety.cpp.
| typedef FactVec::iterator clang::threadSafety::FactSet::iterator |
Definition at line 165 of file ThreadSafety.cpp.
| FactID clang::threadSafety::FactSet::addLock | ( | FactManager & | FM, |
| std::unique_ptr< FactEntry > | Entry | ||
| ) | [inline] |
Definition at line 187 of file ThreadSafety.cpp.
References clang::threadSafety::FactManager::newFact().
Referenced by clang::threadSafety::ThreadSafetyAnalyzer::addLock(), clang::threadSafety::LockableFactEntry::handleUnlock(), clang::threadSafety::ScopedLockableFactEntry::handleUnlock(), and clang::threadSafety::ThreadSafetyAnalyzer::runAnalysis().
| void clang::threadSafety::FactSet::addLockByID | ( | FactID | ID | ) | [inline] |
Definition at line 185 of file ThreadSafety.cpp.
| iterator clang::threadSafety::FactSet::begin | ( | ) | [inline] |
Definition at line 168 of file ThreadSafety.cpp.
Referenced by findLock(), findLockIter(), findLockUniv(), and findPartialMatch().
| const_iterator clang::threadSafety::FactSet::begin | ( | ) | const [inline] |
Definition at line 169 of file ThreadSafety.cpp.
| iterator clang::threadSafety::FactSet::end | ( | ) | [inline] |
Definition at line 171 of file ThreadSafety.cpp.
Referenced by findLock(), findLockIter(), findLockUniv(), findPartialMatch(), and clang::threadSafety::ThreadSafetyAnalyzer::intersectAndWarn().
| const_iterator clang::threadSafety::FactSet::end | ( | ) | const [inline] |
Definition at line 172 of file ThreadSafety.cpp.
| FactEntry* clang::threadSafety::FactSet::findLock | ( | FactManager & | FM, |
| const CapabilityExpr & | CapE | ||
| ) | const [inline] |
Definition at line 218 of file ThreadSafety.cpp.
References begin(), and end().
Referenced by clang::threadSafety::ThreadSafetyAnalyzer::addLock(), clang::threadSafety::ScopedLockableFactEntry::handleRemovalFromIntersection(), clang::threadSafety::ScopedLockableFactEntry::handleUnlock(), and clang::threadSafety::ThreadSafetyAnalyzer::removeLock().
| iterator clang::threadSafety::FactSet::findLockIter | ( | FactManager & | FM, |
| const CapabilityExpr & | CapE | ||
| ) | [inline] |
Definition at line 212 of file ThreadSafety.cpp.
References begin(), and end().
Referenced by clang::threadSafety::ThreadSafetyAnalyzer::intersectAndWarn().
| FactEntry* clang::threadSafety::FactSet::findLockUniv | ( | FactManager & | FM, |
| const CapabilityExpr & | CapE | ||
| ) | const [inline] |
Definition at line 225 of file ThreadSafety.cpp.
| FactEntry* clang::threadSafety::FactSet::findPartialMatch | ( | FactManager & | FM, |
| const CapabilityExpr & | CapE | ||
| ) | const [inline] |
Definition at line 232 of file ThreadSafety.cpp.
| bool clang::threadSafety::FactSet::isEmpty | ( | ) | const [inline] |
Definition at line 174 of file ThreadSafety.cpp.
| bool clang::threadSafety::FactSet::isEmpty | ( | FactManager & | FactMan | ) | const [inline] |
Definition at line 177 of file ThreadSafety.cpp.
| bool clang::threadSafety::FactSet::removeLock | ( | FactManager & | FM, |
| const CapabilityExpr & | CapE | ||
| ) | [inline] |
Definition at line 193 of file ThreadSafety.cpp.
References clang::threadSafety::sx::matches().
Referenced by clang::threadSafety::ThreadSafetyAnalyzer::addLock(), clang::threadSafety::LockableFactEntry::handleUnlock(), clang::threadSafety::ScopedLockableFactEntry::handleUnlock(), clang::threadSafety::ThreadSafetyAnalyzer::intersectAndWarn(), and clang::threadSafety::ThreadSafetyAnalyzer::runAnalysis().