aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/BasicBlock.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-09-30 22:20:34 +0000
committerChris Lattner <sabre@nondot.org>2006-09-30 22:20:34 +0000
commitcb4f10b4d5e9ba2e37e70424b290dd1187ca6ea7 (patch)
tree5ee8e111374a101fe3bbd198b08d8ab005bdd323 /include/llvm/BasicBlock.h
parentadc95467e41d6c46793f665168468cbf348c3638 (diff)
downloadexternal_llvm-cb4f10b4d5e9ba2e37e70424b290dd1187ca6ea7.zip
external_llvm-cb4f10b4d5e9ba2e37e70424b290dd1187ca6ea7.tar.gz
external_llvm-cb4f10b4d5e9ba2e37e70424b290dd1187ca6ea7.tar.bz2
Override use_back in instruction/basicblock to provide more type information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30678 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/BasicBlock.h')
-rw-r--r--include/llvm/BasicBlock.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/llvm/BasicBlock.h b/include/llvm/BasicBlock.h
index 551ca4d..f15d2b4 100644
--- a/include/llvm/BasicBlock.h
+++ b/include/llvm/BasicBlock.h
@@ -85,6 +85,11 @@ public:
BasicBlock *getPrev() { return Prev; }
const BasicBlock *getPrev() const { return Prev; }
+ /// use_back - Specialize the methods defined in Value, as we know that an
+ /// BasicBlock can only be used by Instructions (specifically PHI and terms).
+ Instruction *use_back() { return cast<Instruction>(*use_begin());}
+ const Instruction *use_back() const { return cast<Instruction>(*use_begin());}
+
/// getTerminator() - If this is a well formed basic block, then this returns
/// a pointer to the terminator instruction. If it is not, then you get a
/// null pointer back.