Use the Support/iterator file to abstract out compiler differences
[oota-llvm.git] / include / llvm / Type.h
index 125fbc1d27bb03c62c242da55a9a80e3e71a6160..8cb4b581fcfb322a1d95a32af495ba3328796548 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "llvm/Value.h"
 #include "Support/GraphTraits.h"
+#include "Support/iterator"
 
 class DerivedType;
 class FunctionType;
@@ -228,8 +229,7 @@ public:
 #include "llvm/Type.def"
 
 private:
-  class TypeIterator : public std::bidirectional_iterator<const Type,
-                                                         ptrdiff_t> {
+  class TypeIterator : public bidirectional_iterator<const Type, ptrdiff_t> {
     const Type * const Ty;
     unsigned Idx;
 
@@ -294,11 +294,8 @@ template <> struct GraphTraits<const Type*> {
   }
 };
 
-template <> inline bool isa<PointerType, const Type*>(const Type *Ty) { 
-  return Ty->getPrimitiveID() == Type::PointerTyID;
-}
-template <> inline bool isa<PointerType, Type*>(Type *Ty) { 
-  return Ty->getPrimitiveID() == Type::PointerTyID;
+template <> inline bool isa_impl<PointerType, Type>(const Type &Ty) { 
+  return Ty.getPrimitiveID() == Type::PointerTyID;
 }
 
 #endif