ADT: Remove last implicit ilist iterator conversions, NFC
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Sat, 7 Nov 2015 00:01:16 +0000 (00:01 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Sat, 7 Nov 2015 00:01:16 +0000 (00:01 +0000)
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

lib/Analysis/ScalarEvolutionExpander.cpp
lib/Target/Hexagon/BitTracker.cpp
lib/Transforms/IPO/FunctionAttrs.cpp
lib/Transforms/Scalar/LoopLoadElimination.cpp
lib/Transforms/Utils/SimplifyCFG.cpp
tools/llvm-stress/llvm-stress.cpp

index b3b04ad..d763ca4 100644 (file)
@@ -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 {
index 23336b6..ea96eb0 100644 (file)
@@ -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));
index bc7c98e..a9bc8e4 100644 (file)
@@ -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;
   }
 
index eb64fbf..e0456a2 100644 (file)
@@ -373,7 +373,7 @@ public:
     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());
 
index 25b83e2..e0c598f 100644 (file)
@@ -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)
@@ -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);
 
@@ -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;
index 6a1a248..86ac269 100644 (file)
@@ -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()) {