aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm/Analysis/DataStructure/DSSupport.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/llvm/Analysis/DataStructure/DSSupport.h b/include/llvm/Analysis/DataStructure/DSSupport.h
index 08bb3ee17e..52461f8844 100644
--- a/include/llvm/Analysis/DataStructure/DSSupport.h
+++ b/include/llvm/Analysis/DataStructure/DSSupport.h
@@ -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 {
//===----------------------------------------------------------------------===//