File tree Expand file tree Collapse file tree 1 file changed +18
-10
lines changed
Expand file tree Collapse file tree 1 file changed +18
-10
lines changed Original file line number Diff line number Diff line change @@ -117,17 +117,25 @@ class XrefItem
117117 int row () const ;
118118 bool operator ==(const XrefItem& other) const ;
119119 bool operator !=(const XrefItem& other) const ;
120- size_t operator ()(const XrefItem& item) const
120+ };
121+
122+ namespace std
123+ {
124+ template <> struct hash <XrefItem>
121125 {
122- size_t hash = std::hash<uint64_t >()(item.addr ());
123- hash ^= std::hash<int >()(item.type ()) + 0x9e3779b9 + (hash << 6 ) + (hash >> 2 );
124- hash ^= std::hash<int >()(item.direction ()) + 0x9e3779b9 + (hash << 6 ) + (hash >> 2 );
125- hash ^= std::hash<int >()(item.kind ()) + 0x9e3779b9 + (hash << 6 ) + (hash >> 2 );
126- hash ^= std::hash<size_t >()(item.instrId ()) + 0x9e3779b9 + (hash << 6 ) + (hash >> 2 );
127- hash ^= std::hash<uint64_t >()(item.func () ? item.func ()->GetStart () : 0 ) + 0x9e3779b9 + (hash << 6 ) + (hash >> 2 );
128- hash ^= std::hash<int >()(item.ilType ()) + 0x9e3779b9 + (hash << 6 ) + (hash >> 2 );
129- return hash;
130- }
126+ typedef XrefItem argument_type;
127+ size_t operator ()(argument_type const & item) const
128+ {
129+ size_t hash = std::hash<uint64_t >()(item.addr ());
130+ hash ^= std::hash<int >()(item.type ()) + 0x9e3779b9 + (hash << 6 ) + (hash >> 2 );
131+ hash ^= std::hash<int >()(item.direction ()) + 0x9e3779b9 + (hash << 6 ) + (hash >> 2 );
132+ hash ^= std::hash<int >()(item.kind ()) + 0x9e3779b9 + (hash << 6 ) + (hash >> 2 );
133+ hash ^= std::hash<size_t >()(item.instrId ()) + 0x9e3779b9 + (hash << 6 ) + (hash >> 2 );
134+ hash ^= std::hash<uint64_t >()(item.func () ? item.func ()->GetStart () : 0 ) + 0x9e3779b9 + (hash << 6 ) + (hash >> 2 );
135+ hash ^= std::hash<int >()(item.ilType ()) + 0x9e3779b9 + (hash << 6 ) + (hash >> 2 );
136+ return hash;
137+ }
138+ };
131139};
132140
133141/* !
You can’t perform that action at this time.
0 commit comments