diff options
-rw-r--r-- | include/llvm/Analysis/Dominators.h | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/include/llvm/Analysis/Dominators.h b/include/llvm/Analysis/Dominators.h index 0bb98ec6a8..b9ac2805c9 100644 --- a/include/llvm/Analysis/Dominators.h +++ b/include/llvm/Analysis/Dominators.h @@ -249,26 +249,26 @@ protected: PE = GraphTraits<Inverse<N> >::child_end(NewBB); PI != PE; ++PI) PredBlocks.push_back(*PI); - assert(!PredBlocks.empty() && "No predblocks??"); - - // The newly inserted basic block will dominate existing basic blocks iff the - // PredBlocks dominate all of the non-pred blocks. If all predblocks dominate - // the non-pred blocks, then they all must be the same block! - // - bool NewBBDominatesNewBBSucc = true; - { - typename GraphT::NodeType* OnePred = PredBlocks[0]; - size_t i = 1, e = PredBlocks.size(); - for (i = 1; !DT.isReachableFromEntry(OnePred); ++i) { - assert(i != e && "Didn't find reachable pred?"); - OnePred = PredBlocks[i]; - } + assert(!PredBlocks.empty() && "No predblocks??"); + + // The newly inserted basic block will dominate existing basic blocks iff the + // PredBlocks dominate all of the non-pred blocks. If all predblocks dominate + // the non-pred blocks, then they all must be the same block! + // + bool NewBBDominatesNewBBSucc = true; + { + typename GraphT::NodeType* OnePred = PredBlocks[0]; + size_t i = 1, e = PredBlocks.size(); + for (i = 1; !DT.isReachableFromEntry(OnePred); ++i) { + assert(i != e && "Didn't find reachable pred?"); + OnePred = PredBlocks[i]; + } - for (; i != e; ++i) - if (PredBlocks[i] != OnePred && DT.isReachableFromEntry(OnePred)) { - NewBBDominatesNewBBSucc = false; - break; - } + for (; i != e; ++i) + if (PredBlocks[i] != OnePred && DT.isReachableFromEntry(OnePred)) { + NewBBDominatesNewBBSucc = false; + break; + } if (NewBBDominatesNewBBSucc) for (typename GraphTraits<Inverse<N> >::ChildIteratorType PI = @@ -288,7 +288,7 @@ protected: for (typename GraphTraits<Inverse<N> >::ChildIteratorType PI = GraphTraits<Inverse<N> >::child_begin(NewBBSucc), E = GraphTraits<Inverse<N> >::child_end(NewBBSucc); PI != E; ++PI) - if (*PI != NewBB && !DT.dominates(NewBBSucc, *PI)) { + if (*PI != NewBB && !DT.dominates(NewBBSucc, *PI)) { NewBBDominatesNewBBSucc = false; break; } |