]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
rose: more hash member funcs for rose types
authorJustin Viiret <justin.viiret@intel.com>
Mon, 31 Jul 2017 06:22:08 +0000 (16:22 +1000)
committerMatthew Barr <matthew.barr@intel.com>
Mon, 21 Aug 2017 01:24:52 +0000 (11:24 +1000)
src/rose/rose_build_misc.cpp
src/rose/rose_build_role_aliasing.cpp
src/rose/rose_graph.h

index 450b2efbb94fb577c3dda5e80da13380de7d87b1..af2af5de6fa888d3bfa93ccbbdc84c77538c391b 100644 (file)
@@ -576,6 +576,9 @@ bool RoseSuffixInfo::operator<(const RoseSuffixInfo &b) const {
     return false;
 }
 
+size_t RoseSuffixInfo::hash() const {
+    return hash_all(top, graph, castle, rdfa, haig, tamarama);
+}
 
 void RoseSuffixInfo::reset(void) {
     top = 0;
@@ -691,7 +694,7 @@ set<u32> all_tops(const suffix_id &s) {
 }
 
 size_t suffix_id::hash() const {
-    return hash_all(g, c, d, h);
+    return hash_all(g, c, d, h, t);
 }
 
 bool isAnchored(const left_id &r) {
@@ -769,6 +772,10 @@ u64a findMaxOffset(const set<ReportID> &reports, const ReportManager &rm) {
     return maxOffset;
 }
 
+size_t LeftEngInfo::hash() const {
+    return hash_all(graph, castle, dfa, haig, tamarama, lag, leftfix_report);
+}
+
 void LeftEngInfo::reset(void) {
     graph.reset();
     castle.reset();
index b5e69ef9465b0eff83a68ba7eac2fffd044d9421..ba71a3eaa653b676a6e85e03f77b44f7b764ae36 100644 (file)
@@ -1468,7 +1468,7 @@ void splitByReportSuffixBehaviour(const RoseGraph &g,
                                   vector<vector<RoseVertex>> &buckets) {
     // Split by report set and suffix info.
     auto make_split_key = [&g](RoseVertex v) {
-        return hash_all(g[v].reports, suffix_id(g[v].suffix));
+        return hash_all(g[v].reports, g[v].suffix);
     };
     splitAndFilterBuckets(buckets, make_split_key);
 }
index d1181063a2cc3e657cd59a5f001eed8f3aefe0c5..2c5ebbe99e3e8a0ea9ce3753653c1f1146477575 100644 (file)
@@ -111,6 +111,7 @@ struct LeftEngInfo {
         ORDER_CHECK(leftfix_report);
         return false;
     }
+    size_t hash() const;
     void reset(void);
     operator bool() const;
     bool tracksSom() const { return !!haig; }
@@ -131,6 +132,7 @@ struct RoseSuffixInfo {
     bool operator==(const RoseSuffixInfo &b) const;
     bool operator!=(const RoseSuffixInfo &b) const { return !(*this == b); }
     bool operator<(const RoseSuffixInfo &b) const;
+    size_t hash() const;
     void reset(void);
     operator bool() const { return graph || castle || haig || rdfa || tamarama; }
 };