Renamed ValueManager to BasicValueFactory.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48025 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Analysis/ValueManager.cpp b/Analysis/BasicValueFactory.cpp
similarity index 84%
rename from Analysis/ValueManager.cpp
rename to Analysis/BasicValueFactory.cpp
index 34b55de..88b360d 100644
--- a/Analysis/ValueManager.cpp
+++ b/Analysis/BasicValueFactory.cpp
@@ -1,4 +1,4 @@
-// ValueManager.h - Low-level value management for Value Tracking -*- C++ -*--==
+//=== BasicValueFactory.cpp - Basic values for Path Sens analysis --*- C++ -*-//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -7,16 +7,17 @@
 //
 //===----------------------------------------------------------------------===//
 //
-//  This file defines ValueManager, a class that manages the lifetime of APSInt
-//  objects and symbolic constraints used by GRExprEngine and related classes.
+//  This file defines BasicValueFactory, a class that manages the lifetime
+//  of APSInt objects and symbolic constraints used by GRExprEngine 
+//  and related classes.
 //
 //===----------------------------------------------------------------------===//
 
-#include "clang/Analysis/PathSensitive/ValueManager.h"
+#include "clang/Analysis/PathSensitive/BasicValueFactory.h"
 
 using namespace clang;
 
-ValueManager::~ValueManager() {
+BasicValueFactory::~BasicValueFactory() {
   // Note that the dstor for the contents of APSIntSet will never be called,
   // so we iterate over the set and invoke the dstor for each APSInt.  This
   // frees an aux. memory allocated to represent very large constants.
@@ -24,7 +25,7 @@
     I->getValue().~APSInt();
 }
 
-const llvm::APSInt& ValueManager::getValue(const llvm::APSInt& X) {
+const llvm::APSInt& BasicValueFactory::getValue(const llvm::APSInt& X) {
   llvm::FoldingSetNodeID ID;
   void* InsertPos;
   typedef llvm::FoldingSetNodeWrapper<llvm::APSInt> FoldNodeTy;
@@ -41,14 +42,14 @@
   return *P;
 }
 
-const llvm::APSInt& ValueManager::getValue(uint64_t X, unsigned BitWidth,
+const llvm::APSInt& BasicValueFactory::getValue(uint64_t X, unsigned BitWidth,
                                            bool isUnsigned) {
   llvm::APSInt V(BitWidth, isUnsigned);
   V = X;  
   return getValue(V);
 }
 
-const llvm::APSInt& ValueManager::getValue(uint64_t X, QualType T) {
+const llvm::APSInt& BasicValueFactory::getValue(uint64_t X, QualType T) {
   
   unsigned bits = Ctx.getTypeSize(T);
   llvm::APSInt V(bits, T->isUnsignedIntegerType());
@@ -57,7 +58,7 @@
 }
 
 const SymIntConstraint&
-ValueManager::getConstraint(SymbolID sym, BinaryOperator::Opcode Op,
+BasicValueFactory::getConstraint(SymbolID sym, BinaryOperator::Opcode Op,
                             const llvm::APSInt& V) {
   
   llvm::FoldingSetNodeID ID;
@@ -76,7 +77,7 @@
 }
 
 const llvm::APSInt*
-ValueManager::EvaluateAPSInt(BinaryOperator::Opcode Op,
+BasicValueFactory::EvaluateAPSInt(BinaryOperator::Opcode Op,
                              const llvm::APSInt& V1, const llvm::APSInt& V2) {
   
   switch (Op) {
diff --git a/Analysis/CFRefCount.cpp b/Analysis/CFRefCount.cpp
index fce9b44..72e085b 100644
--- a/Analysis/CFRefCount.cpp
+++ b/Analysis/CFRefCount.cpp
@@ -44,7 +44,7 @@
 void CFRefCount::EvalCall(ExplodedNodeSet<ValueState>& Dst,
                             ValueStateManager& StateMgr,
                             GRStmtNodeBuilder<ValueState>& Builder,
-                            ValueManager& ValMgr,
+                            BasicValueFactory& BasicVals,
                             CallExpr* CE, LVal L,
                             ExplodedNode<ValueState>* Pred) {
   
diff --git a/Analysis/CFRefCount.h b/Analysis/CFRefCount.h
index 4a9b0d1..4a47881 100644
--- a/Analysis/CFRefCount.h
+++ b/Analysis/CFRefCount.h
@@ -29,7 +29,7 @@
   virtual void EvalCall(ExplodedNodeSet<ValueState>& Dst,
                         ValueStateManager& StateMgr,
                         GRStmtNodeBuilder<ValueState>& Builder,
-                        ValueManager& ValMgr,
+                        BasicValueFactory& BasicVals,
                         CallExpr* CE, LVal L,
                         ExplodedNode<ValueState>* Pred);  
 };
diff --git a/Analysis/GRExprEngine.cpp b/Analysis/GRExprEngine.cpp
index 082e124..87c3bd7 100644
--- a/Analysis/GRExprEngine.cpp
+++ b/Analysis/GRExprEngine.cpp
@@ -308,7 +308,7 @@
     //  This should be easy once we have "ranges" for NonLVals.
         
     do {      
-      nonlval::ConcreteInt CaseVal(ValMgr.getValue(V1));
+      nonlval::ConcreteInt CaseVal(BasicVals.getValue(V1));
       
       RVal Res = EvalBinOp(BinaryOperator::EQ, CondV, CaseVal);
       
@@ -657,12 +657,12 @@
           if (T->isPointerType()) {
             
             St = SetRVal(St, lval::DeclVal(VD),
-                         lval::ConcreteInt(ValMgr.getValue(0, T)));
+                         lval::ConcreteInt(BasicVals.getValue(0, T)));
           }
           else if (T->isIntegerType()) {
             
             St = SetRVal(St, lval::DeclVal(VD),
-                         nonlval::ConcreteInt(ValMgr.getValue(0, T)));
+                         nonlval::ConcreteInt(BasicVals.getValue(0, T)));
           }
           
 
@@ -727,7 +727,7 @@
   
   Nodify(Dst, Ex, Pred,
          SetRVal(Pred->getState(), Ex,
-                  NonLVal::MakeVal(ValMgr, size, Ex->getType())));
+                  NonLVal::MakeVal(BasicVals, size, Ex->getType())));
   
 }
 
@@ -917,13 +917,13 @@
         //    transfer functions as "0 == E".
 
         if (isa<LVal>(SubV)) {
-          lval::ConcreteInt V(ValMgr.getZeroWithPtrWidth());
+          lval::ConcreteInt V(BasicVals.getZeroWithPtrWidth());
           RVal Result = EvalBinOp(BinaryOperator::EQ, cast<LVal>(SubV), V);
           St = SetRVal(St, U, Result);
         }
         else {
           Expr* Ex = U->getSubExpr();
-          nonlval::ConcreteInt V(ValMgr.getValue(0, Ex->getType()));
+          nonlval::ConcreteInt V(BasicVals.getValue(0, Ex->getType()));
           RVal Result = EvalBinOp(BinaryOperator::EQ, cast<NonLVal>(SubV), V);
           St = SetRVal(St, U, Result);
         }
@@ -955,7 +955,7 @@
   
   uint64_t size = getContext().getTypeSize(T) / 8;                
   ValueState* St = Pred->getState();
-  St = SetRVal(St, U, NonLVal::MakeVal(ValMgr, size, U->getType()));
+  St = SetRVal(St, U, NonLVal::MakeVal(BasicVals, size, U->getType()));
 
   Nodify(Dst, U, Pred, St);
 }
@@ -1433,10 +1433,10 @@
     case lval::SymbolValKind:
       if (Assumption)
         return AssumeSymNE(St, cast<lval::SymbolVal>(Cond).getSymbol(),
-                           ValMgr.getZeroWithPtrWidth(), isFeasible);
+                           BasicVals.getZeroWithPtrWidth(), isFeasible);
       else
         return AssumeSymEQ(St, cast<lval::SymbolVal>(Cond).getSymbol(),
-                           ValMgr.getZeroWithPtrWidth(), isFeasible);
+                           BasicVals.getZeroWithPtrWidth(), isFeasible);
       
       
     case lval::DeclValKind:
@@ -1467,10 +1467,10 @@
       SymbolID sym = SV.getSymbol();
       
       if (Assumption)
-        return AssumeSymNE(St, sym, ValMgr.getValue(0, SymMgr.getType(sym)),
+        return AssumeSymNE(St, sym, BasicVals.getValue(0, SymMgr.getType(sym)),
                            isFeasible);
       else
-        return AssumeSymEQ(St, sym, ValMgr.getValue(0, SymMgr.getType(sym)),
+        return AssumeSymEQ(St, sym, BasicVals.getValue(0, SymMgr.getType(sym)),
                            isFeasible);
     }
       
diff --git a/Analysis/GRSimpleVals.cpp b/Analysis/GRSimpleVals.cpp
index 95cf3bb..c18610d 100644
--- a/Analysis/GRSimpleVals.cpp
+++ b/Analysis/GRSimpleVals.cpp
@@ -153,24 +153,24 @@
 // Transfer function for Casts.
 //===----------------------------------------------------------------------===//
 
-RVal GRSimpleVals::EvalCast(ValueManager& ValMgr, NonLVal X, QualType T) {
+RVal GRSimpleVals::EvalCast(BasicValueFactory& BasicVals, NonLVal X, QualType T) {
   
   if (!isa<nonlval::ConcreteInt>(X))
     return UnknownVal();
   
   llvm::APSInt V = cast<nonlval::ConcreteInt>(X).getValue();
   V.setIsUnsigned(T->isUnsignedIntegerType() || T->isPointerType());
-  V.extOrTrunc(ValMgr.getContext().getTypeSize(T));
+  V.extOrTrunc(BasicVals.getContext().getTypeSize(T));
   
   if (T->isPointerType())
-    return lval::ConcreteInt(ValMgr.getValue(V));
+    return lval::ConcreteInt(BasicVals.getValue(V));
   else
-    return nonlval::ConcreteInt(ValMgr.getValue(V));
+    return nonlval::ConcreteInt(BasicVals.getValue(V));
 }
 
 // Casts.
 
-RVal GRSimpleVals::EvalCast(ValueManager& ValMgr, LVal X, QualType T) {
+RVal GRSimpleVals::EvalCast(BasicValueFactory& BasicVals, LVal X, QualType T) {
   
   if (T->isPointerType() || T->isReferenceType())
     return X;
@@ -182,31 +182,31 @@
   
   llvm::APSInt V = cast<lval::ConcreteInt>(X).getValue();
   V.setIsUnsigned(T->isUnsignedIntegerType() || T->isPointerType());
-  V.extOrTrunc(ValMgr.getContext().getTypeSize(T));
+  V.extOrTrunc(BasicVals.getContext().getTypeSize(T));
 
-  return nonlval::ConcreteInt(ValMgr.getValue(V));
+  return nonlval::ConcreteInt(BasicVals.getValue(V));
 }
 
 // Unary operators.
 
-RVal GRSimpleVals::EvalMinus(ValueManager& ValMgr, UnaryOperator* U, NonLVal X){
+RVal GRSimpleVals::EvalMinus(BasicValueFactory& BasicVals, UnaryOperator* U, NonLVal X){
   
   switch (X.getSubKind()) {
       
     case nonlval::ConcreteIntKind:
-      return cast<nonlval::ConcreteInt>(X).EvalMinus(ValMgr, U);
+      return cast<nonlval::ConcreteInt>(X).EvalMinus(BasicVals, U);
       
     default:
       return UnknownVal();
   }
 }
 
-RVal GRSimpleVals::EvalComplement(ValueManager& ValMgr, NonLVal X) {
+RVal GRSimpleVals::EvalComplement(BasicValueFactory& BasicVals, NonLVal X) {
 
   switch (X.getSubKind()) {
       
     case nonlval::ConcreteIntKind:
-      return cast<nonlval::ConcreteInt>(X).EvalComplement(ValMgr);
+      return cast<nonlval::ConcreteInt>(X).EvalComplement(BasicVals);
       
     default:
       return UnknownVal();
@@ -215,7 +215,7 @@
 
 // Binary operators.
 
-RVal GRSimpleVals::EvalBinOp(ValueManager& ValMgr, BinaryOperator::Opcode Op,
+RVal GRSimpleVals::EvalBinOp(BasicValueFactory& BasicVals, BinaryOperator::Opcode Op,
                              NonLVal L, NonLVal R)  {  
   while (1) {
     
@@ -228,7 +228,7 @@
         if (isa<nonlval::ConcreteInt>(R)) {          
           const nonlval::ConcreteInt& L_CI = cast<nonlval::ConcreteInt>(L);
           const nonlval::ConcreteInt& R_CI = cast<nonlval::ConcreteInt>(R);          
-          return L_CI.EvalBinOp(ValMgr, Op, R_CI);          
+          return L_CI.EvalBinOp(BasicVals, Op, R_CI);          
         }
         else {
           NonLVal tmp = R;
@@ -241,7 +241,7 @@
         
         if (isa<nonlval::ConcreteInt>(R)) {
           const SymIntConstraint& C =
-            ValMgr.getConstraint(cast<nonlval::SymbolVal>(L).getSymbol(), Op,
+            BasicVals.getConstraint(cast<nonlval::SymbolVal>(L).getSymbol(), Op,
                                  cast<nonlval::ConcreteInt>(R).getValue());
           
           return nonlval::SymIntConstraintVal(C);
@@ -256,7 +256,7 @@
 
 // Binary Operators (except assignments and comma).
 
-RVal GRSimpleVals::EvalBinOp(ValueManager& ValMgr, BinaryOperator::Opcode Op,
+RVal GRSimpleVals::EvalBinOp(BasicValueFactory& BasicVals, BinaryOperator::Opcode Op,
                              LVal L, LVal R) {
   
   switch (Op) {
@@ -265,23 +265,23 @@
       return UnknownVal();
       
     case BinaryOperator::EQ:
-      return EvalEQ(ValMgr, L, R);
+      return EvalEQ(BasicVals, L, R);
       
     case BinaryOperator::NE:
-      return EvalNE(ValMgr, L, R);      
+      return EvalNE(BasicVals, L, R);      
   }
 }
 
 // Pointer arithmetic.
 
-RVal GRSimpleVals::EvalBinOp(ValueManager& ValMgr, BinaryOperator::Opcode Op,
+RVal GRSimpleVals::EvalBinOp(BasicValueFactory& BasicVals, BinaryOperator::Opcode Op,
                              LVal L, NonLVal R) {  
   return UnknownVal();
 }
 
 // Equality operators for LVals.
 
-RVal GRSimpleVals::EvalEQ(ValueManager& ValMgr, LVal L, LVal R) {
+RVal GRSimpleVals::EvalEQ(BasicValueFactory& BasicVals, LVal L, LVal R) {
   
   switch (L.getSubKind()) {
 
@@ -295,12 +295,12 @@
         bool b = cast<lval::ConcreteInt>(L).getValue() ==
                  cast<lval::ConcreteInt>(R).getValue();
         
-        return NonLVal::MakeIntTruthVal(ValMgr, b);
+        return NonLVal::MakeIntTruthVal(BasicVals, b);
       }
       else if (isa<lval::SymbolVal>(R)) {
         
         const SymIntConstraint& C =
-          ValMgr.getConstraint(cast<lval::SymbolVal>(R).getSymbol(),
+          BasicVals.getConstraint(cast<lval::SymbolVal>(R).getSymbol(),
                                BinaryOperator::EQ,
                                cast<lval::ConcreteInt>(L).getValue());
         
@@ -313,7 +313,7 @@
 
       if (isa<lval::ConcreteInt>(R)) {          
         const SymIntConstraint& C =
-          ValMgr.getConstraint(cast<lval::SymbolVal>(L).getSymbol(),
+          BasicVals.getConstraint(cast<lval::SymbolVal>(L).getSymbol(),
                                BinaryOperator::EQ,
                                cast<lval::ConcreteInt>(R).getValue());
         
@@ -331,13 +331,13 @@
     case lval::DeclValKind:
     case lval::FuncValKind:
     case lval::GotoLabelKind:
-      return NonLVal::MakeIntTruthVal(ValMgr, L == R);
+      return NonLVal::MakeIntTruthVal(BasicVals, L == R);
   }
   
-  return NonLVal::MakeIntTruthVal(ValMgr, false);
+  return NonLVal::MakeIntTruthVal(BasicVals, false);
 }
 
-RVal GRSimpleVals::EvalNE(ValueManager& ValMgr, LVal L, LVal R) {
+RVal GRSimpleVals::EvalNE(BasicValueFactory& BasicVals, LVal L, LVal R) {
   
   switch (L.getSubKind()) {
 
@@ -351,11 +351,11 @@
         bool b = cast<lval::ConcreteInt>(L).getValue() !=
                  cast<lval::ConcreteInt>(R).getValue();
         
-        return NonLVal::MakeIntTruthVal(ValMgr, b);
+        return NonLVal::MakeIntTruthVal(BasicVals, b);
       }
       else if (isa<lval::SymbolVal>(R)) {        
         const SymIntConstraint& C =
-          ValMgr.getConstraint(cast<lval::SymbolVal>(R).getSymbol(),
+          BasicVals.getConstraint(cast<lval::SymbolVal>(R).getSymbol(),
                                BinaryOperator::NE,
                                cast<lval::ConcreteInt>(L).getValue());
         
@@ -367,7 +367,7 @@
     case lval::SymbolValKind: {
       if (isa<lval::ConcreteInt>(R)) {          
         const SymIntConstraint& C =
-          ValMgr.getConstraint(cast<lval::SymbolVal>(L).getSymbol(),
+          BasicVals.getConstraint(cast<lval::SymbolVal>(L).getSymbol(),
                                BinaryOperator::NE,
                                cast<lval::ConcreteInt>(R).getValue());
         
@@ -387,10 +387,10 @@
     case lval::DeclValKind:
     case lval::FuncValKind:
     case lval::GotoLabelKind:
-      return NonLVal::MakeIntTruthVal(ValMgr, L != R);
+      return NonLVal::MakeIntTruthVal(BasicVals, L != R);
   }
   
-  return NonLVal::MakeIntTruthVal(ValMgr, true);
+  return NonLVal::MakeIntTruthVal(BasicVals, true);
 }
 
 //===----------------------------------------------------------------------===//
@@ -400,7 +400,7 @@
 void GRSimpleVals::EvalCall(ExplodedNodeSet<ValueState>& Dst,
                             ValueStateManager& StateMgr,
                             GRStmtNodeBuilder<ValueState>& Builder,
-                            ValueManager& ValMgr,
+                            BasicValueFactory& BasicVals,
                             CallExpr* CE, LVal L,
                             ExplodedNode<ValueState>* Pred) {
   
diff --git a/Analysis/GRSimpleVals.h b/Analysis/GRSimpleVals.h
index 8cee742..33ccd26 100644
--- a/Analysis/GRSimpleVals.h
+++ b/Analysis/GRSimpleVals.h
@@ -28,26 +28,26 @@
   
   // Casts.
   
-  virtual RVal EvalCast(ValueManager& ValMgr, NonLVal V, QualType CastT);
-  virtual RVal EvalCast(ValueManager& ValMgr, LVal V, QualType CastT);
+  virtual RVal EvalCast(BasicValueFactory& BasicVals, NonLVal V, QualType CastT);
+  virtual RVal EvalCast(BasicValueFactory& BasicVals, LVal V, QualType CastT);
   
   // Unary Operators.
   
-  virtual RVal EvalMinus(ValueManager& ValMgr, UnaryOperator* U, NonLVal X);
+  virtual RVal EvalMinus(BasicValueFactory& BasicVals, UnaryOperator* U, NonLVal X);
 
-  virtual RVal EvalComplement(ValueManager& ValMgr, NonLVal X);
+  virtual RVal EvalComplement(BasicValueFactory& BasicVals, NonLVal X);
   
   // Binary Operators.
   
-  virtual RVal EvalBinOp(ValueManager& ValMgr, BinaryOperator::Opcode Op,
+  virtual RVal EvalBinOp(BasicValueFactory& BasicVals, BinaryOperator::Opcode Op,
                          NonLVal L, NonLVal R);
   
-  virtual RVal EvalBinOp(ValueManager& ValMgr, BinaryOperator::Opcode Op,
+  virtual RVal EvalBinOp(BasicValueFactory& BasicVals, BinaryOperator::Opcode Op,
                          LVal L, LVal R);
   
   // Pointer arithmetic.
   
-  virtual RVal EvalBinOp(ValueManager& ValMgr, BinaryOperator::Opcode Op,
+  virtual RVal EvalBinOp(BasicValueFactory& BasicVals, BinaryOperator::Opcode Op,
                          LVal L, NonLVal R);  
   
   // Calls.
@@ -55,7 +55,7 @@
   virtual void EvalCall(ExplodedNodeSet<ValueState>& Dst,
                         ValueStateManager& StateMgr,
                         GRStmtNodeBuilder<ValueState>& Builder,
-                        ValueManager& ValMgr,
+                        BasicValueFactory& BasicVals,
                         CallExpr* CE, LVal L,
                         ExplodedNode<ValueState>* Pred);
   
@@ -63,8 +63,8 @@
   
   // Equality operators for LVals.
   
-  RVal EvalEQ(ValueManager& ValMgr, LVal L, LVal R);
-  RVal EvalNE(ValueManager& ValMgr, LVal L, LVal R);
+  RVal EvalEQ(BasicValueFactory& BasicVals, LVal L, LVal R);
+  RVal EvalNE(BasicValueFactory& BasicVals, LVal L, LVal R);
 };
   
 } // end clang namespace
diff --git a/Analysis/RValues.cpp b/Analysis/RValues.cpp
index 7c1275b..9d5bd68 100644
--- a/Analysis/RValues.cpp
+++ b/Analysis/RValues.cpp
@@ -49,10 +49,10 @@
 //===----------------------------------------------------------------------===//
 
 RVal
-nonlval::ConcreteInt::EvalBinOp(ValueManager& ValMgr, BinaryOperator::Opcode Op,
+nonlval::ConcreteInt::EvalBinOp(BasicValueFactory& BasicVals, BinaryOperator::Opcode Op,
                                 const nonlval::ConcreteInt& R) const {
   
-  const llvm::APSInt* X = ValMgr.EvaluateAPSInt(Op, getValue(), R.getValue());
+  const llvm::APSInt* X = BasicVals.EvaluateAPSInt(Op, getValue(), R.getValue());
   
   if (X)
     return nonlval::ConcreteInt(*X);
@@ -64,17 +64,17 @@
   // Bitwise-Complement.
 
 nonlval::ConcreteInt
-nonlval::ConcreteInt::EvalComplement(ValueManager& ValMgr) const {
-  return ValMgr.getValue(~getValue()); 
+nonlval::ConcreteInt::EvalComplement(BasicValueFactory& BasicVals) const {
+  return BasicVals.getValue(~getValue()); 
 }
 
   // Unary Minus.
 
 nonlval::ConcreteInt
-nonlval::ConcreteInt::EvalMinus(ValueManager& ValMgr, UnaryOperator* U) const {
+nonlval::ConcreteInt::EvalMinus(BasicValueFactory& BasicVals, UnaryOperator* U) const {
   assert (U->getType() == U->getSubExpr()->getType());  
   assert (U->getType()->isIntegerType());  
-  return ValMgr.getValue(-getValue()); 
+  return BasicVals.getValue(-getValue()); 
 }
 
 //===----------------------------------------------------------------------===//
@@ -82,13 +82,13 @@
 //===----------------------------------------------------------------------===//
 
 RVal
-lval::ConcreteInt::EvalBinOp(ValueManager& ValMgr, BinaryOperator::Opcode Op,
+lval::ConcreteInt::EvalBinOp(BasicValueFactory& BasicVals, BinaryOperator::Opcode Op,
                              const lval::ConcreteInt& R) const {
   
   assert (Op == BinaryOperator::Add || Op == BinaryOperator::Sub ||
           (Op >= BinaryOperator::LT && Op <= BinaryOperator::NE));
   
-  const llvm::APSInt* X = ValMgr.EvaluateAPSInt(Op, getValue(), R.getValue());
+  const llvm::APSInt* X = BasicVals.EvaluateAPSInt(Op, getValue(), R.getValue());
   
   if (X)
     return lval::ConcreteInt(*X);
@@ -96,7 +96,7 @@
     return UndefinedVal();
 }
 
-NonLVal LVal::EQ(ValueManager& ValMgr, const LVal& R) const {
+NonLVal LVal::EQ(BasicValueFactory& BasicVals, const LVal& R) const {
   
   switch (getSubKind()) {
     default:
@@ -108,12 +108,12 @@
         bool b = cast<lval::ConcreteInt>(this)->getValue() ==
                  cast<lval::ConcreteInt>(R).getValue();
         
-        return NonLVal::MakeIntTruthVal(ValMgr, b);
+        return NonLVal::MakeIntTruthVal(BasicVals, b);
       }
       else if (isa<lval::SymbolVal>(R)) {
         
         const SymIntConstraint& C =
-          ValMgr.getConstraint(cast<lval::SymbolVal>(R).getSymbol(),
+          BasicVals.getConstraint(cast<lval::SymbolVal>(R).getSymbol(),
                                BinaryOperator::EQ,
                                cast<lval::ConcreteInt>(this)->getValue());
         
@@ -126,7 +126,7 @@
         if (isa<lval::ConcreteInt>(R)) {
           
           const SymIntConstraint& C =
-            ValMgr.getConstraint(cast<lval::SymbolVal>(this)->getSymbol(),
+            BasicVals.getConstraint(cast<lval::SymbolVal>(this)->getSymbol(),
                                  BinaryOperator::EQ,
                                  cast<lval::ConcreteInt>(R).getValue());
           
@@ -141,16 +141,16 @@
       case lval::DeclValKind:
       if (isa<lval::DeclVal>(R)) {        
         bool b = cast<lval::DeclVal>(*this) == cast<lval::DeclVal>(R);
-        return NonLVal::MakeIntTruthVal(ValMgr, b);
+        return NonLVal::MakeIntTruthVal(BasicVals, b);
       }
       
       break;
   }
   
-  return NonLVal::MakeIntTruthVal(ValMgr, false);
+  return NonLVal::MakeIntTruthVal(BasicVals, false);
 }
 
-NonLVal LVal::NE(ValueManager& ValMgr, const LVal& R) const {
+NonLVal LVal::NE(BasicValueFactory& BasicVals, const LVal& R) const {
   switch (getSubKind()) {
     default:
       assert(false && "NE not implemented for this LVal.");
@@ -161,12 +161,12 @@
         bool b = cast<lval::ConcreteInt>(this)->getValue() !=
                  cast<lval::ConcreteInt>(R).getValue();
         
-        return NonLVal::MakeIntTruthVal(ValMgr, b);
+        return NonLVal::MakeIntTruthVal(BasicVals, b);
       }
       else if (isa<lval::SymbolVal>(R)) {
         
         const SymIntConstraint& C =
-        ValMgr.getConstraint(cast<lval::SymbolVal>(R).getSymbol(),
+        BasicVals.getConstraint(cast<lval::SymbolVal>(R).getSymbol(),
                              BinaryOperator::NE,
                              cast<lval::ConcreteInt>(this)->getValue());
         
@@ -179,7 +179,7 @@
         if (isa<lval::ConcreteInt>(R)) {
           
           const SymIntConstraint& C =
-          ValMgr.getConstraint(cast<lval::SymbolVal>(this)->getSymbol(),
+          BasicVals.getConstraint(cast<lval::SymbolVal>(this)->getSymbol(),
                                BinaryOperator::NE,
                                cast<lval::ConcreteInt>(R).getValue());
           
@@ -194,31 +194,31 @@
       case lval::DeclValKind:
         if (isa<lval::DeclVal>(R)) {        
           bool b = cast<lval::DeclVal>(*this) == cast<lval::DeclVal>(R);
-          return NonLVal::MakeIntTruthVal(ValMgr, b);
+          return NonLVal::MakeIntTruthVal(BasicVals, b);
         }
       
         break;
   }
   
-  return NonLVal::MakeIntTruthVal(ValMgr, true);
+  return NonLVal::MakeIntTruthVal(BasicVals, true);
 }
 
 //===----------------------------------------------------------------------===//
 // Utility methods for constructing Non-LVals.
 //===----------------------------------------------------------------------===//
 
-NonLVal NonLVal::MakeVal(ValueManager& ValMgr, uint64_t X, QualType T) {  
-  return nonlval::ConcreteInt(ValMgr.getValue(X, T));
+NonLVal NonLVal::MakeVal(BasicValueFactory& BasicVals, uint64_t X, QualType T) {  
+  return nonlval::ConcreteInt(BasicVals.getValue(X, T));
 }
 
-NonLVal NonLVal::MakeVal(ValueManager& ValMgr, IntegerLiteral* I) {
+NonLVal NonLVal::MakeVal(BasicValueFactory& BasicVals, IntegerLiteral* I) {
 
-  return nonlval::ConcreteInt(ValMgr.getValue(APSInt(I->getValue(),
+  return nonlval::ConcreteInt(BasicVals.getValue(APSInt(I->getValue(),
                               I->getType()->isUnsignedIntegerType())));
 }
 
-NonLVal NonLVal::MakeIntTruthVal(ValueManager& ValMgr, bool b) {
-  return nonlval::ConcreteInt(ValMgr.getTruthValue(b));
+NonLVal NonLVal::MakeIntTruthVal(BasicValueFactory& BasicVals, bool b) {
+  return nonlval::ConcreteInt(BasicVals.getTruthValue(b));
 }
 
 RVal RVal::GetSymbolValue(SymbolManager& SymMgr, VarDecl* D) {
diff --git a/Analysis/ValueState.cpp b/Analysis/ValueState.cpp
index ef6fc17..4eb2a5e 100644
--- a/Analysis/ValueState.cpp
+++ b/Analysis/ValueState.cpp
@@ -245,7 +245,7 @@
           // are comparing states using pointer equality.  Perhaps there is
           // a better way, since APInts are fairly lightweight.
 
-          return nonlval::ConcreteInt(ValMgr.getValue(ED->getInitVal()));          
+          return nonlval::ConcreteInt(BasicVals.getValue(ED->getInitVal()));          
         }
         else if (FunctionDecl* FD = dyn_cast<FunctionDecl>(D))
           return lval::FuncVal(FD);
@@ -258,11 +258,11 @@
         
       case Stmt::CharacterLiteralClass: {
         CharacterLiteral* C = cast<CharacterLiteral>(E);
-        return NonLVal::MakeVal(ValMgr, C->getValue(), C->getType());
+        return NonLVal::MakeVal(BasicVals, C->getValue(), C->getType());
       }
         
       case Stmt::IntegerLiteralClass: {
-        return NonLVal::MakeVal(ValMgr, cast<IntegerLiteral>(E));
+        return NonLVal::MakeVal(BasicVals, cast<IntegerLiteral>(E));
       }
 
         // Casts where the source and target type are the same
@@ -339,11 +339,11 @@
   switch (E->getStmtClass()) {
     case Stmt::CharacterLiteralClass: {
       CharacterLiteral* C = cast<CharacterLiteral>(E);
-      return NonLVal::MakeVal(ValMgr, C->getValue(), C->getType());
+      return NonLVal::MakeVal(BasicVals, C->getValue(), C->getType());
     }
       
     case Stmt::IntegerLiteralClass: {
-      return NonLVal::MakeVal(ValMgr, cast<IntegerLiteral>(E));
+      return NonLVal::MakeVal(BasicVals, cast<IntegerLiteral>(E));
     }
       
     default: {