From bb20372e70cbba598a4abbb77ca489fed61aebe0 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 17 Aug 2005 06:34:37 +0000 Subject: [PATCH] add a helper git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22823 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Transforms/Utils/BasicBlockUtils.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/llvm/Transforms/Utils/BasicBlockUtils.h b/include/llvm/Transforms/Utils/BasicBlockUtils.h index 68e483c0bc7..7a67df537f5 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 -- 2.34.1