Rename ConstPoolVal -> Constant
Rename ConstPool*   -> Constant*
Rename ConstPoolVals.h -> ConstantVals.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1407 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Transforms/ExprTypeConvert.cpp b/lib/Transforms/ExprTypeConvert.cpp
index 7efe623..57d533d 100644
--- a/lib/Transforms/ExprTypeConvert.cpp
+++ b/lib/Transforms/ExprTypeConvert.cpp
@@ -11,7 +11,7 @@
 #include "llvm/iOther.h"
 #include "llvm/iPHINode.h"
 #include "llvm/iMemory.h"
-#include "llvm/ConstPoolVals.h"
+#include "llvm/ConstantVals.h"
 #include "llvm/Optimizations/ConstantHandling.h"
 #include "llvm/Optimizations/DCE.h"
 #include "llvm/Analysis/Expressions.h"
@@ -36,7 +36,7 @@
 static bool AllIndicesZero(const MemAccessInst *MAI) {
   for (User::op_const_iterator S = MAI->idx_begin(), E = MAI->idx_end();
        S != E; ++S)
-    if (!isa<ConstPoolVal>(*S) || !cast<ConstPoolVal>(*S)->isNullValue())
+    if (!isa<Constant>(*S) || !cast<Constant>(*S)->isNullValue())
       return false;
   return true;
 }
@@ -155,7 +155,7 @@
     unsigned DataSize = TD.getTypeSize(ElType);
     
     if (OffsetAmount > DataSize) // Allocate a sized array amount...
-      Expr.Var = ConstPoolUInt::get(Type::UIntTy, OffsetAmount/DataSize);
+      Expr.Var = ConstantUInt::get(Type::UIntTy, OffsetAmount/DataSize);
   }
 #endif
 
@@ -198,7 +198,7 @@
     // const prop'd in general).  We just ask the constant propogator to see if
     // it can convert the value...
     //
-    if (ConstPoolVal *CPV = dyn_cast<ConstPoolVal>(V))
+    if (Constant *CPV = dyn_cast<Constant>(V))
       if (opt::ConstantFoldCastInstruction(CPV, Ty))
         return true;  // Don't worry about deallocating, it's a constant.
 
@@ -285,8 +285,8 @@
     const Type *BaseType = GEP->getPointerOperand()->getType();
     const Type *ElTy = 0;
 
