aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Analysis
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-03-15 17:51:51 +0000
committerChris Lattner <sabre@nondot.org>2005-03-15 17:51:51 +0000
commitadea6306d413d1352c07c08c1bc9cdf8a29e3a51 (patch)
tree5dbf70763d095564cafdba385346bc06e56dc819 /include/llvm/Analysis
parent2af8c5185a18f96429432f2c15b2425ac429f0fd (diff)
downloadexternal_llvm-adea6306d413d1352c07c08c1bc9cdf8a29e3a51.zip
external_llvm-adea6306d413d1352c07c08c1bc9cdf8a29e3a51.tar.gz
external_llvm-adea6306d413d1352c07c08c1bc9cdf8a29e3a51.tar.bz2
add support for hashing nodehandles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20620 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis')
-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 08bb3ee..52461f8 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 {
//===----------------------------------------------------------------------===//