Renamed inst_const_iterator -> const_inst_iterator
Renamed op_const_iterator   -> const_op_iterator
Renamed PointerType::getValueType() -> PointerType::getElementType()


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1408 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/IPA/CallGraph.cpp b/lib/Analysis/IPA/CallGraph.cpp
index 47dbde7..d77064c 100644
--- a/lib/Analysis/IPA/CallGraph.cpp
+++ b/lib/Analysis/IPA/CallGraph.cpp
@@ -130,7 +130,7 @@
     return (cgn->begin() == cgn->end());
   }
 
-  for (Method::inst_const_iterator I = M->inst_begin(), E = M->inst_end();
+  for (Method::const_inst_iterator I = M->inst_begin(), E = M->inst_end();
        I != E; ++I)
     if ((*I)->getOpcode() == Instruction::Call)
       return false;
diff --git a/lib/Analysis/IPA/FindUnsafePointerTypes.cpp b/lib/Analysis/IPA/FindUnsafePointerTypes.cpp
index 8527637..50fb8ea 100644
--- a/lib/Analysis/IPA/FindUnsafePointerTypes.cpp
+++ b/lib/Analysis/IPA/FindUnsafePointerTypes.cpp
@@ -51,7 +51,7 @@
 //
 bool FindUnsafePointerTypes::doPerMethodWork(Method *Meth) {
   const Method *M = Meth;  // We don't need/want write access
-  for (Method::inst_const_iterator I = M->inst_begin(), E = M->inst_end();
+  for (Method::const_inst_iterator I = M->inst_begin(), E = M->inst_end();
        I != E; ++I) {
     const Instruction *Inst = *I;
     const Type *ITy = Inst->getType();
diff --git a/lib/Analysis/IPA/FindUsedTypes.cpp b/lib/Analysis/IPA/FindUsedTypes.cpp
index db5a534..6f8049a 100644
--- a/lib/Analysis/IPA/FindUsedTypes.cpp
+++ b/lib/Analysis/IPA/FindUsedTypes.cpp
@@ -59,13 +59,13 @@
   // Loop over all of the instructions in the method, adding their return type
   // as well as the types of their operands.
   //
-  for (Method::inst_const_iterator II = M->inst_begin(), IE = M->inst_end();
+  for (Method::const_inst_iterator II = M->inst_begin(), IE = M->inst_end();
        II != IE; ++II) {
     const Instruction *I = *II;
     const Type *Ty = I->getType();
     
     IncorporateType(Ty);  // Incorporate the type of the instruction
-    for (User::op_const_iterator OI = I->op_begin(), OE = I->op_end();
+    for (User::const_op_iterator OI = I->op_begin(), OE = I->op_end();
          OI != OE; ++OI)
       if ((*OI)->getType() != Ty)          // Avoid set lookup in common case
         IncorporateType((*OI)->getType()); // Insert inst operand types as well
diff --git a/lib/Analysis/LiveVar/BBLiveVar.cpp b/lib/Analysis/LiveVar/BBLiveVar.cpp
index 09beb12..3f5d95d 100644
--- a/lib/Analysis/LiveVar/BBLiveVar.cpp
+++ b/lib/Analysis/LiveVar/BBLiveVar.cpp
@@ -39,7 +39,7 @@
     }
 
     // iterate over  MI operands to find defs
-    for( MachineInstr::val_op_const_iterator OpI(MInst); !OpI.done() ; ++OpI) {
+    for( MachineInstr::val_const_op_iterator OpI(MInst); !OpI.done() ; ++OpI) {
 
       if( OpI.isDef() )      // add to Defs only if this operand is a def
 	addDef( *OpI );
@@ -56,7 +56,7 @@
 
  
     // iterate over  MI operands to find uses
-    for(MachineInstr::val_op_const_iterator OpI(MInst); !OpI.done() ;  ++OpI) {
+    for (MachineInstr::val_const_op_iterator OpI(MInst); !OpI.done() ;  ++OpI) {
       const Value *Op = *OpI;
 
       if ( ((Op)->getType())->isLabelType() )    
diff --git a/lib/Analysis/LiveVar/LiveVarSet.cpp b/lib/Analysis/LiveVar/LiveVarSet.cpp
index 1ca65f0..bcc9de9 100644
--- a/lib/Analysis/LiveVar/LiveVarSet.cpp
+++ b/lib/Analysis/LiveVar/LiveVarSet.cpp
@@ -12,7 +12,7 @@
 void LiveVarSet::applyTranferFuncForMInst(const MachineInstr *const MInst)
 {
 
-  for( MachineInstr::val_op_const_iterator OpI(MInst); !OpI.done() ; OpI++) {
+  for( MachineInstr::val_const_op_iterator OpI(MInst); !OpI.done() ; OpI++) {
 
     if( OpI.isDef() )      // kill only if this operand is a def
          remove(*OpI);        // this definition kills any uses
@@ -25,7 +25,7 @@
   }
 
 
-  for( MachineInstr::val_op_const_iterator OpI(MInst); !OpI.done() ; OpI++) {
+  for( MachineInstr::val_const_op_iterator OpI(MInst); !OpI.done() ; OpI++) {
 
     if ( ((*OpI)->getType())->isLabelType()) continue; // don't process labels
     
@@ -50,7 +50,7 @@
   if( Inst->isDefinition() ) {  // add to Defs iff this instr is a definition
        remove(Inst);            // this definition kills any uses
   }
-  Instruction::op_const_iterator OpI = Inst->op_begin();  // get operand iterat
+  Instruction::const_op_iterator OpI = Inst->op_begin();  // get operand iterat
 
   for( ; OpI != Inst->op_end() ; OpI++) {              // iterate over operands
     if ( ((*OpI)->getType())->isLabelType()) continue; // don't process labels 
diff --git a/lib/Analysis/ModuleAnalyzer.cpp b/lib/Analysis/ModuleAnalyzer.cpp
index 583378c..129fb3b 100644
--- a/lib/Analysis/ModuleAnalyzer.cpp
+++ b/lib/Analysis/ModuleAnalyzer.cpp
@@ -54,7 +54,7 @@
   }
 
   case Type::PointerTyID:
-    if (handleType(TypeSet, ((const PointerType *)T)->getValueType()))
+    if (handleType(TypeSet, cast<const PointerType>(T)->getElementType()))
       return true;
     break;
 
diff --git a/lib/AsmParser/ParserInternals.h b/lib/AsmParser/ParserInternals.h
index b05bb0d..750833f 100644
--- a/lib/AsmParser/ParserInternals.h
+++ b/lib/AsmParser/ParserInternals.h
@@ -184,8 +184,8 @@
 static inline ValID &getValIDFromPlaceHolder(const Value *Val) {
   const Type *Ty = Val->getType();
   if (isa<PointerType>(Ty) &&
-      isa<MethodType>(cast<PointerType>(Ty)->getValueType()))
-    Ty = cast<PointerType>(Ty)->getValueType();
+      isa<MethodType>(cast<PointerType>(Ty)->getElementType()))
+    Ty = cast<PointerType>(Ty)->getElementType();
 
   switch (Ty->getPrimitiveID()) {
   case Type::LabelTyID:  return ((BBPlaceHolder*)Val)->getDef();
@@ -196,8 +196,8 @@
 static inline int getLineNumFromPlaceHolder(const Value *Val) {
   const Type *Ty = Val->getType();
   if (isa<PointerType>(Ty) &&
-      isa<MethodType>(cast<PointerType>(Ty)->getValueType()))
-    Ty = cast<PointerType>(Ty)->getValueType();
+      isa<MethodType>(cast<PointerType>(Ty)->getElementType()))
+    Ty = cast<PointerType>(Ty)->getElementType();
 
   switch (Ty->getPrimitiveID()) {
   case Type::LabelTyID:  return ((BBPlaceHolder*)Val)->getLineNum();
diff --git a/lib/AsmParser/llvmAsmParser.y b/lib/AsmParser/llvmAsmParser.y
index acc3cfd..28e9fae 100644
--- a/lib/AsmParser/llvmAsmParser.y
+++ b/lib/AsmParser/llvmAsmParser.y
@@ -983,7 +983,8 @@
 	// TODO: GlobalVariable here that includes the said information!
 	
 	// Create a placeholder for the global variable reference...
-	GlobalVariable *GV = new GlobalVariable(PT->getValueType(), false,true);
+	GlobalVariable *GV = new GlobalVariable(PT->getElementType(),
+                                                false, true);
 	// Keep track of the fact that we have a forward ref to recycle it
 	CurModule.GlobalRefs.insert(make_pair(make_pair(PT, $2), GV));
 
@@ -1351,7 +1352,7 @@
     const MethodType *Ty;
 
     if (!(PMTy = dyn_cast<PointerType>($2->get())) ||
-        !(Ty = dyn_cast<MethodType>(PMTy->getValueType()))) {
+        !(Ty = dyn_cast<MethodType>(PMTy->getElementType()))) {
       // Pull out the types of all of the arguments...
       vector<const Type*> ParamTypes;
       if ($5) {
@@ -1487,7 +1488,7 @@
     const MethodType *Ty;
 
     if (!(PMTy = dyn_cast<PointerType>($2->get())) ||
-        !(Ty = dyn_cast<MethodType>(PMTy->getValueType()))) {
+        !(Ty = dyn_cast<MethodType>(PMTy->getElementType()))) {
       // Pull out the types of all of the arguments...
       vector<const Type*> ParamTypes;
       if ($5) {
diff --git a/lib/Bytecode/Reader/ConstantReader.cpp b/lib/Bytecode/Reader/ConstantReader.cpp
index ddeeba3..671afd2 100644
--- a/lib/Bytecode/Reader/ConstantReader.cpp
+++ b/lib/Bytecode/Reader/ConstantReader.cpp
@@ -305,7 +305,7 @@
 
 	  // Create a placeholder for the global variable reference...
 	  GlobalVariable *GVar =
-	    new GlobalVariable(PT->getValueType(), false, true);
+	    new GlobalVariable(PT->getElementType(), false, true);
 
 	  // Keep track of the fact that we have a forward ref to recycle it
 	  GlobalRefs.insert(make_pair(make_pair(PT, Slot), GVar));
diff --git a/lib/Bytecode/Reader/InstructionReader.cpp b/lib/Bytecode/Reader/InstructionReader.cpp
index 5645e68..47d9e82 100644
--- a/lib/Bytecode/Reader/InstructionReader.cpp
+++ b/lib/Bytecode/Reader/InstructionReader.cpp
@@ -227,7 +227,7 @@
     // Check to make sure we have a pointer to method type
     PointerType *PTy = dyn_cast<PointerType>(M->getType());
     if (PTy == 0) return failure(true);
-    MethodType *MTy = dyn_cast<MethodType>(PTy->getValueType());
+    MethodType *MTy = dyn_cast<MethodType>(PTy->getElementType());
     if (MTy == 0) return failure(true);
 
     vector<Value *> Params;
@@ -287,7 +287,7 @@
     // Check to make sure we have a pointer to method type
     PointerType *PTy = dyn_cast<PointerType>(M->getType());
     if (PTy == 0) return failure(true);
-    MethodType *MTy = dyn_cast<MethodType>(PTy->getValueType());
+    MethodType *MTy = dyn_cast<MethodType>(PTy->getElementType());
     if (MTy == 0) return failure(true);
 
     vector<Value *> Params;
@@ -351,7 +351,7 @@
     vector<Value*> Idx;
     if (!isa<PointerType>(Raw.Ty)) return failure(true);
     const CompositeType *TopTy =
-      dyn_cast<CompositeType>(cast<PointerType>(Raw.Ty)->getValueType());
+      dyn_cast<CompositeType>(cast<PointerType>(Raw.Ty)->getElementType());
 
     switch (Raw.NumOperands) {
     case 0: cerr << "Invalid load encountered!\n"; return failure(true);
@@ -405,7 +405,7 @@
     vector<Value*> Idx;
     if (!isa<PointerType>(Raw.Ty)) return failure(true);
     const CompositeType *TopTy =
-      dyn_cast<CompositeType>(cast<PointerType>(Raw.Ty)->getValueType());
+      dyn_cast<CompositeType>(cast<PointerType>(Raw.Ty)->getElementType());
 
     switch (Raw.NumOperands) {
     case 0: 
diff --git a/lib/Bytecode/Reader/Reader.cpp b/lib/Bytecode/Reader/Reader.cpp
index 84fcd8d..c8be368 100644
--- a/lib/Bytecode/Reader/Reader.cpp
+++ b/lib/Bytecode/Reader/Reader.cpp
@@ -262,7 +262,7 @@
   }
 
   const PointerType *PMTy = MethodSignatureList.front().first; // PtrMeth
-  const MethodType  *MTy  = dyn_cast<const MethodType>(PMTy->getValueType());
+  const MethodType  *MTy  = dyn_cast<const MethodType>(PMTy->getElementType());
   if (MTy == 0) return failure(true);  // Not ptr to method!
 
   unsigned isInternal;
@@ -392,7 +392,7 @@
     }
 
     const PointerType *PTy = cast<const PointerType>(Ty);
-    const Type *ElTy = PTy->getValueType();
+    const Type *ElTy = PTy->getElementType();
 
     Constant *Initializer = 0;
     if (VarType & 2) { // Does it have an initalizer?
@@ -430,13 +430,13 @@
   while (MethSignature != Type::VoidTyID) { // List is terminated by Void
     const Type *Ty = getType(MethSignature);
     if (!Ty || !isa<PointerType>(Ty) ||
-        !isa<MethodType>(cast<PointerType>(Ty)->getValueType())) { 
+        !isa<MethodType>(cast<PointerType>(Ty)->getElementType())) { 
       Error = "Method not ptr to meth type!  Ty = " + Ty->getDescription();
       return failure(true); 
     }
     
     // We create methods by passing the underlying MethodType to create...
-    Ty = cast<PointerType>(Ty)->getValueType();
+    Ty = cast<PointerType>(Ty)->getElementType();
 
     // When the ModuleGlobalInfo section is read, we load the type of each 
     // method and the 'ModuleValues' slot that it lands in.  We then load a 
diff --git a/lib/Bytecode/Writer/ConstantWriter.cpp b/lib/Bytecode/Writer/ConstantWriter.cpp
index 835ef98..0700a2e 100644
--- a/lib/Bytecode/Writer/ConstantWriter.cpp
+++ b/lib/Bytecode/Writer/ConstantWriter.cpp
@@ -74,7 +74,7 @@
 
   case Type::PointerTyID: {
     const PointerType *PT = cast<const PointerType>(T);
-    int Slot = Table.getValSlot(PT->getValueType());
+    int Slot = Table.getValSlot(PT->getElementType());
     assert(Slot != -1 && "Type used but not available!!");
     output_vbr((unsigned)Slot, Out);
     break;
diff --git a/lib/Bytecode/Writer/InstructionWriter.cpp b/lib/Bytecode/Writer/InstructionWriter.cpp
index 5445910..825fde6 100644
--- a/lib/Bytecode/Writer/InstructionWriter.cpp
+++ b/lib/Bytecode/Writer/InstructionWriter.cpp
@@ -226,13 +226,13 @@
     NumOperands++;
   } else if (const CallInst *CI = dyn_cast<CallInst>(I)) {// Handle VarArg calls
     PointerType *Ty = cast<PointerType>(CI->getCalledValue()->getType());
-    if (cast<MethodType>(Ty->getValueType())->isVarArg()) {
+    if (cast<MethodType>(Ty->getElementType())->isVarArg()) {
       outputInstrVarArgsCall(I, Table, Type, Out);
       return;
     }
   } else if (const InvokeInst *II = dyn_cast<InvokeInst>(I)) { // ...  & Invokes
     PointerType *Ty = cast<PointerType>(II->getCalledValue()->getType());
-    if (cast<MethodType>(Ty->getValueType())->isVarArg()) {
+    if (cast<MethodType>(Ty->getElementType())->isVarArg()) {
       outputInstrVarArgsCall(I, Table, Type, Out);
       return;
     }
diff --git a/lib/Bytecode/Writer/SlotCalculator.cpp b/lib/Bytecode/Writer/SlotCalculator.cpp
index 9c5d97a..ede8228 100644
--- a/lib/Bytecode/Writer/SlotCalculator.cpp
+++ b/lib/Bytecode/Writer/SlotCalculator.cpp
@@ -237,7 +237,7 @@
     // of const ints), that they are inserted also.  Same for global variable
     // initializers.
     //
-    for(User::op_const_iterator I = U->op_begin(), E = U->op_end(); I != E; ++I)
+    for(User::const_op_iterator I = U->op_begin(), E = U->op_end(); I != E; ++I)
       if (!isa<GlobalValue>(*I))  // Don't chain insert global values
 	insertValue(*I);
   }
diff --git a/lib/CodeGen/InstrSched/SchedPriorities.cpp b/lib/CodeGen/InstrSched/SchedPriorities.cpp
index acbe552..1769707 100644
--- a/lib/CodeGen/InstrSched/SchedPriorities.cpp
+++ b/lib/CodeGen/InstrSched/SchedPriorities.cpp
@@ -268,7 +268,7 @@
   const LiveVarSet* liveVars =
     methodLiveVarInfo.getLiveVarSetBeforeMInst(minstr, bb);
   
-  for (MachineInstr::val_op_const_iterator vo(minstr); ! vo.done(); ++vo)
+  for (MachineInstr::val_const_op_iterator vo(minstr); ! vo.done(); ++vo)
     if (liveVars->find(*vo) == liveVars->end())
       {
 	hasLastUse = true;
diff --git a/lib/CodeGen/InstrSelection/InstrSelection.cpp b/lib/CodeGen/InstrSelection/InstrSelection.cpp
index d0a301c..b959c90 100644
--- a/lib/CodeGen/InstrSelection/InstrSelection.cpp
+++ b/lib/CodeGen/InstrSelection/InstrSelection.cpp
@@ -250,8 +250,7 @@
 
 	PHINode *PN = (PHINode *) (*IIt);
 
-	Value *PhiCpRes = 
-	  new Value(PN->getType(), PN->getValueType() );
+	Value *PhiCpRes = new Value(PN->getType(), PN->getValueType());
 
 	string *Name = new string("PhiCp:");
 	(*Name) += (int) PhiCpRes;
diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp
index de77f6a..5832b8e 100644
--- a/lib/CodeGen/MachineInstr.cpp
+++ b/lib/CodeGen/MachineInstr.cpp
@@ -102,7 +102,7 @@
 #undef DEBUG_VAL_OP_ITERATOR
 #ifdef DEBUG_VAL_OP_ITERATOR
   os << endl << "\tValue operands are: ";
-  for (MachineInstr::val_op_const_iterator vo(&minstr); ! vo.done(); ++vo)
+  for (MachineInstr::val_const_op_iterator vo(&minstr); ! vo.done(); ++vo)
     {
       const Value* val = *vo;
       os << val << (vo.isDef()? "(def), " : ", ");
@@ -218,7 +218,7 @@
   
   unsigned int maxSize = 0;
   
-  for (Method::inst_const_iterator I=method->inst_begin(),E=method->inst_end();
+  for (Method::const_inst_iterator I=method->inst_begin(),E=method->inst_end();
        I != E; ++I)
     if ((*I)->getOpcode() == Instruction::Call)
       {
diff --git a/lib/CodeGen/RegAlloc/LiveRangeInfo.cpp b/lib/CodeGen/RegAlloc/LiveRangeInfo.cpp
index c072275..00385d9 100644
--- a/lib/CodeGen/RegAlloc/LiveRangeInfo.cpp
+++ b/lib/CodeGen/RegAlloc/LiveRangeInfo.cpp
@@ -122,7 +122,7 @@
  
              
       // iterate over  MI operands to find defs
-      for( MachineInstr::val_op_const_iterator OpI(MInst);!OpI.done(); ++OpI) {
+      for( MachineInstr::val_const_op_iterator OpI(MInst);!OpI.done(); ++OpI) {
 	
 	if( DEBUG_RA) {
 	  MachineOperand::MachineOperandType OpTyp = 
@@ -286,7 +286,7 @@
 
 
       // iterate over  MI operands to find defs
-      for(MachineInstr::val_op_const_iterator DefI(MInst);!DefI.done();++DefI){
+      for(MachineInstr::val_const_op_iterator DefI(MInst);!DefI.done();++DefI){
 	
 	if( DefI.isDef() ) {            // iff this operand is a def
 
@@ -294,7 +294,7 @@
 	  assert( LROfDef );
 	  RegClass *const RCOfDef = LROfDef->getRegClass();
 
-	  MachineInstr::val_op_const_iterator UseI(MInst);
+	  MachineInstr::val_const_op_iterator UseI(MInst);
 	  for( ; !UseI.done(); ++UseI){ // for all uses
 
  	    LiveRange *const LROfUse = getLiveRangeForValue( *UseI );
diff --git a/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp b/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp
index b7ca871..240e8c1 100644
--- a/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp
+++ b/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp
@@ -262,7 +262,7 @@
 
 
       // iterate over  MI operands to find defs
-      for( MachineInstr::val_op_const_iterator OpI(MInst);!OpI.done(); ++OpI) {
+      for( MachineInstr::val_const_op_iterator OpI(MInst);!OpI.done(); ++OpI) {
 
        	if( OpI.isDef() ) {     
 	  // create a new LR iff this operand is a def
@@ -318,7 +318,7 @@
   bool setInterf = false;
 
   // iterate over  MI operands to find defs
-  for( MachineInstr::val_op_const_iterator It1(MInst);!It1.done(); ++It1) {
+  for( MachineInstr::val_const_op_iterator It1(MInst);!It1.done(); ++It1) {
     
     const LiveRange *const LROfOp1 = LRI.getLiveRangeForValue( *It1 ); 
 
@@ -327,7 +327,7 @@
 
     //if( !LROfOp1 ) continue;
 
-    MachineInstr::val_op_const_iterator It2 = It1;
+    MachineInstr::val_const_op_iterator It2 = It1;
     ++It2;
 	
     for(  ; !It2.done(); ++It2) {
@@ -429,7 +429,7 @@
       //mcInfo.popAllTempValues(TM);
       // TODO ** : do later
       
-      //for(MachineInstr::val_op_const_iterator OpI(MInst);!OpI.done();++OpI) {
+      //for(MachineInstr::val_const_op_iterator OpI(MInst);!OpI.done();++OpI) {
 
 
       // Now replace set the registers for operands in the machine instruction
@@ -928,7 +928,7 @@
       cout << TargetInstrDescriptors[MInst->getOpCode()].opCodeString;
       
 
-      //for(MachineInstr::val_op_const_iterator OpI(MInst);!OpI.done();++OpI) {
+      //for(MachineInstr::val_const_op_iterator OpI(MInst);!OpI.done();++OpI) {
 
       for(unsigned OpNum=0; OpNum < MInst->getNumOperands(); ++OpNum) {
 
diff --git a/lib/ExecutionEngine/Interpreter/Execution.cpp b/lib/ExecutionEngine/Interpreter/Execution.cpp
index 8378a20..5051bc7 100644
--- a/lib/ExecutionEngine/Interpreter/Execution.cpp
+++ b/lib/ExecutionEngine/Interpreter/Execution.cpp
@@ -237,7 +237,7 @@
   GlobalVariable *GV = cast<GlobalVariable>(GVal);
   
   // First off, we must allocate space for the global variable to point at...
-  const Type *Ty = GV->getType()->getValueType();  // Type to be allocated
+  const Type *Ty = GV->getType()->getElementType();  // Type to be allocated
   unsigned NumElements = 1;
 
   if (isa<ArrayType>(Ty) && cast<ArrayType>(Ty)->isUnsized()) {
@@ -728,7 +728,7 @@
 //===----------------------------------------------------------------------===//
 
 void Interpreter::executeAllocInst(AllocationInst *I, ExecutionContext &SF) {
-  const Type *Ty = I->getType()->getValueType();  // Type to be allocated
+  const Type *Ty = I->getType()->getElementType();  // Type to be allocated
   unsigned NumElements = 1;
 
   if (I->getNumOperands()) {   // Allocating a unsized array type?
@@ -771,7 +771,7 @@
 
   PointerTy Total = 0;
   const Type *Ty =
-    cast<PointerType>(I->getPointerOperand()->getType())->getValueType();
+    cast<PointerType>(I->getPointerOperand()->getType())->getElementType();
   
   unsigned ArgOff = I->getFirstIndexOperandNumber();
   while (ArgOff < I->getNumOperands()) {
diff --git a/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp b/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
index 04a73e8..4af07ad 100644
--- a/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
+++ b/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
@@ -130,8 +130,8 @@
 
   // Specialize print([ubyte {x N} ] *) and print(sbyte *)
   if (PointerType *PTy = dyn_cast<PointerType>(M->getParamTypes()[0].get()))
-    if (PTy->getValueType() == Type::SByteTy ||
-        isa<ArrayType>(PTy->getValueType())) {
+    if (PTy->getElementType() == Type::SByteTy ||
+        isa<ArrayType>(PTy->getElementType())) {
       return lle_VP_printstr(M, ArgVal);
     }
 
diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp
index 8a02946..f04c8a4 100644
--- a/lib/Linker/LinkModules.cpp
+++ b/lib/Linker/LinkModules.cpp
@@ -179,7 +179,7 @@
       // later by LinkGlobalInits...
       //
       GlobalVariable *DGV = 
-        new GlobalVariable(SGV->getType()->getValueType(), SGV->isConstant(),
+        new GlobalVariable(SGV->getType()->getElementType(), SGV->isConstant(),
                            SGV->hasInternalLinkage(), 0, SGV->getName());
 
       // Add the new global to the dest module
diff --git a/lib/Target/SparcV9/InstrSched/SchedPriorities.cpp b/lib/Target/SparcV9/InstrSched/SchedPriorities.cpp
index acbe552..1769707 100644
--- a/lib/Target/SparcV9/InstrSched/SchedPriorities.cpp
+++ b/lib/Target/SparcV9/InstrSched/SchedPriorities.cpp
@@ -268,7 +268,7 @@
   const LiveVarSet* liveVars =
     methodLiveVarInfo.getLiveVarSetBeforeMInst(minstr, bb);
   
-  for (MachineInstr::val_op_const_iterator vo(minstr); ! vo.done(); ++vo)
+  for (MachineInstr::val_const_op_iterator vo(minstr); ! vo.done(); ++vo)
     if (liveVars->find(*vo) == liveVars->end())
       {
 	hasLastUse = true;
diff --git a/lib/Target/SparcV9/InstrSelection/InstrSelection.cpp b/lib/Target/SparcV9/InstrSelection/InstrSelection.cpp
index d0a301c..b959c90 100644
--- a/lib/Target/SparcV9/InstrSelection/InstrSelection.cpp
+++ b/lib/Target/SparcV9/InstrSelection/InstrSelection.cpp
@@ -250,8 +250,7 @@
 
 	PHINode *PN = (PHINode *) (*IIt);
 
-	Value *PhiCpRes = 
-	  new Value(PN->getType(), PN->getValueType() );
+	Value *PhiCpRes = new Value(PN->getType(), PN->getValueType());
 
 	string *Name = new string("PhiCp:");
 	(*Name) += (int) PhiCpRes;
diff --git a/lib/Target/SparcV9/LiveVar/BBLiveVar.cpp b/lib/Target/SparcV9/LiveVar/BBLiveVar.cpp
index 09beb12..3f5d95d 100644
--- a/lib/Target/SparcV9/LiveVar/BBLiveVar.cpp
+++ b/lib/Target/SparcV9/LiveVar/BBLiveVar.cpp
@@ -39,7 +39,7 @@
     }
 
     // iterate over  MI operands to find defs
-    for( MachineInstr::val_op_const_iterator OpI(MInst); !OpI.done() ; ++OpI) {
+    for( MachineInstr::val_const_op_iterator OpI(MInst); !OpI.done() ; ++OpI) {
 
       if( OpI.isDef() )      // add to Defs only if this operand is a def
 	addDef( *OpI );
@@ -56,7 +56,7 @@
 
  
     // iterate over  MI operands to find uses
-    for(MachineInstr::val_op_const_iterator OpI(MInst); !OpI.done() ;  ++OpI) {
+    for (MachineInstr::val_const_op_iterator OpI(MInst); !OpI.done() ;  ++OpI) {
       const Value *Op = *OpI;
 
       if ( ((Op)->getType())->isLabelType() )    
diff --git a/lib/Target/SparcV9/LiveVar/LiveVarSet.cpp b/lib/Target/SparcV9/LiveVar/LiveVarSet.cpp
index 1ca65f0..bcc9de9 100644
--- a/lib/Target/SparcV9/LiveVar/LiveVarSet.cpp
+++ b/lib/Target/SparcV9/LiveVar/LiveVarSet.cpp
@@ -12,7 +12,7 @@
 void LiveVarSet::applyTranferFuncForMInst(const MachineInstr *const MInst)
 {
 
-  for( MachineInstr::val_op_const_iterator OpI(MInst); !OpI.done() ; OpI++) {
+  for( MachineInstr::val_const_op_iterator OpI(MInst); !OpI.done() ; OpI++) {
 
     if( OpI.isDef() )      // kill only if this operand is a def
          remove(*OpI);        // this definition kills any uses
@@ -25,7 +25,7 @@
   }
 
 
-  for( MachineInstr::val_op_const_iterator OpI(MInst); !OpI.done() ; OpI++) {
+  for( MachineInstr::val_const_op_iterator OpI(MInst); !OpI.done() ; OpI++) {
 
     if ( ((*OpI)->getType())->isLabelType()) continue; // don't process labels
     
@@ -50,7 +50,7 @@
   if( Inst->isDefinition() ) {  // add to Defs iff this instr is a definition
        remove(Inst);            // this definition kills any uses
   }
-  Instruction::op_const_iterator OpI = Inst->op_begin();  // get operand iterat
+  Instruction::const_op_iterator OpI = Inst->op_begin();  // get operand iterat
 
   for( ; OpI != Inst->op_end() ; OpI++) {              // iterate over operands
     if ( ((*OpI)->getType())->isLabelType()) continue; // don't process labels 
diff --git a/lib/Target/SparcV9/RegAlloc/LiveRangeInfo.cpp b/lib/Target/SparcV9/RegAlloc/LiveRangeInfo.cpp
index c072275..00385d9 100644
--- a/lib/Target/SparcV9/RegAlloc/LiveRangeInfo.cpp
+++ b/lib/Target/SparcV9/RegAlloc/LiveRangeInfo.cpp
@@ -122,7 +122,7 @@
  
              
       // iterate over  MI operands to find defs
-      for( MachineInstr::val_op_const_iterator OpI(MInst);!OpI.done(); ++OpI) {
+      for( MachineInstr::val_const_op_iterator OpI(MInst);!OpI.done(); ++OpI) {
 	
 	if( DEBUG_RA) {
 	  MachineOperand::MachineOperandType OpTyp = 
@@ -286,7 +286,7 @@
 
 
       // iterate over  MI operands to find defs
-      for(MachineInstr::val_op_const_iterator DefI(MInst);!DefI.done();++DefI){
+      for(MachineInstr::val_const_op_iterator DefI(MInst);!DefI.done();++DefI){
 	
 	if( DefI.isDef() ) {            // iff this operand is a def
 
@@ -294,7 +294,7 @@
 	  assert( LROfDef );
 	  RegClass *const RCOfDef = LROfDef->getRegClass();
 
-	  MachineInstr::val_op_const_iterator UseI(MInst);
+	  MachineInstr::val_const_op_iterator UseI(MInst);
 	  for( ; !UseI.done(); ++UseI){ // for all uses
 
  	    LiveRange *const LROfUse = getLiveRangeForValue( *UseI );
diff --git a/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp b/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp
index b7ca871..240e8c1 100644
--- a/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp
+++ b/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp
@@ -262,7 +262,7 @@
 
 
       // iterate over  MI operands to find defs
-      for( MachineInstr::val_op_const_iterator OpI(MInst);!OpI.done(); ++OpI) {
+      for( MachineInstr::val_const_op_iterator OpI(MInst);!OpI.done(); ++OpI) {
 
        	if( OpI.isDef() ) {     
 	  // create a new LR iff this operand is a def
@@ -318,7 +318,7 @@
   bool setInterf = false;
 
   // iterate over  MI operands to find defs
-  for( MachineInstr::val_op_const_iterator It1(MInst);!It1.done(); ++It1) {
+  for( MachineInstr::val_const_op_iterator It1(MInst);!It1.done(); ++It1) {
     
     const LiveRange *const LROfOp1 = LRI.getLiveRangeForValue( *It1 ); 
 
@@ -327,7 +327,7 @@
 
     //if( !LROfOp1 ) continue;
 
-    MachineInstr::val_op_const_iterator It2 = It1;
+    MachineInstr::val_const_op_iterator It2 = It1;
     ++It2;
 	
     for(  ; !It2.done(); ++It2) {
@@ -429,7 +429,7 @@
       //mcInfo.popAllTempValues(TM);
       // TODO ** : do later
       
-      //for(MachineInstr::val_op_const_iterator OpI(MInst);!OpI.done();++OpI) {
+      //for(MachineInstr::val_const_op_iterator OpI(MInst);!OpI.done();++OpI) {
 
 
       // Now replace set the registers for operands in the machine instruction
@@ -928,7 +928,7 @@
       cout << TargetInstrDescriptors[MInst->getOpCode()].opCodeString;
       
 
-      //for(MachineInstr::val_op_const_iterator OpI(MInst);!OpI.done();++OpI) {
+      //for(MachineInstr::val_const_op_iterator OpI(MInst);!OpI.done();++OpI) {
 
       for(unsigned OpNum=0; OpNum < MInst->getNumOperands(); ++OpNum) {
 
diff --git a/lib/Target/SparcV9/SparcV9AsmPrinter.cpp b/lib/Target/SparcV9/SparcV9AsmPrinter.cpp
index 385ffff..032faf1 100644
--- a/lib/Target/SparcV9/SparcV9AsmPrinter.cpp
+++ b/lib/Target/SparcV9/SparcV9AsmPrinter.cpp
@@ -612,10 +612,10 @@
     printConstant(GV->getInitializer(), getID(GV));
   else {
     toAsm << "\t.align\t"
-          << TypeToAlignment(GV->getType()->getValueType(), Target) << endl;
+          << TypeToAlignment(GV->getType()->getElementType(), Target) << endl;
     toAsm << "\t.type\t" << getID(GV) << ",#object" << endl;
     toAsm << "\t.reserve\t" << getID(GV) << ","
-          << TypeToSize(GV->getType()->getValueType(), Target)
+          << TypeToSize(GV->getType()->getElementType(), Target)
           << endl;
   }
 }
diff --git a/lib/Target/SparcV9/SparcV9InstrSelection.cpp b/lib/Target/SparcV9/SparcV9InstrSelection.cpp
index 2439b98..c7b8ecb 100644
--- a/lib/Target/SparcV9/SparcV9InstrSelection.cpp
+++ b/lib/Target/SparcV9/SparcV9InstrSelection.cpp
@@ -771,7 +771,7 @@
       newIdxVec->insert(newIdxVec->end(), idxVec->begin(), idxVec->end());
       idxVec = newIdxVec;
       
-      assert(! ((PointerType*)ptrVal->getType())->getValueType()->isArrayType()
+      assert(!((PointerType*)ptrVal->getType())->getElementType()->isArrayType()
              && "GetElemPtr cannot be folded into array refs in selection");
     }
   else
@@ -782,7 +782,7 @@
       // 
       ptrVal = memInst->getPointerOperand();
 
-      const Type* opType = cast<PointerType>(ptrVal->getType())->getValueType();
+      const Type* opType = cast<PointerType>(ptrVal->getType())->getElementType();
       if (opType->isArrayType())
         {
           assert((memInst->getNumOperands()
@@ -826,7 +826,7 @@
       
       const PointerType* ptrType = (PointerType*) ptrVal->getType();
       
-      if (ptrType->getValueType()->isStructType())
+      if (ptrType->getElementType()->isStructType())
         {
           // the offset is always constant for structs
           isConstantOffset = true;
@@ -839,7 +839,7 @@
           // It must be an array ref.  Check if the offset is a constant,
           // and that the indexing has been lowered to a single offset.
           // 
-          assert(ptrType->getValueType()->isArrayType());
+          assert(ptrType->getElementType()->isArrayType());
           assert(arrayOffsetVal != NULL
                  && "Expect to be given Value* for array offsets");
           
@@ -1835,7 +1835,7 @@
                   cast<GetElementPtrInst>(subtreeRoot->getInstruction());
                 const PointerType* ptrType =
                   cast<PointerType>(getElemInst->getPointerOperand()->getType());
-                if (! ptrType->getValueType()->isArrayType())
+                if (! ptrType->getElementType()->isArrayType())
                   {// we don't need a separate instr
                     numInstr = 0;		// don't forward operand!
                     break;
@@ -1853,7 +1853,7 @@
         const PointerType* instrType = (const PointerType*) instr->getType();
         assert(instrType->isPointerType());
         int tsize = (int)
-          target.findOptimalStorageSize(instrType->getValueType());
+          target.findOptimalStorageSize(instrType->getElementType());
         assert(tsize != 0 && "Just to check when this can happen");
         
         Method* method = instr->getParent()->getParent();
@@ -1881,9 +1881,9 @@
         Instruction* instr = subtreeRoot->getInstruction();
         const PointerType* instrType = (const PointerType*) instr->getType();
         assert(instrType->isPointerType() &&
-               instrType->getValueType()->isArrayType());
+               instrType->getElementType()->isArrayType());
         const Type* eltType =
-          ((ArrayType*) instrType->getValueType())->getElementType();
+          ((ArrayType*) instrType->getElementType())->getElementType();
         int tsize = (int) target.findOptimalStorageSize(eltType);
         
         assert(tsize != 0 && "Just to check when this can happen");
diff --git a/lib/Target/TargetData.cpp b/lib/Target/TargetData.cpp
index b11ef04..09bc600 100644
--- a/lib/Target/TargetData.cpp
+++ b/lib/Target/TargetData.cpp
@@ -151,7 +151,7 @@
   unsigned Result = 0;
 
   // Get the type pointed to...
-  const Type *Ty = PtrTy->getValueType();
+  const Type *Ty = PtrTy->getElementType();
 
   for (unsigned CurIDX = 0; CurIDX < Idx.size(); ++CurIDX) {
     if (const StructType *STy = dyn_cast<const StructType>(Ty)) {
diff --git a/lib/Transforms/ExprTypeConvert.cpp b/lib/Transforms/ExprTypeConvert.cpp
index 57d533d..66da6b1 100644
--- a/lib/Transforms/ExprTypeConvert.cpp
+++ b/lib/Transforms/ExprTypeConvert.cpp
@@ -34,7 +34,7 @@
 // pointer value.
 //
 static bool AllIndicesZero(const MemAccessInst *MAI) {
-  for (User::op_const_iterator S = MAI->idx_begin(), E = MAI->idx_end();
+  for (User::const_op_iterator S = MAI->idx_begin(), E = MAI->idx_end();
        S != E; ++S)
     if (!isa<Constant>(*S) || !cast<Constant>(*S)->isNullValue())
       return false;
@@ -66,7 +66,7 @@
       !isa<PointerType>(Ty)) return false;   // Malloc always returns pointers
 
   // Deal with the type to allocate, not the pointer type...
-  Ty = cast<PointerType>(Ty)->getValueType();
+  Ty = cast<PointerType>(Ty)->getElementType();
 
   // Analyze the number of bytes allocated...
   analysis::ExprType Expr = analysis::ClassifyExpression(MI->getArraySize());
@@ -117,7 +117,7 @@
     if (CastInst *CI = dyn_cast<CastInst>(*I))
       if (const PointerType *PT = 
           dyn_cast<PointerType>(CI->getOperand(0)->getType()))
-        if (getBaseTypeSize(PT->getValueType()) > ReqTypeSize)
+        if (getBaseTypeSize(PT->getElementType()) > ReqTypeSize)
           return false;     // We found a type bigger than this one!
   
   return true;
@@ -133,10 +133,10 @@
   analysis::ExprType Expr = analysis::ClassifyExpression(MI->getArraySize());
 
   const PointerType *AllocTy = cast<PointerType>(Ty);
-  const Type *ElType = AllocTy->getValueType();
+  const Type *ElType = AllocTy->getElementType();
 
   if (Expr.Var && !isa<ArrayType>(ElType)) {
-    ElType = ArrayType::get(AllocTy->getValueType());
+    ElType = ArrayType::get(AllocTy->getElementType());
     AllocTy = PointerType::get(ElType);
   }
 
@@ -216,8 +216,8 @@
     //
     if (PointerType *SPT = dyn_cast<PointerType>(I->getOperand(0)->getType()))
       if (PointerType *DPT = dyn_cast<PointerType>(I->getType()))
-        if (ArrayType *AT = dyn_cast<ArrayType>(SPT->getValueType()))
-          if (AT->getElementType() == DPT->getValueType())
+        if (ArrayType *AT = dyn_cast<ArrayType>(SPT->getElementType()))
+          if (AT->getElementType() == DPT->getElementType())
             return false;
 #endif
     break;
@@ -290,7 +290,7 @@
       Indices.pop_back();
       ElTy = GetElementPtrInst::getIndexedType(BaseType, Indices,
                                                            true);
-      if (ElTy == PTy->getValueType())
+      if (ElTy == PTy->getElementType())
         break;  // Found a match!!
       ElTy = 0;
     }
@@ -430,7 +430,7 @@
     //
     vector<Value*> Indices = GEP->copyIndices();
     const Type *BaseType = GEP->getPointerOperand()->getType();
-    const Type *PVTy = cast<PointerType>(Ty)->getValueType();
+    const Type *PVTy = cast<PointerType>(Ty)->getElementType();
     Res = 0;
     while (!Indices.empty() && isa<ConstantUInt>(Indices.back()) &&
            cast<ConstantUInt>(Indices.back())->getValue() == 0) {
@@ -546,8 +546,8 @@
     //
     if (PointerType *SPT = dyn_cast<PointerType>(I->getOperand(0)->getType()))
       if (PointerType *DPT = dyn_cast<PointerType>(I->getType()))
-        if (ArrayType *AT = dyn_cast<ArrayType>(SPT->getValueType()))
-          if (AT->getElementType() == DPT->getValueType())
+        if (ArrayType *AT = dyn_cast<ArrayType>(SPT->getElementType()))
+          if (AT->getElementType() == DPT->getElementType())
             return false;
 #endif
     return true;
@@ -595,7 +595,7 @@
       if (LI->hasIndices() && !AllIndicesZero(LI))
         return false;
 
-      const Type *LoadedTy = PT->getValueType();
+      const Type *LoadedTy = PT->getElementType();
 
       // They could be loading the first element of a composite type...
       if (const CompositeType *CT = dyn_cast<CompositeType>(LoadedTy)) {
@@ -625,16 +625,16 @@
       return ExpressionConvertableToType(I->getOperand(1), PointerType::get(Ty),
                                          CTMap);
     } else if (const PointerType *PT = dyn_cast<PointerType>(Ty)) {
-      if (isa<ArrayType>(PT->getValueType()))
+      if (isa<ArrayType>(PT->getElementType()))
         return false;  // Avoid getDataSize on unsized array type!
       assert(V == I->getOperand(1));
 
       // Must move the same amount of data...
-      if (TD.getTypeSize(PT->getValueType()) != 
+      if (TD.getTypeSize(PT->getElementType()) != 
           TD.getTypeSize(I->getOperand(0)->getType())) return false;
 
       // Can convert store if the incoming value is convertable...
-      return ExpressionConvertableToType(I->getOperand(0), PT->getValueType(),
+      return ExpressionConvertableToType(I->getOperand(0), PT->getElementType(),
                                          CTMap);
     }
     return false;
@@ -667,7 +667,7 @@
       return false; // Can't convert method pointer type yet.  FIXME
     
     const PointerType *MPtr = cast<PointerType>(I->getOperand(0)->getType());
-    const MethodType *MTy = cast<MethodType>(MPtr->getValueType());
+    const MethodType *MTy = cast<MethodType>(MPtr->getElementType());
     if (!MTy->isVarArg()) return false;
 
     if ((OpNum-1) < MTy->getParamTypes().size())
@@ -743,7 +743,7 @@
         const Type *RetTy = PointerType::get(ETy);
         // First operand is actually the given pointer...
         Res = new GetElementPtrInst(NewVal, Indices);
-        assert(cast<PointerType>(Res->getType())->getValueType() == ETy &&
+        assert(cast<PointerType>(Res->getType())->getElementType() == ETy &&
                "ConvertableToGEP broken!");
         break;
       }
@@ -774,7 +774,7 @@
 
   case Instruction::Load: {
     assert(I->getOperand(0) == OldVal && isa<PointerType>(NewVal->getType()));
-    const Type *LoadedTy = cast<PointerType>(NewVal->getType())->getValueType();
+    const Type *LoadedTy = cast<PointerType>(NewVal->getType())->getElementType();
 
     vector<Value*> Indices;
 
@@ -796,7 +796,7 @@
       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();
+      const Type *ValTy = cast<PointerType>(NewTy)->getElementType();
       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/IPO/DeadTypeElimination.cpp b/lib/Transforms/IPO/DeadTypeElimination.cpp
index 8599118..e194bf4 100644
--- a/lib/Transforms/IPO/DeadTypeElimination.cpp
+++ b/lib/Transforms/IPO/DeadTypeElimination.cpp
@@ -87,7 +87,7 @@
   //
   for (SymbolTable::iterator I = ST->begin(), E = ST->end(); I != E; ++I)
     if (const PointerType *PT = dyn_cast<PointerType>(I->first))
-      if (const MethodType *MT = dyn_cast<MethodType>(PT->getValueType())) {
+      if (const MethodType *MT = dyn_cast<MethodType>(PT->getElementType())) {
         SymbolTable::VarMap &Plane = I->second;
         for (SymbolTable::type_iterator PI = Plane.begin(), PE = Plane.end();
              PI != PE; ++PI) {
@@ -208,7 +208,7 @@
 
   // Nuke all pointers to primitive types as well...
   if (const PointerType *PT = dyn_cast<PointerType>(E.second))
-    if (PT->getValueType()->isPrimitiveType()) return true;
+    if (PT->getElementType()->isPrimitiveType()) return true;
 
   // The only types that could contain .'s in the program are things generated
   // by GCC itself, including "complex.float" and friends.  Nuke them too.
diff --git a/lib/Transforms/IPO/MutateStructTypes.cpp b/lib/Transforms/IPO/MutateStructTypes.cpp
index c9f7917..c91c00c 100644
--- a/lib/Transforms/IPO/MutateStructTypes.cpp
+++ b/lib/Transforms/IPO/MutateStructTypes.cpp
@@ -86,7 +86,7 @@
 
   case Type::PointerTyID:
     DestTy = PointerType::get(
-                 ConvertType(cast<PointerType>(Ty)->getValueType()));
+                 ConvertType(cast<PointerType>(Ty)->getElementType()));
     break;
   default:
     assert(0 && "Unknown type!");
@@ -432,7 +432,7 @@
         const Value *Ptr = MAI->getPointerOperand();
         Value *NewPtr = ConvertValue(Ptr);
         if (!Indices.empty()) {
-          const Type *PTy = cast<PointerType>(Ptr->getType())->getValueType();
+          const Type *PTy = cast<PointerType>(Ptr->getType())->getElementType();
           AdjustIndices(cast<CompositeType>(PTy), Indices);
         }
 
diff --git a/lib/Transforms/Instrumentation/TraceValues.cpp b/lib/Transforms/Instrumentation/TraceValues.cpp
index b42bb7b..d6f5a57 100644
--- a/lib/Transforms/Instrumentation/TraceValues.cpp
+++ b/lib/Transforms/Instrumentation/TraceValues.cpp
@@ -39,10 +39,10 @@
   if (PointerType* pty = dyn_cast<PointerType>(type))
     {
       const Type* elemTy;
-      if (ArrayType* aty = dyn_cast<ArrayType>(pty->getValueType()))
+      if (ArrayType* aty = dyn_cast<ArrayType>(pty->getElementType()))
         elemTy = aty->getElementType();
       else
-        elemTy = pty->getValueType();
+        elemTy = pty->getElementType();
       if (elemTy == Type::SByteTy || elemTy == Type::UByteTy)
         return "printString";
     }
diff --git a/lib/Transforms/LevelRaise.cpp b/lib/Transforms/LevelRaise.cpp
index e0ca4db..ff16f7d 100644
--- a/lib/Transforms/LevelRaise.cpp
+++ b/lib/Transforms/LevelRaise.cpp
@@ -220,7 +220,7 @@
         // type.
         //
         if (!HasAddUse) {
-          const Type *DestPointedTy = DestPTy->getValueType();
+          const Type *DestPointedTy = DestPTy->getElementType();
           unsigned Depth = 1;
           const CompositeType *CurCTy = CTy;
           const Type *ElTy = 0;
@@ -313,12 +313,12 @@
       if (Value *CastSrc = CI->getOperand(0)) // CSPT = CastSrcPointerType
         if (PointerType *CSPT = dyn_cast<PointerType>(CastSrc->getType()))
           // convertable types?
-          if (Val->getType()->isLosslesslyConvertableTo(CSPT->getValueType()) &&
+          if (Val->getType()->isLosslesslyConvertableTo(CSPT->getElementType()) &&
               !SI->hasIndices()) {      // No subscripts yet!
             PRINT_PEEPHOLE3("st-src-cast:in ", Pointer, Val, SI);
 
             // Insert the new T cast instruction... stealing old T's name
-            CastInst *NCI = new CastInst(Val, CSPT->getValueType(),
+            CastInst *NCI = new CastInst(Val, CSPT->getElementType(),
                                          CI->getName());
             CI->setName("");
             BI = BB->getInstList().insert(BI, NCI)+1;
@@ -372,7 +372,7 @@
     if (CastInst *CI = dyn_cast<CastInst>(Pointer)) {
       Value *SrcVal = CI->getOperand(0);
       const PointerType *SrcTy = dyn_cast<PointerType>(SrcVal->getType());
-      const Type *ElTy = SrcTy ? SrcTy->getValueType() : 0;
+      const Type *ElTy = SrcTy ? SrcTy->getElementType() : 0;
 
       // Make sure that nothing will be lost in the new cast...
       if (!LI->hasIndices() && SrcTy &&
@@ -445,7 +445,7 @@
   const PointerType *ThePtrType = dyn_cast<PointerType>(V->getType());
   if (!ThePtrType) return false;
 
-  const Type *ElTy = ThePtrType->getValueType();
+  const Type *ElTy = ThePtrType->getElementType();
   if (isa<MethodType>(ElTy) || isa<ArrayType>(ElTy)) return false;
 
   unsigned ElementSize = TD.getTypeSize(ElTy);
@@ -456,8 +456,8 @@
     switch (Inst->getOpcode()) {
     case Instruction::Cast:          // There is already a cast instruction!
       if (const PointerType *PT = dyn_cast<const PointerType>(Inst->getType()))
-	if (const ArrayType *AT = dyn_cast<const ArrayType>(PT->getValueType()))
-	  if (AT->getElementType() == ThePtrType->getValueType()) {
+	if (const ArrayType *AT = dyn_cast<const ArrayType>(PT->getElementType()))
+	  if (AT->getElementType() == ThePtrType->getElementType()) {
 	    // Cast already exists! Don't mess around with it.
 	    return false;       // No changes made to program though...
 	  }
diff --git a/lib/Transforms/TransformInternals.h b/lib/Transforms/TransformInternals.h
index d3ef47a..3131b8d 100644
--- a/lib/Transforms/TransformInternals.h
+++ b/lib/Transforms/TransformInternals.h
@@ -43,7 +43,7 @@
 //
 static inline const CompositeType *getPointedToComposite(const Type *Ty) {
   const PointerType *PT = dyn_cast<PointerType>(Ty);
-  return PT ? dyn_cast<CompositeType>(PT->getValueType()) : 0;
+  return PT ? dyn_cast<CompositeType>(PT->getElementType()) : 0;
 }
 
 
diff --git a/lib/Transforms/Utils/Linker.cpp b/lib/Transforms/Utils/Linker.cpp
index 8a02946..f04c8a4 100644
--- a/lib/Transforms/Utils/Linker.cpp
+++ b/lib/Transforms/Utils/Linker.cpp
@@ -179,7 +179,7 @@
       // later by LinkGlobalInits...
       //
       GlobalVariable *DGV = 
-        new GlobalVariable(SGV->getType()->getValueType(), SGV->isConstant(),
+        new GlobalVariable(SGV->getType()->getElementType(), SGV->isConstant(),
                            SGV->hasInternalLinkage(), 0, SGV->getName());
 
       // Add the new global to the dest module
diff --git a/lib/Transforms/Utils/LowerAllocations.cpp b/lib/Transforms/Utils/LowerAllocations.cpp
index ceb45f5..882485f 100644
--- a/lib/Transforms/Utils/LowerAllocations.cpp
+++ b/lib/Transforms/Utils/LowerAllocations.cpp
@@ -67,7 +67,7 @@
       if (MallocInst *MI = dyn_cast<MallocInst>(*(BBIL.begin()+i))) {
         BBIL.remove(BBIL.begin()+i);   // remove the malloc instr...
         
-        const Type *AllocTy = cast<PointerType>(MI->getType())->getValueType();
+        const Type *AllocTy =cast<PointerType>(MI->getType())->getElementType();
 
         // If the user is allocating an unsized array with a dynamic size arg,
         // start by getting the size of one element.
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp
index dcf8cf3..d853fb9 100644
--- a/lib/VMCore/AsmWriter.cpp
+++ b/lib/VMCore/AsmWriter.cpp
@@ -111,7 +111,7 @@
         //
         const Type *Ty = cast<const Type>(I->second);
         if (!isa<PointerType>(Ty) ||
-            !cast<PointerType>(Ty)->getValueType()->isPrimitiveType())
+            !cast<PointerType>(Ty)->getElementType()->isPrimitiveType())
           TypeNames.insert(make_pair(Ty, "%"+I->first));
       }
     }
@@ -174,7 +174,7 @@
     break;
   }
   case Type::PointerTyID:
-    Result = calcTypeName(cast<const PointerType>(Ty)->getValueType(), 
+    Result = calcTypeName(cast<const PointerType>(Ty)->getElementType(), 
                           TypeStack, TypeNames) + " *";
     break;
   case Type::ArrayTyID: {
@@ -325,7 +325,7 @@
   if (!GV->hasInitializer()) Out << "uninitialized ";
 
   Out << (GV->isConstant() ? "constant " : "global ");
-  printType(GV->getType()->getValueType());
+  printType(GV->getType()->getElementType());
 
   if (GV->hasInitializer())
     writeOperand(GV->getInitializer(), false, false);
@@ -534,7 +534,7 @@
     Out << " void";
   } else if (isa<CallInst>(I)) {
     const PointerType *PTy = dyn_cast<PointerType>(Operand->getType());
-    const MethodType  *MTy = PTy ? dyn_cast<MethodType>(PTy->getValueType()) :0;
+    const MethodType  *MTy = PTy ?dyn_cast<MethodType>(PTy->getElementType()):0;
     const Type      *RetTy = MTy ? MTy->getReturnType() : 0;
 
     // If possible, print out the short form of the call instruction, but we can
@@ -574,7 +574,7 @@
   } else if (I->getOpcode() == Instruction::Malloc || 
 	     I->getOpcode() == Instruction::Alloca) {
     Out << " ";
-    printType(cast<const PointerType>(I->getType())->getValueType());
+    printType(cast<const PointerType>(I->getType())->getElementType());
     if (I->getNumOperands()) {
       Out << ",";
       writeOperand(I->getOperand(0), true);
diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp
index c3d8e87..4b38ce1 100644
--- a/lib/VMCore/Function.cpp
+++ b/lib/VMCore/Function.cpp
@@ -62,7 +62,7 @@
 }
 
 const MethodType *Method::getMethodType() const {
-  return cast<MethodType>(cast<PointerType>(getType())->getValueType());
+  return cast<MethodType>(cast<PointerType>(getType())->getElementType());
 }
 
 const Type *Method::getReturnType() const { 
diff --git a/lib/VMCore/Linker.cpp b/lib/VMCore/Linker.cpp
index 8a02946..f04c8a4 100644
--- a/lib/VMCore/Linker.cpp
+++ b/lib/VMCore/Linker.cpp
@@ -179,7 +179,7 @@
       // later by LinkGlobalInits...
       //
       GlobalVariable *DGV = 
-        new GlobalVariable(SGV->getType()->getValueType(), SGV->isConstant(),
+        new GlobalVariable(SGV->getType()->getElementType(), SGV->isConstant(),
                            SGV->hasInternalLinkage(), 0, SGV->getName());
 
       // Add the new global to the dest module
diff --git a/lib/VMCore/SlotCalculator.cpp b/lib/VMCore/SlotCalculator.cpp
index 9c5d97a..ede8228 100644
--- a/lib/VMCore/SlotCalculator.cpp
+++ b/lib/VMCore/SlotCalculator.cpp
@@ -237,7 +237,7 @@
     // of const ints), that they are inserted also.  Same for global variable
     // initializers.
     //
-    for(User::op_const_iterator I = U->op_begin(), E = U->op_end(); I != E; ++I)
+    for(User::const_op_iterator I = U->op_begin(), E = U->op_end(); I != E; ++I)
       if (!isa<GlobalValue>(*I))  // Don't chain insert global values
 	insertValue(*I);
   }
diff --git a/lib/VMCore/Type.cpp b/lib/VMCore/Type.cpp
index 00e86e4..e0af0cb 100644
--- a/lib/VMCore/Type.cpp
+++ b/lib/VMCore/Type.cpp
@@ -297,7 +297,7 @@
       }
       case Type::PointerTyID: {
 	const PointerType *PTy = cast<const PointerType>(Ty);
-	Result = getTypeProps(PTy->getValueType(), TypeStack,
+	Result = getTypeProps(PTy->getElementType(), TypeStack,
 			      isAbstract, isRecursive) + " *";
 	break;
       }
diff --git a/lib/VMCore/iCall.cpp b/lib/VMCore/iCall.cpp
index 3f73933..7f4efaf 100644
--- a/lib/VMCore/iCall.cpp
+++ b/lib/VMCore/iCall.cpp
@@ -16,13 +16,13 @@
 CallInst::CallInst(Value *Meth, const vector<Value*> &params, 
                    const string &Name) 
   : Instruction(cast<MethodType>(cast<PointerType>(Meth->getType())
-				 ->getValueType())->getReturnType(),
+				 ->getElementType())->getReturnType(),
 		Instruction::Call, Name) {
   Operands.reserve(1+params.size());
   Operands.push_back(Use(Meth, this));
 
   const MethodType *MTy = 
-    cast<MethodType>(cast<PointerType>(Meth->getType())->getValueType());
+    cast<MethodType>(cast<PointerType>(Meth->getType())->getElementType());
 
   const MethodType::ParamTypes &PL = MTy->getParamTypes();
   assert((params.size() == PL.size()) || 
@@ -47,14 +47,14 @@
 		       BasicBlock *IfException, const vector<Value*>&params,
 		       const string &Name)
   : TerminatorInst(cast<MethodType>(cast<PointerType>(Meth->getType())
-				    ->getValueType())->getReturnType(),
+				    ->getElementType())->getReturnType(),
 		   Instruction::Invoke, Name) {
   Operands.reserve(3+params.size());
   Operands.push_back(Use(Meth, this));
   Operands.push_back(Use(IfNormal, this));
   Operands.push_back(Use(IfException, this));
   const MethodType *MTy = 
-    cast<MethodType>(cast<PointerType>(Meth->getType())->getValueType());
+    cast<MethodType>(cast<PointerType>(Meth->getType())->getElementType());
   
   const MethodType::ParamTypes &PL = MTy->getParamTypes();
   assert((params.size() == PL.size()) || 
diff --git a/lib/VMCore/iMemory.cpp b/lib/VMCore/iMemory.cpp
index a0a7b0f..c61961b 100644
--- a/lib/VMCore/iMemory.cpp
+++ b/lib/VMCore/iMemory.cpp
@@ -22,7 +22,7 @@
   if (!Ptr->isPointerType()) return 0;   // Type isn't a pointer type!
  
   // Get the type pointed to...
-  Ptr = cast<PointerType>(Ptr)->getValueType();
+  Ptr = cast<PointerType>(Ptr)->getElementType();
   
   unsigned CurIDX = 0;
   while (const CompositeType *ST = dyn_cast<CompositeType>(Ptr)) {
@@ -71,7 +71,7 @@
 }
 
 LoadInst::LoadInst(Value *Ptr, const string &Name = "")
-  : MemAccessInst(cast<PointerType>(Ptr->getType())->getValueType(),
+  : MemAccessInst(cast<PointerType>(Ptr->getType())->getElementType(),
                   Load, Name) {
   Operands.reserve(1);
   Operands.push_back(Use(Ptr, this));
@@ -121,5 +121,5 @@
 }
 
 bool GetElementPtrInst::isStructSelector() const {
-  return ((PointerType*)Operands[0]->getType())->getValueType()->isStructType();
+  return ((PointerType*)Operands[0]->getType())->getElementType()->isStructType();
 }