diff options
author | Chris Lattner <sabre@nondot.org> | 2001-10-01 13:58:13 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2001-10-01 13:58:13 +0000 |
commit | 7295eb4ea3e3a81e697600cbca681674e4b35a20 (patch) | |
tree | 142d6b6d26c0be5a9588e6c99970b83ad25744af /include/llvm/Type.h | |
parent | 6bad546c2a4eac51eabc6ac398861dcf7d5f18bb (diff) | |
download | llvm-7295eb4ea3e3a81e697600cbca681674e4b35a20.tar.gz llvm-7295eb4ea3e3a81e697600cbca681674e4b35a20.tar.bz2 llvm-7295eb4ea3e3a81e697600cbca681674e4b35a20.tar.xz |
Add support for newer cleaner isa, cast, dyn_cast
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@693 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Type.h')
-rw-r--r-- | include/llvm/Type.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/llvm/Type.h b/include/llvm/Type.h index 5854062df0..2a43153acd 100644 --- a/include/llvm/Type.h +++ b/include/llvm/Type.h @@ -195,6 +195,12 @@ public: return (const DerivedType*)this; } + // Methods for support type inquiry through isa, cast, and dyn_cast: + static inline bool isa(const Type *T) { return true; } + static inline bool isa(const Value *V) { + return V->getValueType() == Value::TypeVal; + } + // Methods for determining the subtype of this Type. The cast*() methods are // equilivent to using dynamic_cast<>... if the cast is successful, this is // returned, otherwise you get a null pointer, allowing expressions like this: |