]> granicus.if.org Git - clang/commitdiff
Replace SymbolReaper::isLive(VarDecl) with SymbolReaper::isLive(VarRegion).
authorTed Kremenek <kremenek@apple.com>
Fri, 4 Dec 2009 20:32:20 +0000 (20:32 +0000)
committerTed Kremenek <kremenek@apple.com>
Fri, 4 Dec 2009 20:32:20 +0000 (20:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90582 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Analysis/PathSensitive/SymbolManager.h
lib/Analysis/BasicStore.cpp
lib/Analysis/RegionStore.cpp
lib/Analysis/SymbolManager.cpp

index 167a102e94ec924c4950bdb56dcae901cbe94cbb..8dbbaace4f49444dc9d7c045bff202fb8e51bdfb 100644 (file)
@@ -28,10 +28,11 @@ namespace llvm {
 }
 
 namespace clang {
-  class MemRegion;
-  class TypedRegion;
   class ASTContext;
   class BasicValueFactory;
+  class MemRegion;
+  class TypedRegion;
+  class VarRegion;
 }
 
 namespace clang {
@@ -345,10 +346,8 @@ public:
     return Liveness.isLive(Loc, ExprVal);
   }
 
-  bool isLive(const Stmt* Loc, const VarDecl* VD) const {
-    return Liveness.isLive(Loc, VD);
-  }
-
+  bool isLive(const Stmt* Loc, const VarRegion *VR) const;
+  
   void markLive(SymbolRef sym);
   bool maybeDead(SymbolRef sym);
 
index 45fc11a534a5bd68247ae6ecb75a71d92efa70c5..c2bf7a8d712620672d41ec8b484412f187f169ab 100644 (file)
@@ -368,7 +368,7 @@ BasicStoreManager::RemoveDeadBindings(GRState &state, Stmt* Loc,
   // Iterate over the variable bindings.
   for (BindingsTy::iterator I=B.begin(), E=B.end(); I!=E ; ++I) {
     if (const VarRegion *VR = dyn_cast<VarRegion>(I.getKey())) {
-      if (SymReaper.isLive(Loc, VR->getDecl()))
+      if (SymReaper.isLive(Loc, VR))
         RegionRoots.push_back(VR);
       else
         continue;
index 13462f4785a424131a761b7797ebc14664e298e8..4a84eea42f5476d4362e7be1f178d84584440064 100644 (file)
@@ -1697,7 +1697,7 @@ void RegionStoreManager::RemoveDeadBindings(GRState &state, Stmt* Loc,
     IntermediateVisited.insert(R);
     
     if (const VarRegion* VR = dyn_cast<VarRegion>(R)) {
-      if (SymReaper.isLive(Loc, VR->getDecl()))
+      if (SymReaper.isLive(Loc, VR))
         WorkList.push_back(std::make_pair(&state, VR));
       continue;
     }
index 22e11019295622345833e32020db2a5c4e578e0d..da91f55bc089f912b8c9949084f21463acd59df4 100644 (file)
@@ -220,4 +220,8 @@ bool SymbolReaper::isLive(SymbolRef sym) {
   return isa<SymbolRegionValue>(sym);
 }
 
+bool SymbolReaper::isLive(const Stmt *Loc, const VarRegion *VR) const {
+  return Liveness.isLive(Loc, VR->getDecl());
+}
+
 SymbolVisitor::~SymbolVisitor() {}