diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-01-21 22:26:05 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-01-21 22:26:05 +0000 |
commit | 241677a13cc46647a8f5098b3e3239bd9480dca2 (patch) | |
tree | 13849c05ba12762305e40038907d2672d1d9a65d /lib/Analysis/SymbolManager.cpp | |
parent | ee0af74d1e0990c7b66d32657f3e4e54b8691552 (diff) |
Static Analyzer: Replace LiveSymbols/DeadSymbols sets with a new object called "SymbolReaper". Right now it just consolidates the two and cleans up some client code, but shortly it will be used to enable "lazy computation" of live symbols for use with RegionStore.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62722 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/SymbolManager.cpp')
-rw-r--r-- | lib/Analysis/SymbolManager.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/Analysis/SymbolManager.cpp b/lib/Analysis/SymbolManager.cpp index f8f8555949..d0099e15fa 100644 --- a/lib/Analysis/SymbolManager.cpp +++ b/lib/Analysis/SymbolManager.cpp @@ -158,3 +158,21 @@ QualType SymbolData::getType(const SymbolManager& SymMgr) const { } SymbolManager::~SymbolManager() {} + +void SymbolReaper::markLive(SymbolRef sym) { + TheLiving = F.Add(TheLiving, sym); + TheDead = F.Remove(TheDead, sym); +} + +bool SymbolReaper::maybeDead(SymbolRef sym) { + if (isLive(sym)) + return false; + + TheDead = F.Add(TheDead, sym); + return true; +} + +bool SymbolReaper::isLive(SymbolRef sym) { + return TheLiving.contains(sym); +} + |