diff options
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 |