From: Gabor Greif Date: Fri, 9 Jul 2010 14:00:56 +0000 (+0000) Subject: refactor type expressions and cache operator*'s result X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=e07c3c46d0b5adb7d7af876fd3ea3703aebc47c1;p=oota-llvm.git refactor type expressions and cache operator*'s result git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107964 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Analysis/Dominators.h b/include/llvm/Analysis/Dominators.h index d83573f702d..1ffde368d89 100644 --- a/include/llvm/Analysis/Dominators.h +++ b/include/llvm/Analysis/Dominators.h @@ -246,22 +246,25 @@ protected: typename GraphT::NodeType* NewBBSucc = *GraphT::child_begin(NewBB); std::vector PredBlocks; - for (typename GraphTraits >::ChildIteratorType PI = - GraphTraits >::child_begin(NewBB), - PE = GraphTraits >::child_end(NewBB); PI != PE; ++PI) + typedef GraphTraits > InvTraits; + for (typename InvTraits::ChildIteratorType PI = + InvTraits::child_begin(NewBB), + PE = InvTraits::child_end(NewBB); PI != PE; ++PI) PredBlocks.push_back(*PI); - assert(!PredBlocks.empty() && "No predblocks??"); + assert(!PredBlocks.empty() && "No predblocks?"); bool NewBBDominatesNewBBSucc = true; - for (typename GraphTraits >::ChildIteratorType PI = - GraphTraits >::child_begin(NewBBSucc), - E = GraphTraits >::child_end(NewBBSucc); PI != E; ++PI) - if (*PI != NewBB && !DT.dominates(NewBBSucc, *PI) && - DT.isReachableFromEntry(*PI)) { + for (typename InvTraits::ChildIteratorType PI = + InvTraits::child_begin(NewBBSucc), + E = InvTraits::child_end(NewBBSucc); PI != E; ++PI) { + typename InvTraits::NodeType *N = *PI; + if (N != NewBB && !DT.dominates(NewBBSucc, N) && + DT.isReachableFromEntry(N)) { NewBBDominatesNewBBSucc = false; break; } + } // Find NewBB's immediate dominator and create new dominator tree node for // NewBB.