aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-08-04 02:42:17 +0000
committerChris Lattner <sabre@nondot.org>2004-08-04 02:42:17 +0000
commit0f42ba67771627453187e44fea935d6bab7a8152 (patch)
tree338972a54846719ac59fcdffe898489374a40a10 /include/llvm
parent07d7c9d9c508ec67a86ed572819d8cf9e3bdc422 (diff)
downloadexternal_llvm-0f42ba67771627453187e44fea935d6bab7a8152.zip
external_llvm-0f42ba67771627453187e44fea935d6bab7a8152.tar.gz
external_llvm-0f42ba67771627453187e44fea935d6bab7a8152.tar.bz2
Add a special version of getType for ConstantPointerNull, exposing the fact
that all Null pointers have pointer type git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15458 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r--include/llvm/Constants.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h
index 230d6ff..6afaa06 100644
--- a/include/llvm/Constants.h
+++ b/include/llvm/Constants.h
@@ -454,6 +454,13 @@ public:
virtual void destroyConstant();
+ /// getType - Specialize the getType() method to always return an PointerType,
+ /// which reduces the amount of casting needed in parts of the compiler.
+ ///
+ inline const PointerType *getType() const {
+ return reinterpret_cast<const PointerType*>(Value::getType());
+ }
+
/// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const ConstantPointerNull *) { return true; }
static bool classof(const Value *V) {