add support for hashing nodehandles.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20620 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2005-03-15 17:51:51 +00:00
parent 2af8c5185a
commit adea6306d4

View File

@ -146,6 +146,15 @@ namespace std {
inline void swap<llvm::DSNodeHandle>(llvm::DSNodeHandle &NH1, llvm::DSNodeHandle &NH2) { NH1.swap(NH2); }
}
namespace HASH_NAMESPACE {
// Provide a hash function for arbitrary pointers...
template <> struct hash<llvm::DSNodeHandle> {
inline size_t operator()(const llvm::DSNodeHandle &Val) const {
return hash<void*>()(Val.getNode()) ^ Val.getOffset();
}
};
}
namespace llvm {
//===----------------------------------------------------------------------===//