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
This commit is contained in:
Gabor Greif
2010-07-09 14:00:56 +00:00
parent 517e124d53
commit e07c3c46d0

View File

@@ -246,22 +246,25 @@ protected:
typename GraphT::NodeType* NewBBSucc = *GraphT::child_begin(NewBB); typename GraphT::NodeType* NewBBSucc = *GraphT::child_begin(NewBB);
std::vector<typename GraphT::NodeType*> PredBlocks; std::vector<typename GraphT::NodeType*> PredBlocks;
for (typename GraphTraits<Inverse<N> >::ChildIteratorType PI = typedef GraphTraits<Inverse<N> > InvTraits;
GraphTraits<Inverse<N> >::child_begin(NewBB), for (typename InvTraits::ChildIteratorType PI =
PE = GraphTraits<Inverse<N> >::child_end(NewBB); PI != PE; ++PI) InvTraits::child_begin(NewBB),
PE = InvTraits::child_end(NewBB); PI != PE; ++PI)
PredBlocks.push_back(*PI); PredBlocks.push_back(*PI);
assert(!PredBlocks.empty() && "No predblocks??"); assert(!PredBlocks.empty() && "No predblocks?");
bool NewBBDominatesNewBBSucc = true; bool NewBBDominatesNewBBSucc = true;
for (typename GraphTraits<Inverse<N> >::ChildIteratorType PI = for (typename InvTraits::ChildIteratorType PI =
GraphTraits<Inverse<N> >::child_begin(NewBBSucc), InvTraits::child_begin(NewBBSucc),
E = GraphTraits<Inverse<N> >::child_end(NewBBSucc); PI != E; ++PI) E = InvTraits::child_end(NewBBSucc); PI != E; ++PI) {
if (*PI != NewBB && !DT.dominates(NewBBSucc, *PI) && typename InvTraits::NodeType *N = *PI;
DT.isReachableFromEntry(*PI)) { if (N != NewBB && !DT.dominates(NewBBSucc, N) &&
DT.isReachableFromEntry(N)) {
NewBBDominatesNewBBSucc = false; NewBBDominatesNewBBSucc = false;
break; break;
} }
}
// Find NewBB's immediate dominator and create new dominator tree node for // Find NewBB's immediate dominator and create new dominator tree node for
// NewBB. // NewBB.