diff --git a/include/llvm/Analysis/DataStructure/DSSupport.h b/include/llvm/Analysis/DataStructure/DSSupport.h index 08bb3ee17e5..52461f88448 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 &NH1, llvm::DSNodeHandle &NH2) { NH1.swap(NH2); } } +namespace HASH_NAMESPACE { + // Provide a hash function for arbitrary pointers... + template <> struct hash { + inline size_t operator()(const llvm::DSNodeHandle &Val) const { + return hash()(Val.getNode()) ^ Val.getOffset(); + } + }; +} + namespace llvm { //===----------------------------------------------------------------------===//