-    while (!Indices.empty() && isa<ConstPoolUInt>(Indices.back()) &&
-           cast<ConstPoolUInt>(Indices.back())->getValue() == 0) {
+    while (!Indices.empty() && isa<ConstantUInt>(Indices.back()) &&
+           cast<ConstantUInt>(Indices.back())->getValue() == 0) {
       Indices.pop_back();
       ElTy = GetElementPtrInst::getIndexedType(BaseType, Indices,
                                                            true);
@@ -329,7 +329,7 @@
 
   Instruction *I = dyn_cast<Instruction>(V);
   if (I == 0)
-    if (ConstPoolVal *CPV = cast<ConstPoolVal>(V)) {
+    if (Constant *CPV = cast<Constant>(V)) {
       // Constants are converted by constant folding the cast that is required.
       // We assume here that all casts are implemented for constant prop.
       Value *Result = opt::ConstantFoldCastInstruction(CPV, Ty);
@@ -349,7 +349,7 @@
 
   ValueHandle IHandle(VMC, I);  // Prevent I from being removed!
   
-  ConstPoolVal *Dummy = ConstPoolVal::getNullConstant(Ty);
+  Constant *Dummy = Constant::getNullConstant(Ty);
 
   //cerr << endl << endl << "Type:\t" << Ty << "\nInst: " << I << "BB Before: " << BB << endl;
 
@@ -380,8 +380,7 @@
     LoadInst *LI = cast<LoadInst>(I);
     assert(!LI->hasIndices() || AllIndicesZero(LI));
 
-    Res = new LoadInst(ConstPoolVal::getNullConstant(PointerType::get(Ty)), 
-                       Name);
+    Res = new LoadInst(Constant::getNullConstant(PointerType::get(Ty)), Name);
     VMC.ExprMap[I] = Res;
     Res->setOperand(0, ConvertExpressionToType(LI->getPointerOperand(),
                                                PointerType::get(Ty), VMC));
@@ -433,8 +432,8 @@
     const Type *BaseType = GEP->getPointerOperand()->getType();
     const Type *PVTy = cast<PointerType>(Ty)->getValueType();
     Res = 0;
-    while (!Indices.empty() && isa<ConstPoolUInt>(Indices.back()) &&
-           cast<ConstPoolUInt>(Indices.back())->getValue() == 0) {
+    while (!Indices.empty() && isa<ConstantUInt>(Indices.back()) &&
+           cast<ConstantUInt>(Indices.back())->getValue() == 0) {
       Indices.pop_back();
       if (GetElementPtrInst::getIndexedType(BaseType, Indices, true) == PVTy) {
         if (Indices.size() == 0) {
@@ -723,8 +722,8 @@
   ValueHandle IHandle(VMC, I);
 
   const Type *NewTy = NewVal->getType();
-  ConstPoolVal *Dummy = (NewTy != Type::VoidTy) ? 
-                  ConstPoolVal::getNullConstant(NewTy) : 0;
+  Constant *Dummy = (NewTy != Type::VoidTy) ? 
+                  Constant::getNullConstant(NewTy) : 0;
 
   switch (I->getOpcode()) {
   case Instruction::Cast:
@@ -793,12 +792,12 @@
   case Instruction::Store: {
     if (I->getOperand(0) == OldVal) {  // Replace the source value
       const PointerType *NewPT = PointerType::get(NewTy);
-      Res = new StoreInst(NewVal, ConstPoolVal::getNullConstant(NewPT));
+      Res = new StoreInst(NewVal, Constant::getNullConstant(NewPT));
       VMC.ExprMap[I] = Res;
       Res->setOperand(1, ConvertExpressionToType(I->getOperand(1), NewPT, VMC));
     } else {                           // Replace the source pointer
       const Type *ValTy = cast<PointerType>(NewTy)->getValueType();
-      Res = new StoreInst(ConstPoolVal::getNullConstant(ValTy), NewVal);
+      Res = new StoreInst(Constant::getNullConstant(ValTy), NewVal);
       VMC.ExprMap[I] = Res;
       Res->setOperand(0, ConvertExpressionToType(I->getOperand(0), ValTy, VMC));
     }
diff --git a/lib/Transforms/HoistPHIConstants.cpp b/lib/Transforms/HoistPHIConstants.cpp
index fe7cabf..e28e8a2 100644
--- a/lib/Transforms/HoistPHIConstants.cpp
+++ b/lib/Transforms/HoistPHIConstants.cpp
@@ -51,32 +51,29 @@
   CachedCopyMap Cache;
   bool Changed = false;
   
-  for (Method::iterator BI = M->begin(), BE = M->end(); BI != BE; ++BI)
-    {
-      vector<PHINode*> phis;            // normalizing invalidates BB iterator
+  for (Method::iterator BI = M->begin(), BE = M->end(); BI != BE; ++BI) {
+    vector<PHINode*> phis;            // normalizing invalidates BB iterator
       
-      for (BasicBlock::iterator II = (*BI)->begin(); II != (*BI)->end(); ++II)
-        {
-          if (PHINode *PN = dyn_cast<PHINode>(*II))
-            phis.push_back(PN);
-          else
-            break;                      // All PHIs occur at top of BB!
-        }
+    for (BasicBlock::iterator II = (*BI)->begin(); II != (*BI)->end(); ++II) {
+      if (PHINode *PN = dyn_cast<PHINode>(*II))
+        phis.push_back(PN);
+      else
+        break;                      // All PHIs occur at top of BB!
+    }
       
-      for (vector<PHINode*>::iterator PI=phis.begin(); PI != phis.end(); ++PI)
-        for (unsigned i = 0; i < (*PI)->getNumIncomingValues(); ++i)
-          {
-	    Value *Op = (*PI)->getIncomingValue(i);
-
-            if (isa<ConstPoolVal>(Op)) {
-            (*PI)->setIncomingValue(i,
+    for (vector<PHINode*>::iterator PI=phis.begin(); PI != phis.end(); ++PI)
+      for (unsigned i = 0; i < (*PI)->getNumIncomingValues(); ++i) {
+        Value *Op = (*PI)->getIncomingValue(i);
+        
+        if (isa<Constant>(Op)) {
+          (*PI)->setIncomingValue(i,
                     NormalizePhiOperand((*PI),
                                         (*PI)->getIncomingValue(i),
                                         (*PI)->getIncomingBlock(i), Cache));
-            Changed = true;
-            }
-          }
-    }
+          Changed = true;
+        }
+      }
+  }
   
   return Changed;
 }
diff --git a/lib/Transforms/IPO/ConstantMerge.cpp b/lib/Transforms/IPO/ConstantMerge.cpp
index 3564a81..70e3437 100644
--- a/lib/Transforms/IPO/ConstantMerge.cpp
+++ b/lib/Transforms/IPO/ConstantMerge.cpp
@@ -23,7 +23,7 @@
 //
 static inline 
 bool mergeDuplicateConstants(Module *M, unsigned &ConstantNo,
-                             map<ConstPoolVal*, GlobalVariable*> &CMap) {
+                             map<Constant*, GlobalVariable*> &CMap) {
   Module::GlobalListType &GList = M->getGlobalList();
   if (GList.size() <= ConstantNo) return false;   // No new constants
   bool MadeChanges = false;
@@ -32,10 +32,10 @@
     GlobalVariable *GV = GList[ConstantNo];
     if (GV->isConstant()) {  // Only process constants
       assert(GV->hasInitializer() && "Globals constants must have inits!");
-      ConstPoolVal *Init = GV->getInitializer();
+      Constant *Init = GV->getInitializer();
 
       // Check to see if the initializer is already known...
-      map<ConstPoolVal*, GlobalVariable*>::iterator I = CMap.find(Init);
+      map<Constant*, GlobalVariable*>::iterator I = CMap.find(Init);
 
       if (I == CMap.end()) {    // Nope, add it to the map
         CMap.insert(make_pair(Init, GV));
@@ -59,7 +59,7 @@
 // deal with passes.
 //
 bool ConstantMerge::mergeDuplicateConstants(Module *M) {
-  map<ConstPoolVal*, GlobalVariable*> Constants;
+  map<Constant*, GlobalVariable*> Constants;
   unsigned LastConstantSeen = 0;
   return ::mergeDuplicateConstants(M, LastConstantSeen, Constants);
 }
diff --git a/lib/Transforms/IPO/DeadTypeElimination.cpp b/lib/Transforms/IPO/DeadTypeElimination.cpp
index f29ae29..8599118 100644
--- a/lib/Transforms/IPO/DeadTypeElimination.cpp
+++ b/lib/Transforms/IPO/DeadTypeElimination.cpp
@@ -458,13 +458,13 @@
   const Type *Ty = PN->getType();
 
   if (const PointerType *PT = dyn_cast<PointerType>(Ty))
-    NewVal = ConstPoolPointerNull::get(PT);
+    NewVal = ConstantPointerNull::get(PT);
   else if (Ty == Type::BoolTy)
-    NewVal = ConstPoolBool::True;
+    NewVal = ConstantBool::True;
   else if (Ty == Type::FloatTy || Ty == Type::DoubleTy)
-    NewVal = ConstPoolFP::get(Ty, 42);
+    NewVal = ConstantFP::get(Ty, 42);
   else if (Ty->isIntegral())
-    NewVal = ConstPoolInt::get(Ty, 42);
+    NewVal = ConstantInt::get(Ty, 42);
 
   assert(NewVal && "Unknown PHI node type!");
   PN->addIncoming(NewVal, BB);
diff --git a/lib/Transforms/IPO/InlineSimple.cpp b/lib/Transforms/IPO/InlineSimple.cpp
index e54e0d9..40b98bd 100644
--- a/lib/Transforms/IPO/InlineSimple.cpp
+++ b/lib/Transforms/IPO/InlineSimple.cpp
@@ -41,7 +41,7 @@
   for (unsigned op = 0, E = I->getNumOperands(); op != E; ++op) {
     const Value *Op = I->getOperand(op);
     Value *V = ValueMap[Op];
-    if (!V && (isa<GlobalValue>(Op) || isa<ConstPoolVal>(Op)))
+    if (!V && (isa<GlobalValue>(Op) || isa<Constant>(Op)))
       continue;  // Globals and constants don't get relocated
 
     if (!V) {
diff --git a/lib/Transforms/IPO/MutateStructTypes.cpp b/lib/Transforms/IPO/MutateStructTypes.cpp
index a433e26..c9f7917 100644
--- a/lib/Transforms/IPO/MutateStructTypes.cpp
+++ b/lib/Transforms/IPO/MutateStructTypes.cpp
@@ -115,7 +115,7 @@
 
   if (const StructType *OldST = dyn_cast<StructType>(OldTy)) {
     // Figure out what the current index is...
-    unsigned ElNum = cast<ConstPoolUInt>(Idx[i])->getValue();
+    unsigned ElNum = cast<ConstantUInt>(Idx[i])->getValue();
     assert(ElNum < OldST->getElementTypes().size());
 
     map<const StructType*, TransformType>::iterator I = Transforms.find(OldST);
@@ -123,7 +123,7 @@
       assert(ElNum < I->second.second.size());
       // Apply the XForm specified by Transforms map...
       unsigned NewElNum = I->second.second[ElNum];
-      Idx[i] = ConstPoolUInt::get(Type::UByteTy, NewElNum);
+      Idx[i] = ConstantUInt::get(Type::UByteTy, NewElNum);
     }
   }
 
@@ -140,12 +140,12 @@
   // Ignore null values and simple constants..
   if (V == 0) return 0;
 
-  if (ConstPoolVal *CPV = dyn_cast<ConstPoolVal>(V)) {
+  if (Constant *CPV = dyn_cast<Constant>(V)) {
     if (V->getType()->isPrimitiveType())
       return CPV;
 
-    if (isa<ConstPoolPointerNull>(CPV))
-      return ConstPoolPointerNull::get(
+    if (isa<ConstantPointerNull>(CPV))
+      return ConstantPointerNull::get(
                       cast<PointerType>(ConvertType(V->getType())));
     assert(0 && "Unable to convert constpool val of this type!");
   }
diff --git a/lib/Transforms/Instrumentation/TraceValues.cpp b/lib/Transforms/Instrumentation/TraceValues.cpp
index 07db028..b42bb7b 100644
--- a/lib/Transforms/Instrumentation/TraceValues.cpp
+++ b/lib/Transforms/Instrumentation/TraceValues.cpp
@@ -15,7 +15,7 @@
 
 #include "llvm/Transforms/Instrumentation/TraceValues.h"
 #include "llvm/GlobalVariable.h"
-#include "llvm/ConstPoolVals.h"
+#include "llvm/ConstantVals.h"
 #include "llvm/Type.h"
 #include "llvm/DerivedTypes.h"
 #include "llvm/Instruction.h"
@@ -68,7 +68,7 @@
 }
 
 static inline GlobalVariable *GetStringRef(Module *M, const string &str) {
-  ConstPoolArray *Init = ConstPoolArray::get(str);
+  ConstantArray *Init = ConstantArray::get(str);
   GlobalVariable *GV = new GlobalVariable(Init->getType(), /*Const*/true,
 					  /*intern*/true, Init);
   M->getGlobalList().push_back(GV);
diff --git a/lib/Transforms/LevelRaise.cpp b/lib/Transforms/LevelRaise.cpp
index f802705..e0ca4db 100644
--- a/lib/Transforms/LevelRaise.cpp
+++ b/lib/Transforms/LevelRaise.cpp
@@ -11,7 +11,7 @@
 #include "llvm/Method.h"
 #include "llvm/iOther.h"
 #include "llvm/iMemory.h"
-#include "llvm/ConstPoolVals.h"
+#include "llvm/ConstantVals.h"
 #include "llvm/Optimizations/ConstantHandling.h"
 #include "llvm/Optimizations/DCE.h"
 #include "llvm/Optimizations/ConstantProp.h"
@@ -175,7 +175,7 @@
 #endif
           ValueMapCache ValueMap;
           Value *E = ConvertExpressionToType(Src, DestTy, ValueMap);
-          if (ConstPoolVal *CPV = dyn_cast<ConstPoolVal>(E))
+          if (Constant *CPV = dyn_cast<Constant>(E))
             CI->replaceAllUsesWith(CPV);
 
           BI = BB->begin();  // Rescan basic block.  BI might be invalidated.
@@ -242,7 +242,7 @@
             }
 
             // Insert a zero to index through this type...
-            Indices.push_back(ConstPoolUInt::get(CurCTy->getIndexType(), 0));
+            Indices.push_back(ConstantUInt::get(CurCTy->getIndexType(), 0));
 
             // Did we find what we're looking for?
             if (ElTy->isLosslesslyConvertableTo(DestPointedTy)) break;
@@ -502,8 +502,7 @@
 
   // Insert a cast!
   CastInst *TheCast = 
-    new CastInst(ConstPoolVal::getNullConstant(V->getType()), DestTy,
-                 V->getName());
+    new CastInst(Constant::getNullConstant(V->getType()), DestTy, V->getName());
   BB->getInstList().insert(InsertBefore, TheCast);
 
   cerr << "Inserting cast for " << V << endl;
diff --git a/lib/Transforms/Scalar/ConstantProp.cpp b/lib/Transforms/Scalar/ConstantProp.cpp
index bf28868..4fb3254 100644
--- a/lib/Transforms/Scalar/ConstantProp.cpp
+++ b/lib/Transforms/Scalar/ConstantProp.cpp
@@ -29,12 +29,12 @@
 #include "llvm/iTerminators.h"
 #include "llvm/iPHINode.h"
 #include "llvm/iOther.h"
-#include "llvm/ConstPoolVals.h"
+#include "llvm/ConstantVals.h"
 
 inline static bool 
 ConstantFoldUnaryInst(BasicBlock *BB, BasicBlock::iterator &II,
-                      UnaryOperator *Op, ConstPoolVal *D) {
-  ConstPoolVal *ReplaceWith = 
+                      UnaryOperator *Op, Constant *D) {
+  Constant *ReplaceWith = 
     opt::ConstantFoldUnaryInstruction(Op->getOpcode(), D);
 
   if (!ReplaceWith) return false;   // Nothing new to change...
@@ -56,8 +56,8 @@
 
 inline static bool 
 ConstantFoldCast(BasicBlock *BB, BasicBlock::iterator &II,
-                 CastInst *CI, ConstPoolVal *D) {
-  ConstPoolVal *ReplaceWith = 
+                 CastInst *CI, Constant *D) {
+  Constant *ReplaceWith = 
     opt::ConstantFoldCastInstruction(D, CI->getType());
 
   if (!ReplaceWith) return false;   // Nothing new to change...
@@ -80,8 +80,8 @@
 inline static bool 
 ConstantFoldBinaryInst(BasicBlock *BB, BasicBlock::iterator &II,
 		       BinaryOperator *Op,
-		       ConstPoolVal *D1, ConstPoolVal *D2) {
-  ConstPoolVal *ReplaceWith =
+		       Constant *D1, Constant *D2) {
+  Constant *ReplaceWith =
     opt::ConstantFoldBinaryInstruction(Op->getOpcode(), D1, D2);
   if (!ReplaceWith) return false;   // Nothing new to change...
 
@@ -111,7 +111,7 @@
     BasicBlock *Dest1 = cast<BasicBlock>(BI->getOperand(0));
     BasicBlock *Dest2 = cast<BasicBlock>(BI->getOperand(1));
 
-    if (ConstPoolBool *Cond = dyn_cast<ConstPoolBool>(BI->getCondition())) {
+    if (ConstantBool *Cond = dyn_cast<ConstantBool>(BI->getCondition())) {
       // Are we branching on constant?
       // YES.  Change to unconditional branch...
       BasicBlock *Destination = Cond->getValue() ? Dest1 : Dest2;
@@ -160,18 +160,18 @@
 						     BasicBlock::iterator &II) {
   Instruction *Inst = *II;
   if (BinaryOperator *BInst = dyn_cast<BinaryOperator>(Inst)) {
-    ConstPoolVal *D1 = dyn_cast<ConstPoolVal>(Inst->getOperand(0));
-    ConstPoolVal *D2 = dyn_cast<ConstPoolVal>(Inst->getOperand(1));
+    Constant *D1 = dyn_cast<Constant>(Inst->getOperand(0));
+    Constant *D2 = dyn_cast<Constant>(Inst->getOperand(1));
 
     if (D1 && D2)
       return ConstantFoldBinaryInst(BB, II, cast<BinaryOperator>(Inst), D1, D2);
 
   } else if (CastInst *CI = dyn_cast<CastInst>(Inst)) {
-    ConstPoolVal *D = dyn_cast<ConstPoolVal>(CI->getOperand(0));
+    Constant *D = dyn_cast<Constant>(CI->getOperand(0));
     if (D) return ConstantFoldCast(BB, II, CI, D);
                                          
   } else if (UnaryOperator *UInst = dyn_cast<UnaryOperator>(Inst)) {
-    ConstPoolVal *D = dyn_cast<ConstPoolVal>(UInst->getOperand(0));
+    Constant *D = dyn_cast<Constant>(UInst->getOperand(0));
     if (D) return ConstantFoldUnaryInst(BB, II, UInst, D);
   } else if (TerminatorInst *TInst = dyn_cast<TerminatorInst>(Inst)) {
     return opt::ConstantFoldTerminator(TInst);
diff --git a/lib/Transforms/Scalar/DCE.cpp b/lib/Transforms/Scalar/DCE.cpp
index e1bda22..6c4e3d2 100644
--- a/lib/Transforms/Scalar/DCE.cpp
+++ b/lib/Transforms/Scalar/DCE.cpp
@@ -96,7 +96,7 @@
 }
 
 static void ReplaceUsesWithConstant(Instruction *I) {
-  ConstPoolVal *CPV = ConstPoolVal::getNullConstant(I->getType());
+  Constant *CPV = Constant::getNullConstant(I->getType());
   
   // Make all users of this instruction reference the constant instead
   I->replaceAllUsesWith(CPV);
@@ -166,7 +166,7 @@
 
   // Remove basic blocks that have no predecessors... which are unreachable.
   if (BB->pred_begin() == BB->pred_end() &&
-      !BB->hasConstantPoolReferences()) {
+      !BB->hasConstantReferences()) {
     //cerr << "Removing BB: \n" << BB;
 
     // Loop through all of our successors and make sure they know that one
@@ -225,7 +225,7 @@
   // and if there is only one successor of the predecessor. 
   BasicBlock::pred_iterator PI(BB->pred_begin());
   if (PI != BB->pred_end() && *PI != BB &&    // Not empty?  Not same BB?
-      ++PI == BB->pred_end() && !BB->hasConstantPoolReferences()) {
+      ++PI == BB->pred_end() && !BB->hasConstantReferences()) {
     BasicBlock *Pred = *BB->pred_begin();
     TerminatorInst *Term = Pred->getTerminator();
     assert(Term != 0 && "malformed basic block without terminator!");
diff --git a/lib/Transforms/Scalar/InductionVars.cpp b/lib/Transforms/Scalar/InductionVars.cpp
index 7dfae48..d4b7bc5 100644
--- a/lib/Transforms/Scalar/InductionVars.cpp
+++ b/lib/Transforms/Scalar/InductionVars.cpp
@@ -20,7 +20,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/Optimizations/InductionVars.h"
-#include "llvm/ConstPoolVals.h"
+#include "llvm/ConstantVals.h"
 #include "llvm/Analysis/IntervalPartition.h"
 #include "llvm/Assembly/Writer.h"
 #include "llvm/SymbolTable.h"
@@ -36,7 +36,7 @@
 // an interval invariant computation.
 //
 static bool isLoopInvariant(cfg::Interval *Int, Value *V) {
-  assert(isa<ConstPoolVal>(V) || isa<Instruction>(V) || isa<MethodArgument>(V));
+  assert(isa<Constant>(V) || isa<Instruction>(V) || isa<MethodArgument>(V));
 
   if (!isa<Instruction>(V))
     return true;  // Constants and arguments are always loop invariant
@@ -132,12 +132,12 @@
 static inline bool isSimpleInductionVar(PHINode *PN) {
   assert(PN->getNumIncomingValues() == 2 && "Must have cannonical PHI node!");
   Value *Initializer = PN->getIncomingValue(0);
-  if (!isa<ConstPoolVal>(Initializer)) return false;
+  if (!isa<Constant>(Initializer)) return false;
 
   if (Initializer->getType()->isSigned()) {  // Signed constant value...
-    if (((ConstPoolSInt*)Initializer)->getValue() != 0) return false;
+    if (((ConstantSInt*)Initializer)->getValue() != 0) return false;
   } else if (Initializer->getType()->isUnsigned()) {  // Unsigned constant value
-    if (((ConstPoolUInt*)Initializer)->getValue() != 0) return false;
+    if (((ConstantUInt*)Initializer)->getValue() != 0) return false;
   } else {
     return false;   // Not signed or unsigned?  Must be FP type or something
   }
@@ -153,12 +153,12 @@
 
   // Get the right hand side of the ADD node.  See if it is a constant 1.
   Value *StepSize = I->getOperand(1);
-  if (!isa<ConstPoolVal>(StepSize)) return false;
+  if (!isa<Constant>(StepSize)) return false;
 
   if (StepSize->getType()->isSigned()) {  // Signed constant value...
-    if (((ConstPoolSInt*)StepSize)->getValue() != 1) return false;
+    if (((ConstantSInt*)StepSize)->getValue() != 1) return false;
   } else if (StepSize->getType()->isUnsigned()) {  // Unsigned constant value
-    if (((ConstPoolUInt*)StepSize)->getValue() != 1) return false;
+    if (((ConstantUInt*)StepSize)->getValue() != 1) return false;
   } else {
     return false;   // Not signed or unsigned?  Must be FP type or something
   }
@@ -189,8 +189,8 @@
 
   // Create the neccesary instructions...
   PHINode        *PN      = new PHINode(Type::UIntTy, PHIName);
-  ConstPoolVal   *One     = ConstPoolUInt::get(Type::UIntTy, 1);
-  ConstPoolVal   *Zero    = ConstPoolUInt::get(Type::UIntTy, 0);
+  Constant       *One     = ConstantUInt::get(Type::UIntTy, 1);
+  Constant       *Zero    = ConstantUInt::get(Type::UIntTy, 0);
   BinaryOperator *AddNode = BinaryOperator::create(Instruction::Add, 
 						   PN, One, AddName);
 
diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp
index 3c699c1..26a52d6 100644
--- a/lib/Transforms/Scalar/SCCP.cpp
+++ b/lib/Transforms/Scalar/SCCP.cpp
@@ -19,7 +19,7 @@
 #include "llvm/Optimizations/ConstantHandling.h"
 #include "llvm/Method.h"
 #include "llvm/BasicBlock.h"
-#include "llvm/ConstPoolVals.h"
+#include "llvm/ConstantVals.h"
 #include "llvm/InstrTypes.h"
 #include "llvm/iPHINode.h"
 #include "llvm/iMemory.h"
@@ -38,28 +38,28 @@
 //
 class InstVal {
   enum { 
-    Undefined,           // This instruction has no known value
-    Constant,            // This instruction has a constant value
+    undefined,           // This instruction has no known value
+    constant,            // This instruction has a constant value
     // Range,            // This instruction is known to fall within a range
-    Overdefined          // This instruction has an unknown value
-  } LatticeValue;    // The current lattice position
-  ConstPoolVal *ConstantVal;     // If Constant value, the current value
+    overdefined          // This instruction has an unknown value
+  } LatticeValue;        // The current lattice position
+  Constant *ConstantVal; // If Constant value, the current value
 public:
-  inline InstVal() : LatticeValue(Undefined), ConstantVal(0) {}
+  inline InstVal() : LatticeValue(undefined), ConstantVal(0) {}
 
   // markOverdefined - Return true if this is a new status to be in...
   inline bool markOverdefined() {
-    if (LatticeValue != Overdefined) {
-      LatticeValue = Overdefined;
+    if (LatticeValue != overdefined) {
+      LatticeValue = overdefined;
       return true;
     }
     return false;
   }
 
   // markConstant - Return true if this is a new status for us...
-  inline bool markConstant(ConstPoolVal *V) {
-    if (LatticeValue != Constant) {
-      LatticeValue = Constant;
+  inline bool markConstant(Constant *V) {
+    if (LatticeValue != constant) {
+      LatticeValue = constant;
       ConstantVal = V;
       return true;
     } else {
@@ -68,11 +68,11 @@
     return false;
   }
 
-  inline bool isUndefined()   const { return LatticeValue == Undefined; }
-  inline bool isConstant()    const { return LatticeValue == Constant; }
-  inline bool isOverdefined() const { return LatticeValue == Overdefined; }
+  inline bool isUndefined()   const { return LatticeValue == undefined; }
+  inline bool isConstant()    const { return LatticeValue == constant; }
+  inline bool isOverdefined() const { return LatticeValue == overdefined; }
 
-  inline ConstPoolVal *getConstant() const { return ConstantVal; }
+  inline Constant *getConstant() const { return ConstantVal; }
 };
 
 
@@ -113,7 +113,7 @@
   // is not already a constant, add it to the instruction work list so that 
   // the users of the instruction are updated later.
   //
-  inline bool markConstant(Instruction *I, ConstPoolVal *V) {
+  inline bool markConstant(Instruction *I, Constant *V) {
     //cerr << "markConstant: " << V << " = " << I;
     if (ValueState[I].markConstant(V)) {
       InstWorkList.push_back(I);
@@ -147,7 +147,7 @@
     map<Value*, InstVal>::iterator I = ValueState.find(V);
     if (I != ValueState.end()) return I->second;  // Common case, in the map
       
-    if (ConstPoolVal *CPV = dyn_cast<ConstPoolVal>(V)) {//Constants are constant
+    if (Constant *CPV = dyn_cast<Constant>(V)) {  // Constants are constant
       ValueState[CPV].markConstant(CPV);
     } else if (isa<MethodArgument>(V)) {          // MethodArgs are overdefined
       ValueState[V].markOverdefined();
@@ -246,7 +246,7 @@
     Instruction *Inst = *II;
     InstVal &IV = ValueState[Inst];
     if (IV.isConstant()) {
-      ConstPoolVal *Const = IV.getConstant();
+      Constant *Const = IV.getConstant();
       // cerr << "Constant: " << Inst << "  is: " << Const;
 
       // Replaces all of the uses of a variable with uses of the constant.
@@ -393,7 +393,7 @@
       markExecutable(BI->getSuccessor(1));
     } else if (BCValue.isConstant()) {
       // Constant condition variables mean the branch can only go a single way.
-      ConstPoolBool *CPB = cast<ConstPoolBool>(BCValue.getConstant());
+      ConstantBool *CPB = cast<ConstantBool>(BCValue.getConstant());
       if (CPB->getValue())       // If the branch condition is TRUE...
         markExecutable(BI->getSuccessor(0));
       else                       // Else if the br cond is FALSE...
@@ -409,7 +409,7 @@
       for(unsigned i = 0; BasicBlock *Succ = SI->getSuccessor(i); ++i)
         markExecutable(Succ);
     } else if (SCValue.isConstant()) {
-      ConstPoolVal *CPV = SCValue.getConstant();
+      Constant *CPV = SCValue.getConstant();
       // Make sure to skip the "default value" which isn't a value
       for (unsigned i = 1, E = SI->getNumSuccessors(); i != E; ++i) {
         if (SI->getSuccessorValue(i) == CPV) {// Found the right branch...
@@ -443,7 +443,7 @@
     if (VState.isOverdefined()) {        // Inherit overdefinedness of operand
       markOverdefined(I);
     } else if (VState.isConstant()) {    // Propogate constant value
-      ConstPoolVal *Result = isa<CastInst>(I)
+      Constant *Result = isa<CastInst>(I)
         ? opt::ConstantFoldCastInstruction(VState.getConstant(), I->getType())
         : opt::ConstantFoldUnaryInstruction(I->getOpcode(),
                                             VState.getConstant());
@@ -470,7 +470,7 @@
     if (V1State.isOverdefined() || V2State.isOverdefined()) {
       markOverdefined(I);
     } else if (V1State.isConstant() && V2State.isConstant()) {
-      ConstPoolVal *Result =
+      Constant *Result =
         opt::ConstantFoldBinaryInstruction(I->getOpcode(),
                                              V1State.getConstant(),
                                              V2State.getConstant());
diff --git a/lib/Transforms/Scalar/SymbolStripping.cpp b/lib/Transforms/Scalar/SymbolStripping.cpp
index 06cf025..bb4f01c 100644
--- a/lib/Transforms/Scalar/SymbolStripping.cpp
+++ b/lib/Transforms/Scalar/SymbolStripping.cpp
@@ -29,7 +29,7 @@
     SymbolTable::type_iterator B;
     while ((B = Plane.begin()) != Plane.end()) {   // Found nonempty type plane!
       Value *V = B->second;
-      if (isa<ConstPoolVal>(V) || isa<Type>(V))
+      if (isa<Constant>(V) || isa<Type>(V))
 	SymTab->type_remove(B);
       else 
 	V->setName("", SymTab);   // Set name to "", removing from symbol table!
diff --git a/lib/Transforms/TransformInternals.cpp b/lib/Transforms/TransformInternals.cpp
index dbe5ea9..5fdffda 100644
--- a/lib/Transforms/TransformInternals.cpp
+++ b/lib/Transforms/TransformInternals.cpp
@@ -8,7 +8,7 @@
 #include "TransformInternals.h"
 #include "llvm/Method.h"
 #include "llvm/Type.h"
-#include "llvm/ConstPoolVals.h"
+#include "llvm/ConstantVals.h"
 #include "llvm/Analysis/Expressions.h"
 #include "llvm/iOther.h"
 
@@ -96,7 +96,7 @@
            (i == SL->MemberOffsets.size()-1 || Offset <SL->MemberOffsets[i+1]));
     
     // Make sure to save the current index...
-    Offsets.push_back(ConstPoolUInt::get(Type::UByteTy, i));
+    Offsets.push_back(ConstantUInt::get(Type::UByteTy, i));
     ThisOffset = SL->MemberOffsets[i];
     NextType = STy->getElementTypes()[i];
   } else {
@@ -106,7 +106,7 @@
 
     NextType = ATy->getElementType();
     unsigned ChildSize = TD.getTypeSize(NextType);
-    Offsets.push_back(ConstPoolUInt::get(Type::UIntTy, Offset/ChildSize));
+    Offsets.push_back(ConstantUInt::get(Type::UIntTy, Offset/ChildSize));
     ThisOffset = (Offset/ChildSize)*ChildSize;
   }
 
@@ -183,7 +183,7 @@
       if (Offset >= ElSize) {
         // Calculate the index that we are entering into the array cell with
         unsigned Index = Offset/ElSize;
-        Indices.push_back(ConstPoolUInt::get(Type::UIntTy, Index));
+        Indices.push_back(ConstantUInt::get(Type::UIntTy, Index));
         Offset -= Index*ElSize;               // Consume part of the offset
 
       } else if (Scale && Scale != 1) {
@@ -204,7 +204,7 @@
         // Must be indexing a small amount into the first cell of the array
         // Just index into element zero of the array here.
         //
-        Indices.push_back(ConstPoolUInt::get(Type::UIntTy, 0));
+        Indices.push_back(ConstantUInt::get(Type::UIntTy, 0));
       }
       NextTy = ElTy;
     }
diff --git a/lib/Transforms/TransformInternals.h b/lib/Transforms/TransformInternals.h
index 8edeffc..d3ef47a 100644
--- a/lib/Transforms/TransformInternals.h
+++ b/lib/Transforms/TransformInternals.h
@@ -12,7 +12,7 @@
 #include "llvm/Instruction.h"
 #include "llvm/Target/TargetData.h"
 #include "llvm/DerivedTypes.h"
-#include "llvm/ConstPoolVals.h"
+#include "llvm/ConstantVals.h"
 #include <map>
 #include <set>
 
@@ -24,10 +24,10 @@
 //
 extern const TargetData TD;
 
-static int getConstantValue(const ConstPoolInt *CPI) {
-  if (const ConstPoolSInt *CSI = dyn_cast<ConstPoolSInt>(CPI))
+static int getConstantValue(const ConstantInt *CPI) {
+  if (const ConstantSInt *CSI = dyn_cast<ConstantSInt>(CPI))
     return CSI->getValue();
-  return cast<ConstPoolUInt>(CPI)->getValue();
+  return cast<ConstantUInt>(CPI)->getValue();
 }
 
 
diff --git a/lib/Transforms/Utils/Linker.cpp b/lib/Transforms/Utils/Linker.cpp
index 8be0793..8a02946 100644
--- a/lib/Transforms/Utils/Linker.cpp
+++ b/lib/Transforms/Utils/Linker.cpp
@@ -16,7 +16,7 @@
 #include "llvm/SymbolTable.h"
 #include "llvm/DerivedTypes.h"
 #include "llvm/iOther.h"
-#include "llvm/ConstPoolVals.h"
+#include "llvm/ConstantVals.h"
 
 // Error - Simple wrapper function to conditionally assign to E and return true.
 // This just makes error return conditions a little bit simpler...
@@ -90,31 +90,31 @@
   }
 
   // Check to see if it's a constant that we are interesting in transforming...
-  if (ConstPoolVal *CPV = dyn_cast<ConstPoolVal>(In)) {
+  if (Constant *CPV = dyn_cast<Constant>(In)) {
     if (!isa<DerivedType>(CPV->getType()))
       return CPV;              // Simple constants stay identical...
 
-    ConstPoolVal *Result = 0;
+    Constant *Result = 0;
 
-    if (ConstPoolArray *CPA = dyn_cast<ConstPoolArray>(CPV)) {
+    if (ConstantArray *CPA = dyn_cast<ConstantArray>(CPV)) {
       const vector<Use> &Ops = CPA->getValues();
-      vector<ConstPoolVal*> Operands(Ops.size());
+      vector<Constant*> Operands(Ops.size());
       for (unsigned i = 0; i < Ops.size(); ++i)
         Operands[i] = 
-          cast<ConstPoolVal>(RemapOperand(Ops[i], LocalMap, GlobalMap));
-      Result = ConstPoolArray::get(cast<ArrayType>(CPA->getType()), Operands);
-    } else if (ConstPoolStruct *CPS = dyn_cast<ConstPoolStruct>(CPV)) {
+          cast<Constant>(RemapOperand(Ops[i], LocalMap, GlobalMap));
+      Result = ConstantArray::get(cast<ArrayType>(CPA->getType()), Operands);
+    } else if (ConstantStruct *CPS = dyn_cast<ConstantStruct>(CPV)) {
       const vector<Use> &Ops = CPS->getValues();
-      vector<ConstPoolVal*> Operands(Ops.size());
+      vector<Constant*> Operands(Ops.size());
       for (unsigned i = 0; i < Ops.size(); ++i)
         Operands[i] = 
-          cast<ConstPoolVal>(RemapOperand(Ops[i], LocalMap, GlobalMap));
-      Result = ConstPoolStruct::get(cast<StructType>(CPS->getType()), Operands);
-    } else if (isa<ConstPoolPointerNull>(CPV)) {
+          cast<Constant>(RemapOperand(Ops[i], LocalMap, GlobalMap));
+      Result = ConstantStruct::get(cast<StructType>(CPS->getType()), Operands);
+    } else if (isa<ConstantPointerNull>(CPV)) {
       Result = CPV;
-    } else if (ConstPoolPointerRef *CPR = dyn_cast<ConstPoolPointerRef>(CPV)) {
+    } else if (ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(CPV)) {
       Value *V = RemapOperand(CPR->getValue(), LocalMap, GlobalMap);
-      Result = ConstPoolPointerRef::get(cast<GlobalValue>(V));
+      Result = ConstantPointerRef::get(cast<GlobalValue>(V));
     } else {
       assert(0 && "Unknown type of derived type constant value!");
     }
@@ -207,8 +207,8 @@
 
     if (SGV->hasInitializer()) {      // Only process initialized GV's
       // Figure out what the initializer looks like in the dest module...
-      ConstPoolVal *DInit =
-        cast<ConstPoolVal>(RemapOperand(SGV->getInitializer(), ValueMap));
+      Constant *DInit =
+        cast<Constant>(RemapOperand(SGV->getInitializer(), ValueMap));
 
       GlobalVariable *DGV = cast<GlobalVariable>(ValueMap[SGV]);    
       if (DGV->hasInitializer() && SGV->hasExternalLinkage() &&
diff --git a/lib/Transforms/Utils/LowerAllocations.cpp b/lib/Transforms/Utils/LowerAllocations.cpp
index 2385fee..ceb45f5 100644
--- a/lib/Transforms/Utils/LowerAllocations.cpp
+++ b/lib/Transforms/Utils/LowerAllocations.cpp
@@ -13,7 +13,7 @@
 #include "llvm/iMemory.h"
 #include "llvm/iOther.h"
 #include "llvm/SymbolTable.h"
-#include "llvm/ConstPoolVals.h"
+#include "llvm/ConstantVals.h"
 
 // doPassInitialization - For the lower allocations pass, this ensures that a
 // module contains a declaration for a malloc and a free function.
@@ -80,7 +80,7 @@
         unsigned Size = DataLayout.getTypeSize(AllocTy);
 
         // malloc(type) becomes sbyte *malloc(constint)
-        Value *MallocArg = ConstPoolUInt::get(Type::UIntTy, Size);
+        Value *MallocArg = ConstantUInt::get(Type::UIntTy, Size);
         if (MI->getNumOperands() && Size == 1) {
           MallocArg = MI->getOperand(0);         // Operand * 1 = Operand
         } else if (MI->getNumOperands()) {