From: Ted Kremenek Date: Tue, 1 Jul 2008 22:30:13 +0000 (+0000) Subject: Added partial specialization of FoldingSetTrait for pointers. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=e1bf7fdcb4be19c556f4c789dd43864f5d13c5e4;p=oota-llvm.git Added partial specialization of FoldingSetTrait for pointers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52989 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/ADT/FoldingSet.h b/include/llvm/ADT/FoldingSet.h index c6696b30344..5f541aeaa4f 100644 --- a/include/llvm/ADT/FoldingSet.h +++ b/include/llvm/ADT/FoldingSet.h @@ -426,6 +426,18 @@ public: operator T&() { return data; } operator const T&() const { return data; } +}; + +//===----------------------------------------------------------------------===// +// Partial specializations of FoldingSetTrait. + +template struct FoldingSetTrait { + 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.