From 783617eba7f52bc036dd56c7e5f127e23316f465 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Thu, 4 Jul 2013 01:31:24 +0000 Subject: [PATCH] Use SmallVectorImpl::iterator/const_iterator instead of SmallVector to avoid specifying the vector size. llvm-svn: 185606 --- lib/Analysis/BranchProbabilityInfo.cpp | 22 +++++++++---------- lib/Analysis/LazyValueInfo.cpp | 8 +++---- lib/Analysis/ProfileEstimatorPass.cpp | 6 ++--- lib/ExecutionEngine/ExecutionEngine.cpp | 2 +- lib/IR/DataLayout.cpp | 2 +- lib/IR/GCOV.cpp | 14 ++++++------ lib/Support/YAMLTraits.cpp | 2 +- lib/Target/ARM/ARMLoadStoreOptimizer.cpp | 8 +++---- lib/Target/MBlaze/MBlazeFrameLowering.cpp | 8 +++---- lib/Target/Mips/MipsLongBranch.cpp | 2 +- lib/Target/NVPTX/ManagedStringPool.h | 2 +- lib/Target/NVPTX/NVPTXGenericToNVVM.cpp | 2 +- lib/Target/PowerPC/PPCCTRLoops.cpp | 2 +- lib/Target/SystemZ/SystemZLongBranch.cpp | 6 ++--- lib/Transforms/IPO/StripSymbols.cpp | 4 ++-- .../InstCombine/InstructionCombining.cpp | 2 +- lib/Transforms/Instrumentation/BlackList.cpp | 2 +- .../Instrumentation/GCOVProfiling.cpp | 2 +- lib/Transforms/Scalar/ADCE.cpp | 2 +- lib/Transforms/Scalar/GVN.cpp | 4 ++-- lib/Transforms/Scalar/LoopDeletion.cpp | 2 +- lib/Transforms/Utils/BasicBlockUtils.cpp | 2 +- lib/Transforms/Utils/CodeExtractor.cpp | 4 ++-- lib/Transforms/Utils/Local.cpp | 2 +- .../Utils/PromoteMemoryToRegister.cpp | 2 +- lib/Transforms/Vectorize/BBVectorize.cpp | 8 +++---- lib/Transforms/Vectorize/SLPVectorizer.cpp | 2 +- .../MCJIT/MCJITObjectCacheTest.cpp | 2 +- utils/TableGen/CodeGenDAGPatterns.cpp | 4 ++-- 29 files changed, 65 insertions(+), 65 deletions(-) diff --git a/lib/Analysis/BranchProbabilityInfo.cpp b/lib/Analysis/BranchProbabilityInfo.cpp index a6481cf359b..7cdf828c2f4 100644 --- a/lib/Analysis/BranchProbabilityInfo.cpp +++ b/lib/Analysis/BranchProbabilityInfo.cpp @@ -151,8 +151,8 @@ bool BranchProbabilityInfo::calcUnreachableHeuristics(BasicBlock *BB) { uint32_t UnreachableWeight = std::max(UR_TAKEN_WEIGHT / (unsigned)UnreachableEdges.size(), MIN_WEIGHT); - for (SmallVector::iterator I = UnreachableEdges.begin(), - E = UnreachableEdges.end(); + for (SmallVectorImpl::iterator I = UnreachableEdges.begin(), + E = UnreachableEdges.end(); I != E; ++I) setEdgeWeight(BB, *I, UnreachableWeight); @@ -161,8 +161,8 @@ bool BranchProbabilityInfo::calcUnreachableHeuristics(BasicBlock *BB) { uint32_t ReachableWeight = std::max(UR_NONTAKEN_WEIGHT / (unsigned)ReachableEdges.size(), NORMAL_WEIGHT); - for (SmallVector::iterator I = ReachableEdges.begin(), - E = ReachableEdges.end(); + for (SmallVectorImpl::iterator I = ReachableEdges.begin(), + E = ReachableEdges.end(); I != E; ++I) setEdgeWeight(BB, *I, ReachableWeight); @@ -251,8 +251,8 @@ bool BranchProbabilityInfo::calcColdCallHeuristics(BasicBlock *BB) { uint32_t ColdWeight = std::max(CC_TAKEN_WEIGHT / (unsigned) ColdEdges.size(), MIN_WEIGHT); - for (SmallVector::iterator I = ColdEdges.begin(), - E = ColdEdges.end(); + for (SmallVectorImpl::iterator I = ColdEdges.begin(), + E = ColdEdges.end(); I != E; ++I) setEdgeWeight(BB, *I, ColdWeight); @@ -260,8 +260,8 @@ bool BranchProbabilityInfo::calcColdCallHeuristics(BasicBlock *BB) { return true; uint32_t NormalWeight = std::max( CC_NONTAKEN_WEIGHT / (unsigned) NormalEdges.size(), NORMAL_WEIGHT); - for (SmallVector::iterator I = NormalEdges.begin(), - E = NormalEdges.end(); + for (SmallVectorImpl::iterator I = NormalEdges.begin(), + E = NormalEdges.end(); I != E; ++I) setEdgeWeight(BB, *I, NormalWeight); @@ -326,7 +326,7 @@ bool BranchProbabilityInfo::calcLoopBranchHeuristics(BasicBlock *BB) { if (backWeight < NORMAL_WEIGHT) backWeight = NORMAL_WEIGHT; - for (SmallVector::iterator EI = BackEdges.begin(), + for (SmallVectorImpl::iterator EI = BackEdges.begin(), EE = BackEdges.end(); EI != EE; ++EI) { setEdgeWeight(BB, *EI, backWeight); } @@ -337,7 +337,7 @@ bool BranchProbabilityInfo::calcLoopBranchHeuristics(BasicBlock *BB) { if (inWeight < NORMAL_WEIGHT) inWeight = NORMAL_WEIGHT; - for (SmallVector::iterator EI = InEdges.begin(), + for (SmallVectorImpl::iterator EI = InEdges.begin(), EE = InEdges.end(); EI != EE; ++EI) { setEdgeWeight(BB, *EI, inWeight); } @@ -348,7 +348,7 @@ bool BranchProbabilityInfo::calcLoopBranchHeuristics(BasicBlock *BB) { if (exitWeight < MIN_WEIGHT) exitWeight = MIN_WEIGHT; - for (SmallVector::iterator EI = ExitingEdges.begin(), + for (SmallVectorImpl::iterator EI = ExitingEdges.begin(), EE = ExitingEdges.end(); EI != EE; ++EI) { setEdgeWeight(BB, *EI, exitWeight); } diff --git a/lib/Analysis/LazyValueInfo.cpp b/lib/Analysis/LazyValueInfo.cpp index 66b5e852c02..b6970af4cde 100644 --- a/lib/Analysis/LazyValueInfo.cpp +++ b/lib/Analysis/LazyValueInfo.cpp @@ -421,8 +421,8 @@ void LVIValueHandle::deleted() { if (I->second == getValPtr()) ToErase.push_back(*I); } - - for (SmallVector::iterator I = ToErase.begin(), + + for (SmallVectorImpl::iterator I = ToErase.begin(), E = ToErase.end(); I != E; ++I) Parent->OverDefinedCache.erase(*I); @@ -444,8 +444,8 @@ void LazyValueInfoCache::eraseBlock(BasicBlock *BB) { if (I->first == BB) ToErase.push_back(*I); } - - for (SmallVector::iterator I = ToErase.begin(), + + for (SmallVectorImpl::iterator I = ToErase.begin(), E = ToErase.end(); I != E; ++I) OverDefinedCache.erase(*I); diff --git a/lib/Analysis/ProfileEstimatorPass.cpp b/lib/Analysis/ProfileEstimatorPass.cpp index b284b995ac7..365b64c0ae0 100644 --- a/lib/Analysis/ProfileEstimatorPass.cpp +++ b/lib/Analysis/ProfileEstimatorPass.cpp @@ -181,7 +181,7 @@ void ProfileEstimatorPass::recurseBasicBlock(BasicBlock *BB) { double incoming = BBWeight; // Subtract the flow leaving the loop. std::set ProcessedExits; - for (SmallVector::iterator ei = ExitEdges.begin(), + for (SmallVectorImpl::iterator ei = ExitEdges.begin(), ee = ExitEdges.end(); ei != ee; ++ei) { if (ProcessedExits.insert(*ei).second) { double w = getEdgeWeight(*ei); @@ -216,7 +216,7 @@ void ProfileEstimatorPass::recurseBasicBlock(BasicBlock *BB) { // be distributed is split and the rounded, the last edge gets a somewhat // bigger value, but we are close enough for an estimation. double fraction = floor(incoming/Edges.size()); - for (SmallVector::iterator ei = Edges.begin(), ee = Edges.end(); + for (SmallVectorImpl::iterator ei = Edges.begin(), ee = Edges.end(); ei != ee; ++ei) { double w = 0; if (ei != (ee-1)) { @@ -289,7 +289,7 @@ void ProfileEstimatorPass::recurseBasicBlock(BasicBlock *BB) { double fraction = Edges.size() ? floor(BBWeight/Edges.size()) : 0.0; // Finally we know what flow is still not leaving the block, distribute this // flow onto the empty edges. - for (SmallVector::iterator ei = Edges.begin(), ee = Edges.end(); + for (SmallVectorImpl::iterator ei = Edges.begin(), ee = Edges.end(); ei != ee; ++ei) { if (ei != (ee-1)) { EdgeInformation[BB->getParent()][*ei] += fraction; diff --git a/lib/ExecutionEngine/ExecutionEngine.cpp b/lib/ExecutionEngine/ExecutionEngine.cpp index 01916363073..c463e9f807d 100644 --- a/lib/ExecutionEngine/ExecutionEngine.cpp +++ b/lib/ExecutionEngine/ExecutionEngine.cpp @@ -118,7 +118,7 @@ char *ExecutionEngine::getMemoryForGV(const GlobalVariable *GV) { } bool ExecutionEngine::removeModule(Module *M) { - for(SmallVector::iterator I = Modules.begin(), + for(SmallVectorImpl::iterator I = Modules.begin(), E = Modules.end(); I != E; ++I) { Module *Found = *I; if (Found == M) { diff --git a/lib/IR/DataLayout.cpp b/lib/IR/DataLayout.cpp index 71324630683..adb2d7a62ac 100644 --- a/lib/IR/DataLayout.cpp +++ b/lib/IR/DataLayout.cpp @@ -480,7 +480,7 @@ std::string DataLayout::getStringRepresentation() const { addrSpaces.push_back(pib->first); } std::sort(addrSpaces.begin(), addrSpaces.end()); - for (SmallVector::iterator asb = addrSpaces.begin(), + for (SmallVectorImpl::iterator asb = addrSpaces.begin(), ase = addrSpaces.end(); asb != ase; ++asb) { const PointerAlignElem &PI = Pointers.find(*asb)->second; OS << "-p"; diff --git a/lib/IR/GCOV.cpp b/lib/IR/GCOV.cpp index 24979500800..e9baa5c8cbc 100644 --- a/lib/IR/GCOV.cpp +++ b/lib/IR/GCOV.cpp @@ -63,7 +63,7 @@ bool GCOVFile::read(GCOVBuffer &Buffer) { /// dump - Dump GCOVFile content on standard out for debugging purposes. void GCOVFile::dump() { - for (SmallVector::iterator I = Functions.begin(), + for (SmallVectorImpl::iterator I = Functions.begin(), E = Functions.end(); I != E; ++I) (*I)->dump(); } @@ -71,7 +71,7 @@ void GCOVFile::dump() { /// collectLineCounts - Collect line counts. This must be used after /// reading .gcno and .gcda files. void GCOVFile::collectLineCounts(FileInfo &FI) { - for (SmallVector::iterator I = Functions.begin(), + for (SmallVectorImpl::iterator I = Functions.begin(), E = Functions.end(); I != E; ++I) (*I)->collectLineCounts(FI); FI.print(); @@ -155,7 +155,7 @@ bool GCOVFunction::read(GCOVBuffer &Buff, GCOV::GCOVFormat Format) { /// dump - Dump GCOVFunction content on standard out for debugging purposes. void GCOVFunction::dump() { outs() << "===== " << Name << " @ " << Filename << ":" << LineNumber << "\n"; - for (SmallVector::iterator I = Blocks.begin(), + for (SmallVectorImpl::iterator I = Blocks.begin(), E = Blocks.end(); I != E; ++I) (*I)->dump(); } @@ -163,7 +163,7 @@ void GCOVFunction::dump() { /// collectLineCounts - Collect line counts. This must be used after /// reading .gcno and .gcda files. void GCOVFunction::collectLineCounts(FileInfo &FI) { - for (SmallVector::iterator I = Blocks.begin(), + for (SmallVectorImpl::iterator I = Blocks.begin(), E = Blocks.end(); I != E; ++I) (*I)->collectLineCounts(FI); } @@ -197,7 +197,7 @@ void GCOVBlock::dump() { outs() << "Block : " << Number << " Counter : " << Counter << "\n"; if (!Edges.empty()) { outs() << "\tEdges : "; - for (SmallVector::iterator I = Edges.begin(), E = Edges.end(); + for (SmallVectorImpl::iterator I = Edges.begin(), E = Edges.end(); I != E; ++I) outs() << (*I) << ","; outs() << "\n"; @@ -220,14 +220,14 @@ void GCOVBlock::dump() { /// reading .gcno and .gcda files. void GCOVLines::collectLineCounts(FileInfo &FI, StringRef Filename, uint32_t Count) { - for (SmallVector::iterator I = Lines.begin(), + for (SmallVectorImpl::iterator I = Lines.begin(), E = Lines.end(); I != E; ++I) FI.addLineCount(Filename, *I, Count); } /// dump - Dump GCOVLines content on standard out for debugging purposes. void GCOVLines::dump() { - for (SmallVector::iterator I = Lines.begin(), + for (SmallVectorImpl::iterator I = Lines.begin(), E = Lines.end(); I != E; ++I) outs() << (*I) << ","; } diff --git a/lib/Support/YAMLTraits.cpp b/lib/Support/YAMLTraits.cpp index 9da2aa7c841..1e42b63e8d5 100644 --- a/lib/Support/YAMLTraits.cpp +++ b/lib/Support/YAMLTraits.cpp @@ -322,7 +322,7 @@ Input::HNode *Input::createHNodes(Node *N) { } bool Input::MapHNode::isValidKey(StringRef Key) { - for (SmallVector::iterator i = ValidKeys.begin(), + for (SmallVectorImpl::iterator i = ValidKeys.begin(), End = ValidKeys.end(); i != End; ++i) { if (Key.equals(*i)) return true; diff --git a/lib/Target/ARM/ARMLoadStoreOptimizer.cpp b/lib/Target/ARM/ARMLoadStoreOptimizer.cpp index 4e97ddaa2c3..6d05ad2c525 100644 --- a/lib/Target/ARM/ARMLoadStoreOptimizer.cpp +++ b/lib/Target/ARM/ARMLoadStoreOptimizer.cpp @@ -1484,7 +1484,7 @@ namespace { unsigned &PredReg, ARMCC::CondCodes &Pred, bool &isT2); bool RescheduleOps(MachineBasicBlock *MBB, - SmallVector &Ops, + SmallVectorImpl &Ops, unsigned Base, bool isLd, DenseMap &MI2LocMap); bool RescheduleLoadStoreInstrs(MachineBasicBlock *MBB); @@ -1656,7 +1656,7 @@ namespace { } bool ARMPreAllocLoadStoreOpt::RescheduleOps(MachineBasicBlock *MBB, - SmallVector &Ops, + SmallVectorImpl &Ops, unsigned Base, bool isLd, DenseMap &MI2LocMap) { bool RetVal = false; @@ -1894,7 +1894,7 @@ ARMPreAllocLoadStoreOpt::RescheduleLoadStoreInstrs(MachineBasicBlock *MBB) { // Re-schedule loads. for (unsigned i = 0, e = LdBases.size(); i != e; ++i) { unsigned Base = LdBases[i]; - SmallVector &Lds = Base2LdsMap[Base]; + SmallVectorImpl &Lds = Base2LdsMap[Base]; if (Lds.size() > 1) RetVal |= RescheduleOps(MBB, Lds, Base, true, MI2LocMap); } @@ -1902,7 +1902,7 @@ ARMPreAllocLoadStoreOpt::RescheduleLoadStoreInstrs(MachineBasicBlock *MBB) { // Re-schedule stores. for (unsigned i = 0, e = StBases.size(); i != e; ++i) { unsigned Base = StBases[i]; - SmallVector &Sts = Base2StsMap[Base]; + SmallVectorImpl &Sts = Base2StsMap[Base]; if (Sts.size() > 1) RetVal |= RescheduleOps(MBB, Sts, Base, false, MI2LocMap); } diff --git a/lib/Target/MBlaze/MBlazeFrameLowering.cpp b/lib/Target/MBlaze/MBlazeFrameLowering.cpp index 172304bd5b4..e453bcb150e 100644 --- a/lib/Target/MBlaze/MBlazeFrameLowering.cpp +++ b/lib/Target/MBlaze/MBlazeFrameLowering.cpp @@ -42,10 +42,10 @@ static void replaceFrameIndexes(MachineFunction &MF, SmallVector, 16> &FR) { MachineFrameInfo *MFI = MF.getFrameInfo(); MBlazeFunctionInfo *MBlazeFI = MF.getInfo(); - const SmallVector, 16>::iterator FRB = FR.begin(); - const SmallVector, 16>::iterator FRE = FR.end(); + const SmallVectorImpl>::iterator FRB = FR.begin(); + const SmallVectorImpl>::iterator FRE = FR.end(); - SmallVector, 16>::iterator FRI = FRB; + SmallVectorImpl>::iterator FRI = FRB; for (; FRI != FRE; ++FRI) { MFI->RemoveStackObject(FRI->first); int NFI = MFI->CreateFixedObject(4, FRI->second, true); @@ -91,7 +91,7 @@ static void analyzeFrameIndexes(MachineFunction &MF) { MachineRegisterInfo::livein_iterator LII = MRI.livein_begin(); MachineRegisterInfo::livein_iterator LIE = MRI.livein_end(); - const SmallVector &LiveInFI = MBlazeFI->getLiveIn(); + const SmallVectorImpl &LiveInFI = MBlazeFI->getLiveIn(); SmallVector EraseInstr; SmallVector, 16> FrameRelocate; diff --git a/lib/Target/Mips/MipsLongBranch.cpp b/lib/Target/Mips/MipsLongBranch.cpp index 073daba19bf..971176ec8fb 100644 --- a/lib/Target/Mips/MipsLongBranch.cpp +++ b/lib/Target/Mips/MipsLongBranch.cpp @@ -420,7 +420,7 @@ bool MipsLongBranch::runOnMachineFunction(MachineFunction &F) { MF = &F; initMBBInfo(); - SmallVector::iterator I, E = MBBInfos.end(); + SmallVectorImpl::iterator I, E = MBBInfos.end(); bool EverMadeChange = false, MadeChange = true; while (MadeChange) { diff --git a/lib/Target/NVPTX/ManagedStringPool.h b/lib/Target/NVPTX/ManagedStringPool.h index d6c79b5110c..f9fb0592292 100644 --- a/lib/Target/NVPTX/ManagedStringPool.h +++ b/lib/Target/NVPTX/ManagedStringPool.h @@ -29,7 +29,7 @@ class ManagedStringPool { public: ManagedStringPool() {} ~ManagedStringPool() { - SmallVector::iterator Current = Pool.begin(); + SmallVectorImpl::iterator Current = Pool.begin(); while (Current != Pool.end()) { delete *Current; Current++; diff --git a/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp b/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp index 1077c46fb40..9f92a5b13e7 100644 --- a/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp +++ b/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp @@ -384,7 +384,7 @@ void GenericToNVVM::remapNamedMDNode(Module *M, NamedMDNode *N) { // Replace the old operands with the new operands. N->dropAllReferences(); - for (SmallVector::iterator I = NewOperands.begin(), + for (SmallVectorImpl::iterator I = NewOperands.begin(), E = NewOperands.end(); I != E; ++I) { N->addOperand(*I); diff --git a/lib/Target/PowerPC/PPCCTRLoops.cpp b/lib/Target/PowerPC/PPCCTRLoops.cpp index bfc949521be..30181a027a0 100644 --- a/lib/Target/PowerPC/PPCCTRLoops.cpp +++ b/lib/Target/PowerPC/PPCCTRLoops.cpp @@ -402,7 +402,7 @@ bool PPCCTRLoops::convertToCTRLoop(Loop *L) { BasicBlock *CountedExitBlock = 0; const SCEV *ExitCount = 0; BranchInst *CountedExitBranch = 0; - for (SmallVector::iterator I = ExitingBlocks.begin(), + for (SmallVectorImpl::iterator I = ExitingBlocks.begin(), IE = ExitingBlocks.end(); I != IE; ++I) { const SCEV *EC = SE->getExitCount(L, *I); DEBUG(dbgs() << "Exit Count for " << *L << " from block " << diff --git a/lib/Target/SystemZ/SystemZLongBranch.cpp b/lib/Target/SystemZ/SystemZLongBranch.cpp index 2cb5823068d..c9d5205673f 100644 --- a/lib/Target/SystemZ/SystemZLongBranch.cpp +++ b/lib/Target/SystemZ/SystemZLongBranch.cpp @@ -310,7 +310,7 @@ bool SystemZLongBranch::mustRelaxBranch(const TerminatorInfo &Terminator, // Return true if, under current assumptions, any terminator needs // to be relaxed. bool SystemZLongBranch::mustRelaxABranch() { - for (SmallVector::iterator TI = Terminators.begin(), + for (SmallVectorImpl::iterator TI = Terminators.begin(), TE = Terminators.end(); TI != TE; ++TI) if (mustRelaxBranch(*TI, TI->Address)) return true; @@ -322,7 +322,7 @@ bool SystemZLongBranch::mustRelaxABranch() { void SystemZLongBranch::setWorstCaseAddresses() { SmallVector::iterator TI = Terminators.begin(); BlockPosition Position(MF->getAlignment()); - for (SmallVector::iterator BI = MBBs.begin(), BE = MBBs.end(); + for (SmallVectorImpl::iterator BI = MBBs.begin(), BE = MBBs.end(); BI != BE; ++BI) { skipNonTerminators(Position, *BI); for (unsigned BTI = 0, BTE = BI->NumTerminators; BTI != BTE; ++BTI) { @@ -386,7 +386,7 @@ void SystemZLongBranch::relaxBranch(TerminatorInfo &Terminator) { void SystemZLongBranch::relaxBranches() { SmallVector::iterator TI = Terminators.begin(); BlockPosition Position(MF->getAlignment()); - for (SmallVector::iterator BI = MBBs.begin(), BE = MBBs.end(); + for (SmallVectorImpl::iterator BI = MBBs.begin(), BE = MBBs.end(); BI != BE; ++BI) { skipNonTerminators(Position, *BI); for (unsigned BTI = 0, BTE = BI->NumTerminators; BTI != BTE; ++BTI) { diff --git a/lib/Transforms/IPO/StripSymbols.cpp b/lib/Transforms/IPO/StripSymbols.cpp index ba131eedc12..279110660b4 100644 --- a/lib/Transforms/IPO/StripSymbols.cpp +++ b/lib/Transforms/IPO/StripSymbols.cpp @@ -354,7 +354,7 @@ bool StripDeadDebugInfo::runOnModule(Module &M) { NMD->eraseFromParent(); NMD = NULL; - for (SmallVector::iterator I = MDs.begin(), + for (SmallVectorImpl::iterator I = MDs.begin(), E = MDs.end(); I != E; ++I) { GlobalVariable *GV = DIGlobalVariable(*I).getGlobal(); if (GV && M.getGlobalVariable(GV->getName(), true)) { @@ -381,7 +381,7 @@ bool StripDeadDebugInfo::runOnModule(Module &M) { NMD->eraseFromParent(); NMD = NULL; - for (SmallVector::iterator I = MDs.begin(), + for (SmallVectorImpl::iterator I = MDs.begin(), E = MDs.end(); I != E; ++I) { bool FnIsLive = false; if (Function *F = DISubprogram(*I).getFunction()) diff --git a/lib/Transforms/InstCombine/InstructionCombining.cpp b/lib/Transforms/InstCombine/InstructionCombining.cpp index ec107512028..b34ae21519c 100644 --- a/lib/Transforms/InstCombine/InstructionCombining.cpp +++ b/lib/Transforms/InstCombine/InstructionCombining.cpp @@ -2042,7 +2042,7 @@ Instruction *InstCombiner::visitLandingPadInst(LandingPadInst &LI) { continue; // If Filter is a subset of LFilter, i.e. every element of Filter is also // an element of LFilter, then discard LFilter. - SmallVector::iterator J = NewClauses.begin() + j; + SmallVectorImpl::iterator J = NewClauses.begin() + j; // If Filter is empty then it is a subset of LFilter. if (!FElts) { // Discard LFilter. diff --git a/lib/Transforms/Instrumentation/BlackList.cpp b/lib/Transforms/Instrumentation/BlackList.cpp index 39de4b0401c..ce3acbc9800 100644 --- a/lib/Transforms/Instrumentation/BlackList.cpp +++ b/lib/Transforms/Instrumentation/BlackList.cpp @@ -43,7 +43,7 @@ BlackList::BlackList(const StringRef Path) { SmallVector Lines; SplitString(File.take()->getBuffer(), Lines, "\n\r"); StringMap Regexps; - for (SmallVector::iterator I = Lines.begin(), E = Lines.end(); + for (SmallVectorImpl::iterator I = Lines.begin(), E = Lines.end(); I != E; ++I) { // Ignore empty lines and lines starting with "#" if (I->empty() || I->startswith("#")) diff --git a/lib/Transforms/Instrumentation/GCOVProfiling.cpp b/lib/Transforms/Instrumentation/GCOVProfiling.cpp index 06a0f2645e9..0f700ca909e 100644 --- a/lib/Transforms/Instrumentation/GCOVProfiling.cpp +++ b/lib/Transforms/Instrumentation/GCOVProfiling.cpp @@ -271,7 +271,7 @@ namespace { StringKeySort Sorter; std::sort(SortedLinesByFile.begin(), SortedLinesByFile.end(), Sorter); - for (SmallVector *, 32>::iterator + for (SmallVectorImpl *>::iterator I = SortedLinesByFile.begin(), E = SortedLinesByFile.end(); I != E; ++I) (*I)->getValue()->writeOut(); diff --git a/lib/Transforms/Scalar/ADCE.cpp b/lib/Transforms/Scalar/ADCE.cpp index a0973086405..a3eb07a9f6d 100644 --- a/lib/Transforms/Scalar/ADCE.cpp +++ b/lib/Transforms/Scalar/ADCE.cpp @@ -83,7 +83,7 @@ bool ADCE::runOnFunction(Function& F) { I->dropAllReferences(); } - for (SmallVector::iterator I = worklist.begin(), + for (SmallVectorImpl::iterator I = worklist.begin(), E = worklist.end(); I != E; ++I) { ++NumRemoved; (*I)->eraseFromParent(); diff --git a/lib/Transforms/Scalar/GVN.cpp b/lib/Transforms/Scalar/GVN.cpp index 996996dc55d..dad3147aa49 100644 --- a/lib/Transforms/Scalar/GVN.cpp +++ b/lib/Transforms/Scalar/GVN.cpp @@ -1555,7 +1555,7 @@ bool GVN::PerformLoadPRE(LoadInst *LI, AvailValInBlkVect &ValuesPerBlock, return false; // Split critical edges, and update the unavailable predecessors accordingly. - for (SmallVector::iterator I = CriticalEdgePred.begin(), + for (SmallVectorImpl::iterator I = CriticalEdgePred.begin(), E = CriticalEdgePred.end(); I != E; I++) { BasicBlock *OrigPred = *I; BasicBlock *NewPred = splitCriticalEdges(OrigPred, LoadBB); @@ -2352,7 +2352,7 @@ bool GVN::processBlock(BasicBlock *BB) { if (!AtStart) --BI; - for (SmallVector::iterator I = InstrsToErase.begin(), + for (SmallVectorImpl::iterator I = InstrsToErase.begin(), E = InstrsToErase.end(); I != E; ++I) { DEBUG(dbgs() << "GVN removed: " << **I << '\n'); if (MD) MD->removeInstruction(*I); diff --git a/lib/Transforms/Scalar/LoopDeletion.cpp b/lib/Transforms/Scalar/LoopDeletion.cpp index 0b62050b17a..0a406005af2 100644 --- a/lib/Transforms/Scalar/LoopDeletion.cpp +++ b/lib/Transforms/Scalar/LoopDeletion.cpp @@ -209,7 +209,7 @@ bool LoopDeletion::runOnLoop(Loop *L, LPPassManager &LPM) { // Move all of the block's children to be children of the preheader, which // allows us to remove the domtree entry for the block. ChildNodes.insert(ChildNodes.begin(), DT[*LI]->begin(), DT[*LI]->end()); - for (SmallVector::iterator DI = ChildNodes.begin(), + for (SmallVectorImpl::iterator DI = ChildNodes.begin(), DE = ChildNodes.end(); DI != DE; ++DI) { DT.changeImmediateDominator(*DI, DT[preheader]); } diff --git a/lib/Transforms/Utils/BasicBlockUtils.cpp b/lib/Transforms/Utils/BasicBlockUtils.cpp index ba99d2e662e..91677956542 100644 --- a/lib/Transforms/Utils/BasicBlockUtils.cpp +++ b/lib/Transforms/Utils/BasicBlockUtils.cpp @@ -170,7 +170,7 @@ bool llvm::MergeBlockIntoPredecessor(BasicBlock *BB, Pass *P) { if (DomTreeNode *DTN = DT->getNode(BB)) { DomTreeNode *PredDTN = DT->getNode(PredBB); SmallVector Children(DTN->begin(), DTN->end()); - for (SmallVector::iterator DI = Children.begin(), + for (SmallVectorImpl::iterator DI = Children.begin(), DE = Children.end(); DI != DE; ++DI) DT->changeImmediateDominator(*DI, PredDTN); diff --git a/lib/Transforms/Utils/CodeExtractor.cpp b/lib/Transforms/Utils/CodeExtractor.cpp index f7c659f2193..82013f95f2d 100644 --- a/lib/Transforms/Utils/CodeExtractor.cpp +++ b/lib/Transforms/Utils/CodeExtractor.cpp @@ -277,8 +277,8 @@ void CodeExtractor::splitReturnBlocks() { DomTreeNode *NewNode = DT->addNewBlock(New, *I); - for (SmallVector::iterator I = Children.begin(), - E = Children.end(); I != E; ++I) + for (SmallVectorImpl::iterator I = Children.begin(), + E = Children.end(); I != E; ++I) DT->changeImmediateDominator(*I, NewNode); } } diff --git a/lib/Transforms/Utils/Local.cpp b/lib/Transforms/Utils/Local.cpp index f8f00cd1d50..e470e14b90e 100644 --- a/lib/Transforms/Utils/Local.cpp +++ b/lib/Transforms/Utils/Local.cpp @@ -925,7 +925,7 @@ bool llvm::LowerDbgDeclare(Function &F) { if (Dbgs.empty()) return false; - for (SmallVector::iterator I = Dbgs.begin(), + for (SmallVectorImpl::iterator I = Dbgs.begin(), E = Dbgs.end(); I != E; ++I) { DbgDeclareInst *DDI = *I; if (AllocaInst *AI = dyn_cast_or_null(DDI->getAddress())) { diff --git a/lib/Transforms/Utils/PromoteMemoryToRegister.cpp b/lib/Transforms/Utils/PromoteMemoryToRegister.cpp index de335ec1a05..b993092358c 100644 --- a/lib/Transforms/Utils/PromoteMemoryToRegister.cpp +++ b/lib/Transforms/Utils/PromoteMemoryToRegister.cpp @@ -647,7 +647,7 @@ void PromoteMem2Reg::run() { // them from the Preds list. for (unsigned i = 0, e = SomePHI->getNumIncomingValues(); i != e; ++i) { // Do a log(n) search of the Preds list for the entry we want. - SmallVector::iterator EntIt = + SmallVectorImpl::iterator EntIt = std::lower_bound(Preds.begin(), Preds.end(), SomePHI->getIncomingBlock(i)); assert(EntIt != Preds.end() && *EntIt == SomePHI->getIncomingBlock(i)&& diff --git a/lib/Transforms/Vectorize/BBVectorize.cpp b/lib/Transforms/Vectorize/BBVectorize.cpp index 17900dabbef..bd4a3b90b1c 100644 --- a/lib/Transforms/Vectorize/BBVectorize.cpp +++ b/lib/Transforms/Vectorize/BBVectorize.cpp @@ -1602,7 +1602,7 @@ namespace { DenseSet CurrentPairs; bool CanAdd = true; - for (SmallVector::iterator C2 + for (SmallVectorImpl::iterator C2 = BestChildren.begin(), E2 = BestChildren.end(); C2 != E2; ++C2) { if (C2->first.first == C->first.first || @@ -1642,7 +1642,7 @@ namespace { if (!CanAdd) continue; // And check the queue too... - for (SmallVector::iterator C2 = Q.begin(), + for (SmallVectorImpl::iterator C2 = Q.begin(), E2 = Q.end(); C2 != E2; ++C2) { if (C2->first.first == C->first.first || C2->first.first == C->first.second || @@ -1691,7 +1691,7 @@ namespace { // to an already-selected child. Check for this here, and if a // conflict is found, then remove the previously-selected child // before adding this one in its place. - for (SmallVector::iterator C2 + for (SmallVectorImpl::iterator C2 = BestChildren.begin(); C2 != BestChildren.end();) { if (C2->first.first == C->first.first || C2->first.first == C->first.second || @@ -1706,7 +1706,7 @@ namespace { BestChildren.push_back(ValuePairWithDepth(C->first, C->second)); } - for (SmallVector::iterator C + for (SmallVectorImpl::iterator C = BestChildren.begin(), E2 = BestChildren.end(); C != E2; ++C) { size_t DepthF = getDepthFactor(C->first.first); diff --git a/lib/Transforms/Vectorize/SLPVectorizer.cpp b/lib/Transforms/Vectorize/SLPVectorizer.cpp index 8655ff0e11b..85c01bdeff9 100644 --- a/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -1444,7 +1444,7 @@ void FuncSLP::optimizeGatherSequence() { } // Erase all of the instructions that we RAUWed. - for (SmallVector::iterator v = ToRemove.begin(), + for (SmallVectorImpl::iterator v = ToRemove.begin(), ve = ToRemove.end(); v != ve; ++v) { assert((*v)->getNumUses() == 0 && "Can't remove instructions with uses"); (*v)->eraseFromParent(); diff --git a/unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp b/unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp index 2cc045ba97f..7073a5265d6 100644 --- a/unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp +++ b/unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp @@ -28,7 +28,7 @@ public: virtual ~TestObjectCache() { // Free any buffers we've allocated. - SmallVector::iterator it, end; + SmallVectorImpl::iterator it, end; end = AllocatedBuffers.end(); for (it = AllocatedBuffers.begin(); it != end; ++it) { delete *it; diff --git a/utils/TableGen/CodeGenDAGPatterns.cpp b/utils/TableGen/CodeGenDAGPatterns.cpp index 8e5bb7760f6..ee025a09877 100644 --- a/utils/TableGen/CodeGenDAGPatterns.cpp +++ b/utils/TableGen/CodeGenDAGPatterns.cpp @@ -438,7 +438,7 @@ bool EEVT::TypeSet::EnforceSmallerThan(EEVT::TypeSet &Other, TreePattern &TP) { int OtherIntSize = 0; int OtherFPSize = 0; - for (SmallVector::iterator TVI = + for (SmallVectorImpl::iterator TVI = Other.TypeVec.begin(); TVI != Other.TypeVec.end(); /* NULL */) { @@ -496,7 +496,7 @@ bool EEVT::TypeSet::EnforceSmallerThan(EEVT::TypeSet &Other, TreePattern &TP) { int IntSize = 0; int FPSize = 0; - for (SmallVector::iterator TVI = + for (SmallVectorImpl::iterator TVI = TypeVec.begin(); TVI != TypeVec.end(); /* NULL */) {