diff options
author | Chris Lattner <sabre@nondot.org> | 2005-02-24 02:37:26 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-02-24 02:37:26 +0000 |
commit | ad993cbb77b26b36cee938686b3377c0d92abd5e (patch) | |
tree | 68c0f3cf7164f23a6a037f1d276b429ace21216b /include/llvm/BasicBlock.h | |
parent | 00aaadf9f04b37abc0c5b2b4dfdef1130993a054 (diff) |
add a new method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20293 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/BasicBlock.h')
-rw-r--r-- | include/llvm/BasicBlock.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/llvm/BasicBlock.h b/include/llvm/BasicBlock.h index 2b1c3e0eea..2b7b630136 100644 --- a/include/llvm/BasicBlock.h +++ b/include/llvm/BasicBlock.h @@ -107,7 +107,12 @@ public: /// void eraseFromParent(); - + /// getSinglePredecessor - If this basic block has a single predecessor block, + /// return the block, otherwise return a null pointer. + BasicBlock *getSinglePredecessor(); + const BasicBlock *getSinglePredecessor() const { + return const_cast<BasicBlock*>(this)->getSinglePredecessor(); + } //===--------------------------------------------------------------------===// /// Instruction iterator methods |