aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-08-17 06:34:37 +0000
committerChris Lattner <sabre@nondot.org>2005-08-17 06:34:37 +0000
commitbb20372e70cbba598a4abbb77ca489fed61aebe0 (patch)
treefa0b62f6733e481f16f7d8e0695709dc858fc36d /include/llvm/Transforms
parentfae59b99b8d1942f30a4be609423282c3fd62dd8 (diff)
downloadexternal_llvm-bb20372e70cbba598a4abbb77ca489fed61aebe0.zip
external_llvm-bb20372e70cbba598a4abbb77ca489fed61aebe0.tar.gz
external_llvm-bb20372e70cbba598a4abbb77ca489fed61aebe0.tar.bz2
add a helper
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22823 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Transforms')
-rw-r--r--include/llvm/Transforms/Utils/BasicBlockUtils.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/llvm/Transforms/Utils/BasicBlockUtils.h b/include/llvm/Transforms/Utils/BasicBlockUtils.h
index 68e483c..7a67df5 100644
--- a/include/llvm/Transforms/Utils/BasicBlockUtils.h
+++ b/include/llvm/Transforms/Utils/BasicBlockUtils.h
@@ -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