mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-14 00:14:19 +00:00
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:
parent
2af8c5185a
commit
adea6306d4
@ -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 {
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
Loading…
x
Reference in New Issue
Block a user