projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2af8c51
)
add support for hashing nodehandles.
author
Chris Lattner
<sabre@nondot.org>
Tue, 15 Mar 2005 17:51:51 +0000
(17:51 +0000)
committer
Chris Lattner
<sabre@nondot.org>
Tue, 15 Mar 2005 17:51:51 +0000
(17:51 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20620
91177308
-0d34-0410-b5e6-
96231b3b80d8
include/llvm/Analysis/DataStructure/DSSupport.h
patch
|
blob
|
history
diff --git
a/include/llvm/Analysis/DataStructure/DSSupport.h
b/include/llvm/Analysis/DataStructure/DSSupport.h
index 08bb3ee17e5da3f645b6496e1280a62e3c110fae..52461f88448d25c1a9568f36a78846b0a2a57965 100644
(file)
--- 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 {
//===----------------------------------------------------------------------===//