Renamed inst_const_iterator -> const_inst_iterator
authorChris Lattner <sabre@nondot.org>
Tue, 4 Dec 2001 00:03:30 +0000 (00:03 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 4 Dec 2001 00:03:30 +0000 (00:03 +0000)
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

53 files changed:
include/llvm/Analysis/ConstantsScanner.h
include/llvm/CodeGen/MachineInstr.h
include/llvm/DerivedTypes.h
include/llvm/Function.h
include/llvm/User.h
include/llvm/iMemory.h
lib/Analysis/IPA/CallGraph.cpp
lib/Analysis/IPA/FindUnsafePointerTypes.cpp
lib/Analysis/IPA/FindUsedTypes.cpp
lib/Analysis/LiveVar/BBLiveVar.cpp
lib/Analysis/LiveVar/LiveVarSet.cpp
lib/Analysis/ModuleAnalyzer.cpp
lib/AsmParser/ParserInternals.h
lib/AsmParser/llvmAsmParser.y
lib/Bytecode/Reader/ConstantReader.cpp
lib/Bytecode/Reader/InstructionReader.cpp
lib/Bytecode/Reader/Reader.cpp
lib/Bytecode/Writer/ConstantWriter.cpp
lib/Bytecode/Writer/InstructionWriter.cpp
lib/Bytecode/Writer/SlotCalculator.cpp
lib/CodeGen/InstrSched/SchedPriorities.cpp
lib/CodeGen/InstrSelection/InstrSelection.cpp
lib/CodeGen/MachineInstr.cpp
lib/CodeGen/RegAlloc/LiveRangeInfo.cpp
lib/CodeGen/RegAlloc/PhyRegAlloc.cpp
lib/ExecutionEngine/Interpreter/Execution.cpp
lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
lib/Linker/LinkModules.cpp
lib/Target/SparcV9/InstrSched/SchedPriorities.cpp
lib/Target/SparcV9/InstrSelection/InstrSelection.cpp
lib/Target/SparcV9/LiveVar/BBLiveVar.cpp
lib/Target/SparcV9/LiveVar/LiveVarSet.cpp
lib/Target/SparcV9/RegAlloc/LiveRangeInfo.cpp
lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp
lib/Target/SparcV9/SparcV9AsmPrinter.cpp
lib/Target/SparcV9/SparcV9InstrSelection.cpp
lib/Target/TargetData.cpp
lib/Transforms/ExprTypeConvert.cpp
lib/Transforms/IPO/DeadTypeElimination.cpp
lib/Transforms/IPO/MutateStructTypes.cpp
lib/Transforms/Instrumentation/TraceValues.cpp
lib/Transforms/LevelRaise.cpp
lib/Transforms/TransformInternals.h
lib/Transforms/Utils/Linker.cpp
lib/Transforms/Utils/LowerAllocations.cpp
lib/VMCore/AsmWriter.cpp
lib/VMCore/Function.cpp
lib/VMCore/Linker.cpp
lib/VMCore/SlotCalculator.cpp
lib/VMCore/Type.cpp
lib/VMCore/iCall.cpp
lib/VMCore/iMemory.cpp
support/lib/Support/NameMangling.cpp

index ebe85e8e7d1a33bcb0de642e5bb4df03f03b3745..69e97d53f93d2f057bba30588bbcb2c3222b770c 100644 (file)
@@ -16,7 +16,7 @@ class Constant;
 
 class constant_iterator
   : public std::forward_iterator<const Constant, ptrdiff_t> {
-  Method::inst_const_iterator InstI;        // Method instruction iterator
+  Method::const_inst_iterator InstI;        // Method instruction iterator
   unsigned OpIdx;                           // Operand index
 
   typedef constant_iterator _Self;
index 7c347a43ca4a92628d63ae891bde04e80d4593ba..d6b8ef71540a7cf4837f364c148afcb7baa63ce0 100644 (file)
@@ -267,7 +267,7 @@ private:
   vector<bool>          implicitIsDef;  // machine instruction (eg, call args)
   
 public:
-  typedef ValOpIterator<const MachineInstr, const Value> val_op_const_iterator;
+  typedef ValOpIterator<const MachineInstr, const Value> val_const_op_iterator;
   typedef ValOpIterator<const MachineInstr,       Value> val_op_iterator;
   
 public:
@@ -307,7 +307,7 @@ public:
   
 public:
   friend ostream& operator<<(ostream& os, const MachineInstr& minstr);
-  friend val_op_const_iterator;
+  friend val_const_op_iterator;
   friend val_op_iterator;
 
 public:
index d98d33363254c454b6251d89f00972827f7629a9..0f7e3609ba0f63e0eab4e4b87c30921f3cd36224 100644 (file)
@@ -312,7 +312,7 @@ protected:
   PointerType(const Type *ElType);
 public:
 
-  inline const Type *getValueType() const { return ValueType; }
+  inline const Type *getElementType() const { return ValueType; }
 
   virtual const Type *getContainedType(unsigned i) const { 
     return i == 0 ? ValueType.get() : 0;
index f2b0b48a745b1aa518f0865551a3c90914fe847e..6b44ad37b4241b8fae48880d972f671aea3c9c3e 100644 (file)
@@ -114,10 +114,10 @@ public:
                       BasicBlock::iterator, Instruction*> inst_iterator;
   typedef InstIterator<const BasicBlocksType, const_iterator, 
                       BasicBlock::const_iterator,
-                      const Instruction*> inst_const_iterator;
+                      const Instruction*> const_inst_iterator;
 
   // This inner class is used to implement inst_begin() & inst_end() for
-  // inst_iterator and inst_const_iterator's.
+  // inst_iterator and const_inst_iterator's.
   //
   template <class _BB_t, class _BB_i_t, class _BI_t, class _II_t>
   class InstIterator {
@@ -197,8 +197,8 @@ public:
 
   inline inst_iterator inst_begin() { return inst_iterator(*this); }
   inline inst_iterator inst_end()   { return inst_iterator(*this, true); }
-  inline inst_const_iterator inst_begin() const { return inst_const_iterator(*this); }
-  inline inst_const_iterator inst_end()   const { return inst_const_iterator(*this, true); }
+  inline const_inst_iterator inst_begin() const { return const_inst_iterator(*this); }
+  inline const_inst_iterator inst_end()   const { return const_inst_iterator(*this, true); }
 };
 
 // Provide specializations of GraphTraits to be able to treat a method as a 
index 6b1ece4dc2f9aa1a76c43ce17f9b782e2c73e011..2ea3a43fd0dc5752da09fc0ebd7d2749643395c9 100644 (file)
@@ -40,12 +40,12 @@ public:
   // Operand Iterator interface...
   //
   typedef vector<Use>::iterator       op_iterator;
-  typedef vector<Use>::const_iterator op_const_iterator;
+  typedef vector<Use>::const_iterator const_op_iterator;
 
   inline op_iterator       op_begin()       { return Operands.begin(); }
-  inline op_const_iterator op_begin() const { return Operands.begin(); }
+  inline const_op_iterator op_begin() const { return Operands.begin(); }
   inline op_iterator       op_end()         { return Operands.end(); }
-  inline op_const_iterator op_end()   const { return Operands.end(); }
+  inline const_op_iterator op_end()   const { return Operands.end(); }
 
   // dropAllReferences() - This function is in charge of "letting go" of all
   // objects that this User refers to.  This allows one to
index 8f356bf1f7915ca32f11e4f86254a819b4d6f9b6..13843d2274d0055b732ac9d8f59b019a3c3c40bb 100644 (file)
@@ -27,8 +27,8 @@ public:
 
     if (ArraySize) {
       // Make sure they didn't try to specify a size for !(unsized array) type
-      assert(getType()->getValueType()->isArrayType() && 
-             cast<ArrayType>(getType()->getValueType())->isUnsized() && 
+      assert(getType()->getElementType()->isArrayType() && 
+             cast<ArrayType>(getType()->getElementType())->isUnsized() && 
            "Trying to allocate something other than unsized array, with size!");
       assert(ArraySize->getType() == Type::UIntTy &&
              "Malloc/Allocation array size != UIntTy!");
@@ -37,8 +37,8 @@ public:
       Operands.push_back(Use(ArraySize, this));
     } else {
       // Make sure that the pointer is not to an unsized array!
-      assert(!getType()->getValueType()->isArrayType() ||
-            cast<const ArrayType>(getType()->getValueType())->isSized() && 
+      assert(!getType()->getElementType()->isArrayType() ||
+            cast<const ArrayType>(getType()->getElementType())->isSized() && 
             "Trying to allocate unsized array without size!");
     }
   }
@@ -63,7 +63,7 @@ public:
   // getAllocatedType - Return the type that is being allocated by the
   // instruction.
   inline const Type *getAllocatedType() const {
-    return getType()->getValueType();
+    return getType()->getElementType();
   }
 
   virtual Instruction *clone() const = 0;
@@ -183,11 +183,11 @@ public:
   inline op_iterator       idx_begin()       {
     return op_begin()+getFirstIndexOperandNumber();
   }
-  inline op_const_iterator idx_begin() const {
+  inline const_op_iterator idx_begin() const {
     return op_begin()+getFirstIndexOperandNumber();
   }
   inline op_iterator       idx_end()         { return op_end(); }
-  inline op_const_iterator idx_end()   const { return op_end(); }
+  inline const_op_iterator idx_end()   const { return op_end(); }
 
 
   vector<Value*> copyIndices() const {
index 47dbde7148306dd37b7ddc86c53ac5252f52c7f1..d77064cf35fd2890690e96e6b13fe31aee9ae10a 100644 (file)
@@ -130,7 +130,7 @@ bool IsLeafMethod(const Method* M, const cfg::CallGraph* CG) {
     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;
index 852763755aa6ac7642f1d55407f53dd63cdfe3cd..50fb8ea7b6361476a21406d7b7cf1d6a2c17cce6 100644 (file)
@@ -51,7 +51,7 @@ static inline bool isSafeInstruction(const Instruction *I) {
 //
 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();
index db5a5342028738ff3df9293562142526940065a5..6f8049abad130e3baf021ec16de95ad5b09f3b9f 100644 (file)
@@ -59,13 +59,13 @@ bool FindUsedTypes::doPerMethodWork(Method *m) {
   // 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
index 09beb12b0885ab514713792ea038b47b8f84a549..3f5d95d39e9dd2b2536bd336d7fbfd32468f6cfa 100644 (file)
@@ -39,7 +39,7 @@ void BBLiveVar::calcDefUseSets()
     }
 
     // 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 @@ void BBLiveVar::calcDefUseSets()
 
  
     // 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() )    
index 1ca65f0a4bac3c1e1e94bc94d70698b228ea0dff..bcc9de95686de766e70af0c5bc5293963d4a2f45 100644 (file)
@@ -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 @@ 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)->getType())->isLabelType()) continue; // don't process labels
     
@@ -50,7 +50,7 @@ void LiveVarSet::applyTranferFuncForInst(const Instruction *const Inst)
   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 
index 583378c98ebeeccd4e315619efcdf6acdad93da5..129fb3b86213d4fc2024988908a98774d7bfc6f7 100644 (file)
@@ -54,7 +54,7 @@ inline bool ModuleAnalyzer::handleType(set<const Type *> &TypeSet,
   }
 
   case Type::PointerTyID:
-    if (handleType(TypeSet, ((const PointerType *)T)->getValueType()))
+    if (handleType(TypeSet, cast<const PointerType>(T)->getElementType()))
       return true;
     break;
 
index b05bb0ddac4cd6b9bf253327e5d9c7cc4e3468e1..750833fae83cde59b9dd020333840aa10d3d5a9c 100644 (file)
@@ -184,8 +184,8 @@ typedef PlaceholderValue<BBPlaceHolderHelper>    BBPlaceHolder;
 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 ValID &getValIDFromPlaceHolder(const Value *Val) {
 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();
index acc3cfdb19c9c2b7f7d7cc81d602c5c39f4e29d4..28e9fae24265d0ed75a6eeb724998b65f61a1521 100644 (file)
@@ -983,7 +983,8 @@ ConstVal: Types '[' ConstVector ']' { // Nonempty unsized arr
        // 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 @@ BBTerminatorInst : RET ResolvedVal {              // Return with a result...
     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 @@ InstVal : BinaryOps Types ValueRef ',' ValueRef {
     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) {
index ddeeba33363c1cc47b7f131b869475ce8ac3361a..671afd2066e71243d7a37d521162c1fbb91675c8 100644 (file)
@@ -305,7 +305,7 @@ bool BytecodeParser::parseConstantValue(const uchar *&Buf, const uchar *EndBuf,
 
          // 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));
index 5645e689f0d286bd76c20407a8a6ec196f6a197f..47d9e820e278f9588cabdefe2509ef185948b693 100644 (file)
@@ -227,7 +227,7 @@ bool BytecodeParser::ParseInstruction(const uchar *&Buf, const uchar *EndBuf,
     // 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 @@ bool BytecodeParser::ParseInstruction(const uchar *&Buf, const uchar *EndBuf,
     // 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 @@ bool BytecodeParser::ParseInstruction(const uchar *&Buf, const uchar *EndBuf,
     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 @@ bool BytecodeParser::ParseInstruction(const uchar *&Buf, const uchar *EndBuf,
     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: 
index 84fcd8d8ec8289cd2635a32ecf4ef1640f66c36a..c8be36845a26656a0ecac62158dbfb01a9162741 100644 (file)
@@ -262,7 +262,7 @@ bool BytecodeParser::ParseMethod(const uchar *&Buf, const uchar *EndBuf,
   }
 
   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 @@ bool BytecodeParser::ParseModuleGlobalInfo(const uchar *&Buf, const uchar *End,
     }
 
     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 @@ bool BytecodeParser::ParseModuleGlobalInfo(const uchar *&Buf, const uchar *End,
   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 
index 835ef9850b43c0e453195993cee9e172ff0a7c17..0700a2e63e7c050f76e1f6567ca64daf1e0c8c31 100644 (file)
@@ -74,7 +74,7 @@ void BytecodeWriter::outputType(const Type *T) {
 
   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;
index 54459100356c97e64a735ec8e72065bb1e9abac1..825fde6a16b013631e819685d7f0e3960b10d009 100644 (file)
@@ -226,13 +226,13 @@ void BytecodeWriter::processInstruction(const Instruction *I) {
     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;
     }
index 9c5d97a5881bcfaffd03b70580ed5329bb36128f..ede822846d3c6b3089f7bdd7309736249b6ebc87 100644 (file)
@@ -237,7 +237,7 @@ int SlotCalculator::insertValue(const Value *D) {
     // 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);
   }
index acbe552d0526a3bb276b74ac9d9d496dcf45378f..17697072381d1588e79f37010f3912254fbdac02 100644 (file)
@@ -268,7 +268,7 @@ SchedPriorities::instructionHasLastUse(MethodLiveVarInfo& methodLiveVarInfo,
   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;
index d0a301ce5eed799c0eb6708a0054058ea9a8fd70..b959c90ca30247ab8ffa9cd5d2cdb69c72fe12c3 100644 (file)
@@ -250,8 +250,7 @@ void InsertCode4AllPhisInMeth(Method *method, TargetMachine &target) {
 
        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;
index de77f6ab6cb938cfb629593f8cd23206514848b5..5832b8ed18b3afcaad625b2205d8f6f2036406e6 100644 (file)
@@ -102,7 +102,7 @@ operator<< (ostream& os, const MachineInstr& minstr)
 #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 @@ ComputeMaxOptionalArgsSize(const TargetMachine& target, const Method* method)
   
   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)
       {
index c07227539a231f5e1e432ef08f1eaa04a3c60133..00385d99de20cc03443fc63d343ae6f516905938 100644 (file)
@@ -122,7 +122,7 @@ void LiveRangeInfo::constructLiveRanges()
  
              
       // 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 @@ void LiveRangeInfo::coalesceLRs()
 
 
       // 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 @@ void LiveRangeInfo::coalesceLRs()
          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 );
index b7ca871b9c2063053dd33ef7220770ff6c399b99..240e8c1c2a98b68982cf92297e63d12200e3d771 100644 (file)
@@ -262,7 +262,7 @@ void PhyRegAlloc::buildInterferenceGraphs()
 
 
       // 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 @@ void PhyRegAlloc::addInterf4PseudoInstr(const MachineInstr *MInst) {
   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 @@ void PhyRegAlloc::addInterf4PseudoInstr(const MachineInstr *MInst) {
 
     //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 @@ void PhyRegAlloc::updateMachineCode()
       //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 @@ void PhyRegAlloc::printMachineCode()
       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) {
 
index 8378a2048d77a16cec1201fbc388ab77812b57b4..5051bc73c091052912bafc1034c13245fcb7cda0 100644 (file)
@@ -237,7 +237,7 @@ Annotation *GlobalAddress::Create(AnnotationID AID, const Annotable *O, void *){
   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::executeBrInst(BranchInst *I, ExecutionContext &SF) {
 //===----------------------------------------------------------------------===//
 
 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 @@ static PointerTy getElementOffset(MemAccessInst *I, ExecutionContext &SF) {
 
   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()) {
index 04a73e85561873228cc197d4e5a94f80fae4f674..4af07ad5f836ab56dfcc2abf2375aca99e52376e 100644 (file)
@@ -130,8 +130,8 @@ GenericValue lle_X_printVal(MethodType *M, const vector<GenericValue> &ArgVal) {
 
   // 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);
     }
 
index 8a0294660fdb5620d26d89fa83ee9b27f99a5cb8..f04c8a46a3140f74ebc1a00cc648d1ee971107e2 100644 (file)
@@ -179,7 +179,7 @@ static bool LinkGlobals(Module *Dest, const Module *Src,
       // 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
index acbe552d0526a3bb276b74ac9d9d496dcf45378f..17697072381d1588e79f37010f3912254fbdac02 100644 (file)
@@ -268,7 +268,7 @@ SchedPriorities::instructionHasLastUse(MethodLiveVarInfo& methodLiveVarInfo,
   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;
index d0a301ce5eed799c0eb6708a0054058ea9a8fd70..b959c90ca30247ab8ffa9cd5d2cdb69c72fe12c3 100644 (file)
@@ -250,8 +250,7 @@ void InsertCode4AllPhisInMeth(Method *method, TargetMachine &target) {
 
        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;
index 09beb12b0885ab514713792ea038b47b8f84a549..3f5d95d39e9dd2b2536bd336d7fbfd32468f6cfa 100644 (file)
@@ -39,7 +39,7 @@ void BBLiveVar::calcDefUseSets()
     }
 
     // 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 @@ void BBLiveVar::calcDefUseSets()
 
  
     // 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() )    
index 1ca65f0a4bac3c1e1e94bc94d70698b228ea0dff..bcc9de95686de766e70af0c5bc5293963d4a2f45 100644 (file)
@@ -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 @@ 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)->getType())->isLabelType()) continue; // don't process labels
     
@@ -50,7 +50,7 @@ void LiveVarSet::applyTranferFuncForInst(const Instruction *const Inst)
   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 
index c07227539a231f5e1e432ef08f1eaa04a3c60133..00385d99de20cc03443fc63d343ae6f516905938 100644 (file)
@@ -122,7 +122,7 @@ void LiveRangeInfo::constructLiveRanges()
  
              
       // 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 @@ void LiveRangeInfo::coalesceLRs()
 
 
       // 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 @@ void LiveRangeInfo::coalesceLRs()
          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 );
index b7ca871b9c2063053dd33ef7220770ff6c399b99..240e8c1c2a98b68982cf92297e63d12200e3d771 100644 (file)
@@ -262,7 +262,7 @@ void PhyRegAlloc::buildInterferenceGraphs()
 
 
       // 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 @@ void PhyRegAlloc::addInterf4PseudoInstr(const MachineInstr *MInst) {
   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 @@ void PhyRegAlloc::addInterf4PseudoInstr(const MachineInstr *MInst) {
 
     //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 @@ void PhyRegAlloc::updateMachineCode()
       //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 @@ void PhyRegAlloc::printMachineCode()
       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) {
 
index 385ffffe56f120a0db15b27421514c252dfe3160..032faf12d654c628546dc8efe419d35ba9e72e0e 100644 (file)
@@ -612,10 +612,10 @@ SparcAsmPrinter::printGlobalVariable(const GlobalVariable* GV)
     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;
   }
 }
index 2439b9877c94bb2dd04f60eb851267a9e2e50777..c7b8ecb351218842ae113283aeae906e057e94e2 100644 (file)
@@ -771,7 +771,7 @@ SetOperandsForMemInstr(MachineInstr* minstr,
       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 @@ SetOperandsForMemInstr(MachineInstr* minstr,
       // 
       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 @@ SetMemOperands_Internal(MachineInstr* minstr,
       
       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 @@ SetMemOperands_Internal(MachineInstr* minstr,
           // 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 @@ GetInstructionsByRule(InstructionNode* subtreeRoot,
                   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 @@ GetInstructionsByRule(InstructionNode* subtreeRoot,
         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 @@ GetInstructionsByRule(InstructionNode* subtreeRoot,
         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");
index b11ef0438aea3092cb9c719a8dc653548d9656de..09bc6009dc81518d2c4d450919a3e8b9c62e6949 100644 (file)
@@ -151,7 +151,7 @@ unsigned TargetData::getIndexedOffset(const Type *ptrTy,
   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)) {
index 57d533d88ddd76e1356ae15d501f132e754263c6..66da6b1686ab3baff20f3b673138de06b5071496 100644 (file)
@@ -34,7 +34,7 @@ static void ConvertOperandToType(User *U, Value *OldVal, Value *NewVal,
 // 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 @@ static bool MallocConvertableToType(MallocInst *MI, const Type *Ty,
       !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 @@ static bool MallocConvertableToType(MallocInst *MI, const Type *Ty,
     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 @@ static Instruction *ConvertMallocToType(MallocInst *MI, const Type *Ty,
   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 @@ bool ExpressionConvertableToType(Value *V, const Type *Ty,
     //
     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 @@ bool ExpressionConvertableToType(Value *V, const Type *Ty,
       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 @@ Value *ConvertExpressionToType(Value *V, const Type *Ty, ValueMapCache &VMC) {
     //
     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 @@ static bool OperandConvertableToType(User *U, Value *V, const Type *Ty,
     //
     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 @@ static bool OperandConvertableToType(User *U, Value *V, const Type *Ty,
       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 @@ static bool OperandConvertableToType(User *U, Value *V, const Type *Ty,
       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 @@ static bool OperandConvertableToType(User *U, Value *V, const Type *Ty,
       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 @@ static void ConvertOperandToType(User *U, Value *OldVal, Value *NewVal,
         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 @@ static void ConvertOperandToType(User *U, Value *OldVal, Value *NewVal,
 
   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 @@ static void ConvertOperandToType(User *U, Value *OldVal, Value *NewVal,
       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));
index 8599118c388d20018666ef3243e018284ccf7858..e194bf4b5fadaee238f80d13a202861b50b68a73 100644 (file)
@@ -87,7 +87,7 @@ bool CleanupGCCOutput::PatchUpMethodReferences(Module *M) {
   //
   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 @@ static inline bool ShouldNukeSymtabEntry(const pair<string, Value*> &E) {
 
   // 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.
index c9f7917bd98f4da38deda2894cd06912cba9e48c..c91c00c6477c6a82a809758592317e47a2655b19 100644 (file)
@@ -86,7 +86,7 @@ const Type *MutateStructTypes::ConvertType(const Type *Ty) {
 
   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 @@ bool MutateStructTypes::doPerMethodWork(Method *m) {
         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);
         }
 
index b42bb7bf6d559d9c1fd81391ff2225bffc300504..d6f5a57e8092575e97e4141dc7a96d380329ce04 100644 (file)
@@ -39,10 +39,10 @@ PrintMethodNameForType(const Type* type)
   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";
     }
index e0ca4dbfb0f20dfc46dfd3b9249066b909759812..ff16f7df0ea377ab82fe556dc8d9e6d42f75d2a3 100644 (file)
@@ -220,7 +220,7 @@ static bool PeepholeOptimize(BasicBlock *BB, BasicBlock::iterator &BI) {
         // 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 @@ static bool PeepholeOptimize(BasicBlock *BB, BasicBlock::iterator &BI) {
       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 @@ static bool PeepholeOptimize(BasicBlock *BB, BasicBlock::iterator &BI) {
     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 @@ static bool DoInsertArrayCast(Value *V, BasicBlock *BB,
   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 @@ static bool DoInsertArrayCast(Value *V, BasicBlock *BB,
     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...
          }
index d3ef47aad28de12154d75a9698def8661740e022..3131b8d3675580952dea217d5ad56e6f8531e017 100644 (file)
@@ -43,7 +43,7 @@ static inline bool isFirstClassType(const Type *Ty) {
 //
 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;
 }
 
 
index 8a0294660fdb5620d26d89fa83ee9b27f99a5cb8..f04c8a46a3140f74ebc1a00cc648d1ee971107e2 100644 (file)
@@ -179,7 +179,7 @@ static bool LinkGlobals(Module *Dest, const Module *Src,
       // 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
index ceb45f59c6710c9874424c229d53994104a17895..882485f8ff747619471060aa3a0dca8ad185f2c3 100644 (file)
@@ -67,7 +67,7 @@ bool LowerAllocations::doPerMethodWork(Method *M) {
       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.
index dcf8cf3f35c1e969d675797203a205ee96d8ddf4..d853fb9bbc0d1d2552d2de5daac307ca06a875a5 100644 (file)
@@ -111,7 +111,7 @@ static void fillTypeNameTable(const Module *M,
         //
         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 @@ static string calcTypeName(const Type *Ty, vector<const Type *> &TypeStack,
     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 @@ void AssemblyWriter::printGlobal(const GlobalVariable *GV) {
   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 @@ void AssemblyWriter::printInstruction(const Instruction *I) {
     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 @@ void AssemblyWriter::printInstruction(const Instruction *I) {
   } 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);
index c3d8e87f8c1441b404da4c936242423216244ed1..4b38ce11965a76d27be12ccc623da4f3862d83d7 100644 (file)
@@ -62,7 +62,7 @@ void Method::setParent(Module *parent) {
 }
 
 const MethodType *Method::getMethodType() const {
-  return cast<MethodType>(cast<PointerType>(getType())->getValueType());
+  return cast<MethodType>(cast<PointerType>(getType())->getElementType());
 }
 
 const Type *Method::getReturnType() const { 
index 8a0294660fdb5620d26d89fa83ee9b27f99a5cb8..f04c8a46a3140f74ebc1a00cc648d1ee971107e2 100644 (file)
@@ -179,7 +179,7 @@ static bool LinkGlobals(Module *Dest, const Module *Src,
       // 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
index 9c5d97a5881bcfaffd03b70580ed5329bb36128f..ede822846d3c6b3089f7bdd7309736249b6ebc87 100644 (file)
@@ -237,7 +237,7 @@ int SlotCalculator::insertValue(const Value *D) {
     // 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);
   }
index 00e86e453c1571169885d0252bc7f68db587b829..e0af0cbc45b38f8298613aa77d1bcd803503e18a 100644 (file)
@@ -297,7 +297,7 @@ static string getTypeProps(const Type *Ty, vector<const Type *> &TypeStack,
       }
       case Type::PointerTyID: {
        const PointerType *PTy = cast<const PointerType>(Ty);
-       Result = getTypeProps(PTy->getValueType(), TypeStack,
+       Result = getTypeProps(PTy->getElementType(), TypeStack,
                              isAbstract, isRecursive) + " *";
        break;
       }
index 3f73933690d210d2b2737baabe5c026827829273..7f4efaf7b2c4a63dacb87e5d9963989dc3d8b2c6 100644 (file)
 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 @@ InvokeInst::InvokeInst(Value *Meth, BasicBlock *IfNormal, \
                       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()) || 
index a0a7b0f9793684a65bee8fceacfad184a6f0ffe2..c61961b58e3574028ee4aacc9f6d11e2333f867b 100644 (file)
@@ -22,7 +22,7 @@ const Type* MemAccessInst::getIndexedType(const Type *Ptr,
   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 vector<Value*> &Idx,
 }
 
 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 @@ GetElementPtrInst::GetElementPtrInst(Value *Ptr, const vector<Value*> &Idx,
 }
 
 bool GetElementPtrInst::isStructSelector() const {
-  return ((PointerType*)Operands[0]->getType())->getValueType()->isStructType();
+  return ((PointerType*)Operands[0]->getType())->getElementType()->isStructType();
 }
index 675a7ff103566d90c1feacf5fee7c4ce2d6b3935..bed520a92bb3db7916e204eecc77475da42a0cf3 100644 (file)
@@ -17,7 +17,7 @@ string MangleTypeName(const Type *Ty) {
     const string &longName = Ty->getDescription();
     return string(longName.c_str(), (longName.length() < 2) ? 1 : 2);
   } else if (PointerType *PTy = dyn_cast<PointerType>(Ty)) {
-    mangledName = string("P_" + MangleTypeName(PTy->getValueType()));
+    mangledName = string("P_" + MangleTypeName(PTy->getElementType()));
   } else if (StructType *STy = dyn_cast<StructType>(Ty)) {
     mangledName = string("S_");
     for (unsigned i=0; i < STy->getNumContainedTypes(); ++i)
@@ -41,6 +41,6 @@ string MangleName(const string &privateName, const Value *V) {
   // Lets drop the P_ before every global name since all globals are ptrs
   return privateName + "_" +
     MangleTypeName(isa<GlobalValue>(V)
-                   ? cast<GlobalValue>(V)->getType()->getValueType()
+                   ? cast<GlobalValue>(V)->getType()->getElementType()
                    : V->getType());
 }