aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Transforms/Utils/BasicBlockUtils.h
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2010-02-16 19:49:17 +0000
committerBob Wilson <bob.wilson@apple.com>2010-02-16 19:49:17 +0000
commitadb6f226714dcfae363f51b453c4590b0f42da5e (patch)
treeb47715c7e30550eed4a68f7744f6cd1470887d50 /include/llvm/Transforms/Utils/BasicBlockUtils.h
parent7fca2294dad873aa7873e338ec3fcc4db49ea074 (diff)
downloadexternal_llvm-adb6f226714dcfae363f51b453c4590b0f42da5e.tar.gz
external_llvm-adb6f226714dcfae363f51b453c4590b0f42da5e.tar.bz2
external_llvm-adb6f226714dcfae363f51b453c4590b0f42da5e.zip
Refactor to share code to find the position of a basic block successor in the
terminator's list of successors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96377 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Transforms/Utils/BasicBlockUtils.h')
-rw-r--r--include/llvm/Transforms/Utils/BasicBlockUtils.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/llvm/Transforms/Utils/BasicBlockUtils.h b/include/llvm/Transforms/Utils/BasicBlockUtils.h
index 3f4571ebdd..281437150f 100644
--- a/include/llvm/Transforms/Utils/BasicBlockUtils.h
+++ b/include/llvm/Transforms/Utils/BasicBlockUtils.h
@@ -102,6 +102,11 @@ void FindFunctionBackedges(const Function &F,
//
void RemoveSuccessor(TerminatorInst *TI, unsigned SuccNum);
+/// SuccessorNumber - Search for the specified successor of basic block BB and
+/// return its position in the terminator instruction's list of successors.
+/// It is an error to call this with a block that is not a successor.
+unsigned SuccessorNumber(BasicBlock *BB, BasicBlock *Succ);
+
/// isCriticalEdge - Return true if the specified edge is a critical edge.
/// Critical edges are edges from a block with multiple successors to a block
/// with multiple predecessors.