summaryrefslogtreecommitdiff
path: root/include/llvm/Type.h
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-03-30 18:05:52 +0000
committerDouglas Gregor <dgregor@apple.com>2010-03-30 18:05:52 +0000
commit0179e977234fef45b1877eb93a3c7565cdd1862d (patch)
treed4e9f8ead35ae48243eb766183aa3b6602585b3d /include/llvm/Type.h
parent7a8cf2822de1c69551588fc4395bdd0fec18611f (diff)
downloadllvm-0179e977234fef45b1877eb93a3c7565cdd1862d.tar.gz
llvm-0179e977234fef45b1877eb93a3c7565cdd1862d.tar.bz2
llvm-0179e977234fef45b1877eb93a3c7565cdd1862d.tar.xz
Switch isa_impl from a function template to a class template with a
static inline member function doit(). This enables the use of partial specialization to override the last stage of the "isa" check. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99898 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Type.h')
-rw-r--r--include/llvm/Type.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/llvm/Type.h b/include/llvm/Type.h
index d09913a1df..df3a16c592 100644
--- a/include/llvm/Type.h
+++ b/include/llvm/Type.h
@@ -548,9 +548,11 @@ template <> struct GraphTraits<const Type*> {
}
};
-template <> inline bool isa_impl<PointerType, Type>(const Type &Ty) {
- return Ty.getTypeID() == Type::PointerTyID;
-}
+template <> struct isa_impl<PointerType, Type> {
+ static inline bool doit(const Type &Ty) {
+ return Ty.getTypeID() == Type::PointerTyID;
+ }
+};
raw_ostream &operator<<(raw_ostream &OS, const Type &T);