simplify
authorDevang Patel <dpatel@apple.com>
Mon, 11 Jun 2007 21:25:31 +0000 (21:25 +0000)
committerDevang Patel <dpatel@apple.com>
Mon, 11 Jun 2007 21:25:31 +0000 (21:25 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37541 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/LoopSimplify.cpp

index 4a98b3fd3550d2fab42639369f8fa793e3a4eaab..8578faf76f6882ebf132236b4371b9f0f6cfbebd 100644 (file)
@@ -708,10 +708,9 @@ static bool BlockDominatesAny(BasicBlock* A, const std::vector<BasicBlock*>& B,
 void LoopSimplify::UpdateDomInfoForRevectoredPreds(BasicBlock *NewBB,
                                          std::vector<BasicBlock*> &PredBlocks) {
   assert(!PredBlocks.empty() && "No predblocks??");
-  assert(succ_begin(NewBB) != succ_end(NewBB) &&
-         ++succ_begin(NewBB) == succ_end(NewBB) &&
-         "NewBB should have a single successor!");
-  BasicBlock *NewBBSucc = *succ_begin(NewBB);
+  assert(NewBB->getTerminator()->getNumSuccessors() == 1
+         && "NewBB should have a single successor!");
+  BasicBlock *NewBBSucc = NewBB->getTerminator()->getSuccessor(0);
   DominatorTree &DT = getAnalysis<DominatorTree>();
 
   // The newly inserted basic block will dominate existing basic blocks iff the