Skip to content

Commit

Permalink
ADT: Remove last implicit ilist iterator conversions, NFC
Browse files Browse the repository at this point in the history
Some implicit ilist iterator conversions have crept back into Analysis,
Transforms, Hexagon, and llvm-stress.  This removes them.

I'll commit a patch immediately after this to disallow them (in a
separate patch so that it's easy to revert if necessary).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252371 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
dexonsmith committed Nov 7, 2015
1 parent 780c417 commit 5013c51
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
6 changes: 3 additions & 3 deletions lib/Analysis/ScalarEvolutionExpander.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ static BasicBlock::iterator findInsertPointAfter(Instruction *I,
if (isa<LandingPadInst>(IP) || isa<CleanupPadInst>(IP)) {
++IP;
} else if (auto *TPI = dyn_cast<TerminatePadInst>(IP)) {
IP = TPI->getUnwindDest()->getFirstNonPHI();
IP = TPI->getUnwindDest()->getFirstNonPHI()->getIterator();
} else if (auto *CEPI = dyn_cast<CatchEndPadInst>(IP)) {
IP = CEPI->getUnwindDest()->getFirstNonPHI();
IP = CEPI->getUnwindDest()->getFirstNonPHI()->getIterator();
} else if (auto *CEPI = dyn_cast<CleanupEndPadInst>(IP)) {
IP = CEPI->getUnwindDest()->getFirstNonPHI();
IP = CEPI->getUnwindDest()->getFirstNonPHI()->getIterator();
} else if (isa<CatchPadInst>(IP)) {
IP = MustDominate->getFirstInsertionPt();
} else {
Expand Down
2 changes: 1 addition & 1 deletion lib/Target/Hexagon/BitTracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1106,7 +1106,7 @@ void BT::run() {
if (It == End) {
MachineFunction::const_iterator BIt = B.getIterator();
MachineFunction::const_iterator Next = std::next(BIt);
if (Next != MF.end() && B.isSuccessor(Next)) {
if (Next != MF.end() && B.isSuccessor(&*Next)) {
int ThisN = B.getNumber();
int NextN = Next->getNumber();
FlowQ.push(CFGEdge(ThisN, NextN));
Expand Down
2 changes: 1 addition & 1 deletion lib/Transforms/IPO/FunctionAttrs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ struct ArgumentUsesTracker : public CaptureTracker {
return true;
}

Uses.push_back(std::next(F->arg_begin(), UseIndex));
Uses.push_back(&*std::next(F->arg_begin(), UseIndex));
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Transforms/Scalar/LoopLoadElimination.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ class LoadEliminationForLoop {
Value *Initial =
new LoadInst(InitialPtr, "load_initial", PH->getTerminator());
PHINode *PHI = PHINode::Create(Initial->getType(), 2, "store_forwarded",
L->getHeader()->begin());
&L->getHeader()->front());
PHI->addIncoming(Initial, PH);
PHI->addIncoming(Cand.Store->getOperand(0), L->getLoopLatch());

Expand Down
9 changes: 5 additions & 4 deletions lib/Transforms/Utils/SimplifyCFG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2400,7 +2400,7 @@ static Value *ensureValueAvailableInSuccessor(Value *V, BasicBlock *BB,
if (PHI)
return PHI;

PHI = PHINode::Create(V->getType(), 2, "simplifycfg.merge", Succ->begin());
PHI = PHINode::Create(V->getType(), 2, "simplifycfg.merge", &Succ->front());
PHI->addIncoming(V, BB);
for (BasicBlock *PredBB : predecessors(Succ))
if (PredBB != BB)
Expand Down Expand Up @@ -2500,8 +2500,8 @@ static bool mergeConditionalStoreToAddress(BasicBlock *PTB, BasicBlock *PFB,
Value *QPHI = ensureValueAvailableInSuccessor(QStore->getValueOperand(),
QStore->getParent(), PPHI);

IRBuilder<> QB(PostBB->getFirstInsertionPt());
IRBuilder<> QB(&*PostBB->getFirstInsertionPt());

Value *PPred = PStore->getParent() == PTB ? PCond : QB.CreateNot(PCond);
Value *QPred = QStore->getParent() == QTB ? QCond : QB.CreateNot(QCond);

Expand All @@ -2511,7 +2511,8 @@ static bool mergeConditionalStoreToAddress(BasicBlock *PTB, BasicBlock *PFB,
QPred = QB.CreateNot(QPred);
Value *CombinedPred = QB.CreateOr(PPred, QPred);

auto *T = SplitBlockAndInsertIfThen(CombinedPred, QB.GetInsertPoint(), false);
auto *T =
SplitBlockAndInsertIfThen(CombinedPred, &*QB.GetInsertPoint(), false);
QB.SetInsertPoint(T);
StoreInst *SI = cast<StoreInst>(QB.CreateStore(QPHI, Address));
AAMDNodes AAMD;
Expand Down
2 changes: 1 addition & 1 deletion tools/llvm-stress/llvm-stress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ static void IntroduceControlFlow(Function *F, Random &R) {

for (auto *Instr : BoolInst) {
BasicBlock *Curr = Instr->getParent();
BasicBlock::iterator Loc = Instr;
BasicBlock::iterator Loc = Instr->getIterator();
BasicBlock *Next = Curr->splitBasicBlock(Loc, "CF");
Instr->moveBefore(Curr->getTerminator());
if (Curr != &F->getEntryBlock()) {
Expand Down

0 comments on commit 5013c51

Please sign in to comment.