Added partial specialization of FoldingSetTrait for pointers.
authorTed Kremenek <kremenek@apple.com>
Tue, 1 Jul 2008 22:30:13 +0000 (22:30 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 1 Jul 2008 22:30:13 +0000 (22:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52989 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/FoldingSet.h

index c6696b30344421ddfb456b83591687d54404ed85..5f541aeaa4f0812f6007ad8b2473f60088f8036f 100644 (file)
@@ -426,6 +426,18 @@ public:
 
   operator T&() { return data; }
   operator const T&() const { return data; }
+};  
+  
+//===----------------------------------------------------------------------===//
+// Partial specializations of FoldingSetTrait.
+
+template<typename T> struct FoldingSetTrait<T*> {
+  static inline void Profile(const T* X, FoldingSetNodeID& ID) {
+    ID.AddPointer(X);
+  }
+  static inline void Profile(T* X, FoldingSetNodeID& ID) {
+    ID.AddPointer(X);
+  }
 };
 
 } // End of namespace llvm.