diff options
53 files changed, 146 insertions, 147 deletions
diff --git a/include/llvm/Analysis/ConstantsScanner.h b/include/llvm/Analysis/ConstantsScanner.h index ebe85e8e7d..69e97d53f9 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 7c347a43ca..d6b8ef7154 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 d98d333632..0f7e3609ba 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 f2b0b48a74..6b44ad37b4 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 6b1ece4dc2..2ea3a43fd0 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 8f356bf1f7..13843d2274 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 47dbde7148..d77064cf35 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 852763755a..50fb8ea7b6 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 db5a534202..6f8049abad 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 09beb12b08..3f5d95d39e 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 1ca65f0a4b..bcc9de9568 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 583378c98e..129fb3b862 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 b05bb0ddac..750833fae8 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 acc3cfdb19..28e9fae242 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 ddeeba3336..671afd2066 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 5645e689f0..47d9e820e2 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 84fcd8d8ec..c8be36845a 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 835ef9850b..0700a2e63e 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 5445910035..825fde6a16 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 9c5d97a588..ede822846d 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 acbe552d05..1769707238 100644 --- a/lib/CodeGen/InstrSched/SchedPriorities.cpp +++ b/lib/CodeGen/InstrSched/SchedPriorities.cpp @@ -268,7 +268,7 @@ SchedPriorities::instructionHasLastUse(MethodLiveVarInfo& methodLiveVarInfo, const LiveVarSet* liveVars = |