add a helper

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22823 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2005-08-17 06:34:37 +00:00
parent fae59b99b8
commit bb20372e70

View File

@ -84,6 +84,13 @@ inline bool SplitCriticalEdge(BasicBlock *Succ, pred_iterator PI, Pass *P = 0) {
return MadeChange;
}
inline bool SplitCriticalEdge(BasicBlock *Src, BasicBlock *Dst, Pass *P = 0) {
for (succ_iterator SI = succ_begin(Src); ; ++SI) {
assert(SI != succ_end(Src) && "Edge doesn't exist");
if (*SI == Dst)
return SplitCriticalEdge(Src, SI, P);
}
}
} // End llvm namespace
#endif