mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-03 08:51:43 +00:00
Use SmallVectorImpl::iterator/const_iterator instead of SmallVector to avoid specifying the vector size.
llvm-svn: 185606
This commit is contained in:
parent
f5e8037cf3
commit
783617eba7
@ -151,8 +151,8 @@ bool BranchProbabilityInfo::calcUnreachableHeuristics(BasicBlock *BB) {
|
||||
|
||||
uint32_t UnreachableWeight =
|
||||
std::max(UR_TAKEN_WEIGHT / (unsigned)UnreachableEdges.size(), MIN_WEIGHT);
|
||||
for (SmallVector<unsigned, 4>::iterator I = UnreachableEdges.begin(),
|
||||
E = UnreachableEdges.end();
|
||||
for (SmallVectorImpl<unsigned>::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<unsigned, 4>::iterator I = ReachableEdges.begin(),
|
||||
E = ReachableEdges.end();
|
||||
for (SmallVectorImpl<unsigned>::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<unsigned, 4>::iterator I = ColdEdges.begin(),
|
||||
E = ColdEdges.end();
|
||||
for (SmallVectorImpl<unsigned>::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<unsigned, 4>::iterator I = NormalEdges.begin(),
|
||||
E = NormalEdges.end();
|
||||
for (SmallVectorImpl<unsigned>::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<unsigned, 8>::iterator EI = BackEdges.begin(),
|
||||
for (SmallVectorImpl<unsigned>::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<unsigned, 8>::iterator EI = InEdges.begin(),
|
||||
for (SmallVectorImpl<unsigned>::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<unsigned, 8>::iterator EI = ExitingEdges.begin(),
|
||||
for (SmallVectorImpl<unsigned>::iterator EI = ExitingEdges.begin(),
|
||||
EE = ExitingEdges.end(); EI != EE; ++EI) {
|
||||
setEdgeWeight(BB, *EI, exitWeight);
|
||||
}
|
||||
|
@ -421,8 +421,8 @@ void LVIValueHandle::deleted() {
|
||||
if (I->second == getValPtr())
|
||||
ToErase.push_back(*I);
|
||||
}
|
||||
|
||||
for (SmallVector<OverDefinedPairTy, 4>::iterator I = ToErase.begin(),
|
||||
|
||||
for (SmallVectorImpl<OverDefinedPairTy>::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<OverDefinedPairTy, 4>::iterator I = ToErase.begin(),
|
||||
|
||||
for (SmallVectorImpl<OverDefinedPairTy>::iterator I = ToErase.begin(),
|
||||
E = ToErase.end(); I != E; ++I)
|
||||
OverDefinedCache.erase(*I);
|
||||
|
||||
|
@ -181,7 +181,7 @@ void ProfileEstimatorPass::recurseBasicBlock(BasicBlock *BB) {
|
||||
double incoming = BBWeight;
|
||||
// Subtract the flow leaving the loop.
|
||||
std::set<Edge> ProcessedExits;
|
||||
for (SmallVector<Edge, 8>::iterator ei = ExitEdges.begin(),
|
||||
for (SmallVectorImpl<Edge>::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<Edge, 8>::iterator ei = Edges.begin(), ee = Edges.end();
|
||||
for (SmallVectorImpl<Edge>::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<Edge, 8>::iterator ei = Edges.begin(), ee = Edges.end();
|
||||
for (SmallVectorImpl<Edge>::iterator ei = Edges.begin(), ee = Edges.end();
|
||||
ei != ee; ++ei) {
|
||||
if (ei != (ee-1)) {
|
||||
EdgeInformation[BB->getParent()][*ei] += fraction;
|
||||
|
@ -118,7 +118,7 @@ char *ExecutionEngine::getMemoryForGV(const GlobalVariable *GV) {
|
||||
}
|
||||
|
||||
bool ExecutionEngine::removeModule(Module *M) {
|
||||
for(SmallVector<Module *, 1>::iterator I = Modules.begin(),
|
||||
for(SmallVectorImpl<Module *>::iterator I = Modules.begin(),
|
||||
E = Modules.end(); I != E; ++I) {
|
||||
Module *Found = *I;
|
||||
if (Found == M) {
|
||||
|
@ -480,7 +480,7 @@ std::string DataLayout::getStringRepresentation() const {
|
||||
addrSpaces.push_back(pib->first);
|
||||
}
|
||||
std::sort(addrSpaces.begin(), addrSpaces.end());
|
||||
for (SmallVector<unsigned, 8>::iterator asb = addrSpaces.begin(),
|
||||
for (SmallVectorImpl<unsigned>::iterator asb = addrSpaces.begin(),
|
||||
ase = addrSpaces.end(); asb != ase; ++asb) {
|
||||
const PointerAlignElem &PI = Pointers.find(*asb)->second;
|
||||
OS << "-p";
|
||||
|
@ -63,7 +63,7 @@ bool GCOVFile::read(GCOVBuffer &Buffer) {
|
||||
|
||||
/// dump - Dump GCOVFile content on standard out for debugging purposes.
|
||||
void GCOVFile::dump() {
|
||||
for (SmallVector<GCOVFunction *, 16>::iterator I = Functions.begin(),
|
||||
for (SmallVectorImpl<GCOVFunction *>::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<GCOVFunction *, 16>::iterator I = Functions.begin(),
|
||||
for (SmallVectorImpl<GCOVFunction *>::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<GCOVBlock *, 16>::iterator I = Blocks.begin(),
|
||||
for (SmallVectorImpl<GCOVBlock *>::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<GCOVBlock *, 16>::iterator I = Blocks.begin(),
|
||||
for (SmallVectorImpl<GCOVBlock *>::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<uint32_t, 16>::iterator I = Edges.begin(), E = Edges.end();
|
||||
for (SmallVectorImpl<uint32_t>::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<uint32_t, 16>::iterator I = Lines.begin(),
|
||||
for (SmallVectorImpl<uint32_t>::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<uint32_t, 16>::iterator I = Lines.begin(),
|
||||
for (SmallVectorImpl<uint32_t>::iterator I = Lines.begin(),
|
||||
E = Lines.end(); I != E; ++I)
|
||||
outs() << (*I) << ",";
|
||||
}
|
||||
|
@ -322,7 +322,7 @@ Input::HNode *Input::createHNodes(Node *N) {
|
||||
}
|
||||
|
||||
bool Input::MapHNode::isValidKey(StringRef Key) {
|
||||
for (SmallVector<const char *, 6>::iterator i = ValidKeys.begin(),
|
||||
for (SmallVectorImpl<const char *>::iterator i = ValidKeys.begin(),
|
||||
End = ValidKeys.end(); i != End; ++i) {
|
||||
if (Key.equals(*i))
|
||||
return true;
|
||||
|
@ -1484,7 +1484,7 @@ namespace {
|
||||
unsigned &PredReg, ARMCC::CondCodes &Pred,
|
||||
bool &isT2);
|
||||
bool RescheduleOps(MachineBasicBlock *MBB,
|
||||
SmallVector<MachineInstr*, 4> &Ops,
|
||||
SmallVectorImpl<MachineInstr *> &Ops,
|
||||
unsigned Base, bool isLd,
|
||||
DenseMap<MachineInstr*, unsigned> &MI2LocMap);
|
||||
bool RescheduleLoadStoreInstrs(MachineBasicBlock *MBB);
|
||||
@ -1656,7 +1656,7 @@ namespace {
|
||||
}
|
||||
|
||||
bool ARMPreAllocLoadStoreOpt::RescheduleOps(MachineBasicBlock *MBB,
|
||||
SmallVector<MachineInstr*, 4> &Ops,
|
||||
SmallVectorImpl<MachineInstr *> &Ops,
|
||||
unsigned Base, bool isLd,
|
||||
DenseMap<MachineInstr*, unsigned> &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<MachineInstr*, 4> &Lds = Base2LdsMap[Base];
|
||||
SmallVectorImpl<MachineInstr *> &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<MachineInstr*, 4> &Sts = Base2StsMap[Base];
|
||||
SmallVectorImpl<MachineInstr *> &Sts = Base2StsMap[Base];
|
||||
if (Sts.size() > 1)
|
||||
RetVal |= RescheduleOps(MBB, Sts, Base, false, MI2LocMap);
|
||||
}
|
||||
|
@ -42,10 +42,10 @@ static void replaceFrameIndexes(MachineFunction &MF,
|
||||
SmallVector<std::pair<int,int64_t>, 16> &FR) {
|
||||
MachineFrameInfo *MFI = MF.getFrameInfo();
|
||||
MBlazeFunctionInfo *MBlazeFI = MF.getInfo<MBlazeFunctionInfo>();
|
||||
const SmallVector<std::pair<int,int64_t>, 16>::iterator FRB = FR.begin();
|
||||
const SmallVector<std::pair<int,int64_t>, 16>::iterator FRE = FR.end();
|
||||
const SmallVectorImpl<std::pair<int,int64_t>>::iterator FRB = FR.begin();
|
||||
const SmallVectorImpl<std::pair<int,int64_t>>::iterator FRE = FR.end();
|
||||
|
||||
SmallVector<std::pair<int,int64_t>, 16>::iterator FRI = FRB;
|
||||
SmallVectorImpl<std::pair<int,int64_t>>::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<int, 16> &LiveInFI = MBlazeFI->getLiveIn();
|
||||
const SmallVectorImpl<int> &LiveInFI = MBlazeFI->getLiveIn();
|
||||
SmallVector<MachineInstr*, 16> EraseInstr;
|
||||
SmallVector<std::pair<int,int64_t>, 16> FrameRelocate;
|
||||
|
||||
|
@ -420,7 +420,7 @@ bool MipsLongBranch::runOnMachineFunction(MachineFunction &F) {
|
||||
MF = &F;
|
||||
initMBBInfo();
|
||||
|
||||
SmallVector<MBBInfo, 16>::iterator I, E = MBBInfos.end();
|
||||
SmallVectorImpl<MBBInfo>::iterator I, E = MBBInfos.end();
|
||||
bool EverMadeChange = false, MadeChange = true;
|
||||
|
||||
while (MadeChange) {
|
||||
|
@ -29,7 +29,7 @@ class ManagedStringPool {
|
||||
public:
|
||||
ManagedStringPool() {}
|
||||
~ManagedStringPool() {
|
||||
SmallVector<std::string *, 8>::iterator Current = Pool.begin();
|
||||
SmallVectorImpl<std::string *>::iterator Current = Pool.begin();
|
||||
while (Current != Pool.end()) {
|
||||
delete *Current;
|
||||
Current++;
|
||||
|
@ -384,7 +384,7 @@ void GenericToNVVM::remapNamedMDNode(Module *M, NamedMDNode *N) {
|
||||
|
||||
// Replace the old operands with the new operands.
|
||||
N->dropAllReferences();
|
||||
for (SmallVector<MDNode *, 16>::iterator I = NewOperands.begin(),
|
||||
for (SmallVectorImpl<MDNode *>::iterator I = NewOperands.begin(),
|
||||
E = NewOperands.end();
|
||||
I != E; ++I) {
|
||||
N->addOperand(*I);
|
||||
|
@ -402,7 +402,7 @@ bool PPCCTRLoops::convertToCTRLoop(Loop *L) {
|
||||
BasicBlock *CountedExitBlock = 0;
|
||||
const SCEV *ExitCount = 0;
|
||||
BranchInst *CountedExitBranch = 0;
|
||||
for (SmallVector<BasicBlock*, 4>::iterator I = ExitingBlocks.begin(),
|
||||
for (SmallVectorImpl<BasicBlock *>::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 " <<
|
||||
|
@ -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<TerminatorInfo, 16>::iterator TI = Terminators.begin(),
|
||||
for (SmallVectorImpl<TerminatorInfo>::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<TerminatorInfo, 16>::iterator TI = Terminators.begin();
|
||||
BlockPosition Position(MF->getAlignment());
|
||||
for (SmallVector<MBBInfo, 16>::iterator BI = MBBs.begin(), BE = MBBs.end();
|
||||
for (SmallVectorImpl<MBBInfo>::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<TerminatorInfo, 16>::iterator TI = Terminators.begin();
|
||||
BlockPosition Position(MF->getAlignment());
|
||||
for (SmallVector<MBBInfo, 16>::iterator BI = MBBs.begin(), BE = MBBs.end();
|
||||
for (SmallVectorImpl<MBBInfo>::iterator BI = MBBs.begin(), BE = MBBs.end();
|
||||
BI != BE; ++BI) {
|
||||
skipNonTerminators(Position, *BI);
|
||||
for (unsigned BTI = 0, BTE = BI->NumTerminators; BTI != BTE; ++BTI) {
|
||||
|
@ -354,7 +354,7 @@ bool StripDeadDebugInfo::runOnModule(Module &M) {
|
||||
NMD->eraseFromParent();
|
||||
NMD = NULL;
|
||||
|
||||
for (SmallVector<MDNode *, 8>::iterator I = MDs.begin(),
|
||||
for (SmallVectorImpl<MDNode *>::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<MDNode *, 8>::iterator I = MDs.begin(),
|
||||
for (SmallVectorImpl<MDNode *>::iterator I = MDs.begin(),
|
||||
E = MDs.end(); I != E; ++I) {
|
||||
bool FnIsLive = false;
|
||||
if (Function *F = DISubprogram(*I).getFunction())
|
||||
|
@ -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<Value *, 16>::iterator J = NewClauses.begin() + j;
|
||||
SmallVectorImpl<Value *>::iterator J = NewClauses.begin() + j;
|
||||
// If Filter is empty then it is a subset of LFilter.
|
||||
if (!FElts) {
|
||||
// Discard LFilter.
|
||||
|
@ -43,7 +43,7 @@ BlackList::BlackList(const StringRef Path) {
|
||||
SmallVector<StringRef, 16> Lines;
|
||||
SplitString(File.take()->getBuffer(), Lines, "\n\r");
|
||||
StringMap<std::string> Regexps;
|
||||
for (SmallVector<StringRef, 16>::iterator I = Lines.begin(), E = Lines.end();
|
||||
for (SmallVectorImpl<StringRef>::iterator I = Lines.begin(), E = Lines.end();
|
||||
I != E; ++I) {
|
||||
// Ignore empty lines and lines starting with "#"
|
||||
if (I->empty() || I->startswith("#"))
|
||||
|
@ -271,7 +271,7 @@ namespace {
|
||||
|
||||
StringKeySort Sorter;
|
||||
std::sort(SortedLinesByFile.begin(), SortedLinesByFile.end(), Sorter);
|
||||
for (SmallVector<StringMapEntry<GCOVLines *> *, 32>::iterator
|
||||
for (SmallVectorImpl<StringMapEntry<GCOVLines *> *>::iterator
|
||||
I = SortedLinesByFile.begin(), E = SortedLinesByFile.end();
|
||||
I != E; ++I)
|
||||
(*I)->getValue()->writeOut();
|
||||
|
@ -83,7 +83,7 @@ bool ADCE::runOnFunction(Function& F) {
|
||||
I->dropAllReferences();
|
||||
}
|
||||
|
||||
for (SmallVector<Instruction*, 1024>::iterator I = worklist.begin(),
|
||||
for (SmallVectorImpl<Instruction *>::iterator I = worklist.begin(),
|
||||
E = worklist.end(); I != E; ++I) {
|
||||
++NumRemoved;
|
||||
(*I)->eraseFromParent();
|
||||
|
@ -1555,7 +1555,7 @@ bool GVN::PerformLoadPRE(LoadInst *LI, AvailValInBlkVect &ValuesPerBlock,
|
||||
return false;
|
||||
|
||||
// Split critical edges, and update the unavailable predecessors accordingly.
|
||||
for (SmallVector<BasicBlock *, 4>::iterator I = CriticalEdgePred.begin(),
|
||||
for (SmallVectorImpl<BasicBlock *>::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<Instruction*, 4>::iterator I = InstrsToErase.begin(),
|
||||
for (SmallVectorImpl<Instruction *>::iterator I = InstrsToErase.begin(),
|
||||
E = InstrsToErase.end(); I != E; ++I) {
|
||||
DEBUG(dbgs() << "GVN removed: " << **I << '\n');
|
||||
if (MD) MD->removeInstruction(*I);
|
||||
|
@ -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<DomTreeNode*, 8>::iterator DI = ChildNodes.begin(),
|
||||
for (SmallVectorImpl<DomTreeNode *>::iterator DI = ChildNodes.begin(),
|
||||
DE = ChildNodes.end(); DI != DE; ++DI) {
|
||||
DT.changeImmediateDominator(*DI, DT[preheader]);
|
||||
}
|
||||
|
@ -170,7 +170,7 @@ bool llvm::MergeBlockIntoPredecessor(BasicBlock *BB, Pass *P) {
|
||||
if (DomTreeNode *DTN = DT->getNode(BB)) {
|
||||
DomTreeNode *PredDTN = DT->getNode(PredBB);
|
||||
SmallVector<DomTreeNode*, 8> Children(DTN->begin(), DTN->end());
|
||||
for (SmallVector<DomTreeNode*, 8>::iterator DI = Children.begin(),
|
||||
for (SmallVectorImpl<DomTreeNode *>::iterator DI = Children.begin(),
|
||||
DE = Children.end(); DI != DE; ++DI)
|
||||
DT->changeImmediateDominator(*DI, PredDTN);
|
||||
|
||||
|
@ -277,8 +277,8 @@ void CodeExtractor::splitReturnBlocks() {
|
||||
|
||||
DomTreeNode *NewNode = DT->addNewBlock(New, *I);
|
||||
|
||||
for (SmallVector<DomTreeNode*, 8>::iterator I = Children.begin(),
|
||||
E = Children.end(); I != E; ++I)
|
||||
for (SmallVectorImpl<DomTreeNode *>::iterator I = Children.begin(),
|
||||
E = Children.end(); I != E; ++I)
|
||||
DT->changeImmediateDominator(*I, NewNode);
|
||||
}
|
||||
}
|
||||
|
@ -925,7 +925,7 @@ bool llvm::LowerDbgDeclare(Function &F) {
|
||||
if (Dbgs.empty())
|
||||
return false;
|
||||
|
||||
for (SmallVector<DbgDeclareInst *, 4>::iterator I = Dbgs.begin(),
|
||||
for (SmallVectorImpl<DbgDeclareInst *>::iterator I = Dbgs.begin(),
|
||||
E = Dbgs.end(); I != E; ++I) {
|
||||
DbgDeclareInst *DDI = *I;
|
||||
if (AllocaInst *AI = dyn_cast_or_null<AllocaInst>(DDI->getAddress())) {
|
||||
|
@ -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<BasicBlock*, 16>::iterator EntIt =
|
||||
SmallVectorImpl<BasicBlock *>::iterator EntIt =
|
||||
std::lower_bound(Preds.begin(), Preds.end(),
|
||||
SomePHI->getIncomingBlock(i));
|
||||
assert(EntIt != Preds.end() && *EntIt == SomePHI->getIncomingBlock(i)&&
|
||||
|
@ -1602,7 +1602,7 @@ namespace {
|
||||
DenseSet<ValuePair> CurrentPairs;
|
||||
|
||||
bool CanAdd = true;
|
||||
for (SmallVector<ValuePairWithDepth, 8>::iterator C2
|
||||
for (SmallVectorImpl<ValuePairWithDepth>::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<ValuePairWithDepth, 32>::iterator C2 = Q.begin(),
|
||||
for (SmallVectorImpl<ValuePairWithDepth>::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<ValuePairWithDepth, 8>::iterator C2
|
||||
for (SmallVectorImpl<ValuePairWithDepth>::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<ValuePairWithDepth, 8>::iterator C
|
||||
for (SmallVectorImpl<ValuePairWithDepth>::iterator C
|
||||
= BestChildren.begin(), E2 = BestChildren.end();
|
||||
C != E2; ++C) {
|
||||
size_t DepthF = getDepthFactor(C->first.first);
|
||||
|
@ -1444,7 +1444,7 @@ void FuncSLP::optimizeGatherSequence() {
|
||||
}
|
||||
|
||||
// Erase all of the instructions that we RAUWed.
|
||||
for (SmallVector<Instruction*, 16>::iterator v = ToRemove.begin(),
|
||||
for (SmallVectorImpl<Instruction *>::iterator v = ToRemove.begin(),
|
||||
ve = ToRemove.end(); v != ve; ++v) {
|
||||
assert((*v)->getNumUses() == 0 && "Can't remove instructions with uses");
|
||||
(*v)->eraseFromParent();
|
||||
|
@ -28,7 +28,7 @@ public:
|
||||
|
||||
virtual ~TestObjectCache() {
|
||||
// Free any buffers we've allocated.
|
||||
SmallVector<MemoryBuffer *, 2>::iterator it, end;
|
||||
SmallVectorImpl<MemoryBuffer *>::iterator it, end;
|
||||
end = AllocatedBuffers.end();
|
||||
for (it = AllocatedBuffers.begin(); it != end; ++it) {
|
||||
delete *it;
|
||||
|
@ -438,7 +438,7 @@ bool EEVT::TypeSet::EnforceSmallerThan(EEVT::TypeSet &Other, TreePattern &TP) {
|
||||
|
||||
int OtherIntSize = 0;
|
||||
int OtherFPSize = 0;
|
||||
for (SmallVector<MVT::SimpleValueType, 2>::iterator TVI =
|
||||
for (SmallVectorImpl<MVT::SimpleValueType>::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<MVT::SimpleValueType, 2>::iterator TVI =
|
||||
for (SmallVectorImpl<MVT::SimpleValueType>::iterator TVI =
|
||||
TypeVec.begin();
|
||||
TVI != TypeVec.end();
|
||||
/* NULL */) {
|
||||
|
Loading…
Reference in New Issue
Block a user