diff options
53 files changed, 146 insertions, 147 deletions
diff --git a/include/llvm/Analysis/ConstantsScanner.h b/include/llvm/Analysis/ConstantsScanner.h index ebe85e8..69e97d5 100644 --- a/include/llvm/Analysis/ConstantsScanner.h +++ b/include/llvm/Analysis/ConstantsScanner.h @@ -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; diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h index 7c347a4..d6b8ef7 100644 --- a/include/llvm/CodeGen/MachineInstr.h +++ b/include/llvm/CodeGen/MachineInstr.h @@ -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: diff --git a/include/llvm/DerivedTypes.h b/include/llvm/DerivedTypes.h index d98d333..0f7e360 100644 --- a/include/llvm/DerivedTypes.h +++ b/include/llvm/DerivedTypes.h @@ -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; diff --git a/include/llvm/Function.h b/include/llvm/Function.h index f2b0b48..6b44ad3 100644 --- a/include/llvm/Function.h +++ b/include/llvm/Function.h @@ -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 diff --git a/include/llvm/User.h b/include/llvm/User.h index 6b1ece4..2ea3a43 100644 --- a/include/llvm/User.h +++ b/include/llvm/User.h @@ -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 diff --git a/include/llvm/iMemory.h b/include/llvm/iMemory.h index 8f356bf..13843d2 100644 --- a/include/llvm/iMemory.h +++ b/include/llvm/iMemory.h @@ -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 { 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 @@ 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; 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 @@ 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(); 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 @@ 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 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 @@ 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() ) 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 @@ 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 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 @@ 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; 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 @@ 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(); 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 @@ 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) { 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 @@ 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)); 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 @@ 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: 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 @@ 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 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 @@ 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; 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 @@ 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; } 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 @@ 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); } 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 @@ 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; 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 @@ 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; 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 @@ 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) { 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 @@ 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 ); 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 @@ 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) { 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 @@ 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()) { 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 @@ 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); } 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 @@ 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 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 @@ 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; 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 @@ 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; 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 @@ 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() ) 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 @@ 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 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 @@ 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 ); 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 @@ 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) { 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 @@ 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; } } 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 @@ 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"); 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 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)) { 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 @@ 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)); 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 @@ 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. 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 @@ 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); } 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 @@ 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"; } 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 @@ 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... } 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 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; } 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 @@ 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 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 @@ 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. 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 @@ 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); 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 @@ 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 { 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 @@ 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 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 @@ 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); } 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 @@ 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; } 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*> ¶ms, 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*>¶ms, 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 @@ 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(); } diff --git a/support/lib/Support/NameMangling.cpp b/support/lib/Support/NameMangling.cpp index 675a7ff..bed520a 100644 --- a/support/lib/Support/NameMangling.cpp +++ b/support/lib/Support/NameMangling.cpp @@ -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()); } |