summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/SymbolManager.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-01-21 22:26:05 +0000
committerTed Kremenek <kremenek@apple.com>2009-01-21 22:26:05 +0000
commit16fbfe699ebc0fe96b7768632a46a4ff64646e07 (patch)
tree83a2505e17423737ce91fd9eeeb306c98180f276 /clang/lib/Analysis/SymbolManager.cpp
parent279eda627554755119d3a5efa79c7d97f6dbdfb6 (diff)
downloadbcm5719-llvm-16fbfe699ebc0fe96b7768632a46a4ff64646e07.tar.gz
bcm5719-llvm-16fbfe699ebc0fe96b7768632a46a4ff64646e07.zip
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.
llvm-svn: 62722
Diffstat (limited to 'clang/lib/Analysis/SymbolManager.cpp')
-rw-r--r--clang/lib/Analysis/SymbolManager.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/lib/Analysis/SymbolManager.cpp b/clang/lib/Analysis/SymbolManager.cpp
index f8f85559492..d0099e15fa8 100644
--- a/clang/lib/Analysis/SymbolManager.cpp
+++ b/clang/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);
+}
+
OpenPOWER on IntegriCloud