]> granicus.if.org Git - clang/commitdiff
Consolidated use of BumpPtrAllocator shared by various ImmutableSet/ImmutableMap
authorTed Kremenek <kremenek@apple.com>
Mon, 11 Feb 2008 23:12:59 +0000 (23:12 +0000)
committerTed Kremenek <kremenek@apple.com>
Mon, 11 Feb 2008 23:12:59 +0000 (23:12 +0000)
factories.

Fixed a horrible bug in lval:DeclVar::classof(RValue* V); we weren't checking
V was an LValue, allowing nonlval::ConcereteInts to match isa<lval::DeclVar>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46976 91177308-0d34-0410-b5e6-96231b3b80d8

Analysis/RValues.h
Analysis/ValueState.cpp
Analysis/ValueState.h

index 92f847b8dd13a8f569ecb833ca1428031c2d1fe1..9aa2f11e1996e8e7ac5add7ffc4dd6abb7d5e5a4 100644 (file)
@@ -459,7 +459,7 @@ namespace lval {
     }
     
     static inline bool classof(const RValue* V) {
-      return V->getSubKind() == SymbolValKind;
+      return isa<LValue>(V) && V->getSubKind() == SymbolValKind;
     }  
   };
   
@@ -481,7 +481,7 @@ namespace lval {
     
     // Implement isa<T> support.
     static inline bool classof(const RValue* V) {
-      return V->getSubKind() == DeclValKind;
+      return isa<LValue>(V) && V->getSubKind() == DeclValKind;
     }
   };
 
index 724f64f04f9eb7312ee075dc2f8c4443074c84bf..f51175fdcac59477c4909faac3676205bdad4fe3 100644 (file)
@@ -71,7 +71,7 @@ ValueStateManager::RemoveDeadBindings(ValueState St, Stmt* Loc,
     if (Liveness.isLive(Loc, I.getKey()))
       WList.push_back(I.getKey());
   
-  llvm::SmallPtrSet<ValueDecl*, 10> Marked;
+  llvm::SmallPtrSet<ValueDecl*, 10> Marked;  
   
   while (!WList.empty()) {
     ValueDecl* V = WList.back();
@@ -254,7 +254,6 @@ LValue ValueStateManager::GetLValue(ValueState St, Expr* E) {
   return cast<LValue>(GetValue(St, E));
 }
 
-
 ValueState 
 ValueStateManager::SetValue(ValueState St, Expr* E, bool isBlkExpr,
                             const RValue& V) {
index 5f2b58c18c70565516cececb03d5b272857f2a29..8ea699452a639c61e3f30f2226078900d6aa215d 100644 (file)
@@ -231,7 +231,12 @@ private:
   
 public:  
   ValueStateManager(ASTContext& Ctx, llvm::BumpPtrAllocator& alloc) 
-    : ValMgr(Ctx, alloc), Alloc(alloc) {}
+    : ISetFactory(alloc), 
+      EXFactory(alloc),
+      VBFactory(alloc),
+      CNEFactory(alloc),
+      CEFactory(alloc),
+      ValMgr(Ctx, alloc), Alloc(alloc) {}
   
   ValueState getInitialState();