be much more careful about sending values backwards...
[model-checker.git] / action.cc
index b7bf024..3aeb737 100644 (file)
--- a/action.cc
+++ b/action.cc
@@ -415,3 +415,18 @@ void ModelAction::print() const
        } else
                printf("\n");
 }
        } else
                printf("\n");
 }
+
+/** @brief Print nicely-formatted info about this ModelAction */
+unsigned int ModelAction::hash() const
+{
+       unsigned int hash=(unsigned int) this->type;
+       hash^=((unsigned int)this->order)<<3;
+       hash^=seq_number<<5;
+       hash^=tid<<6;
+
+       if (is_read()) {
+               if (reads_from)
+                       hash^=reads_from->get_seq_number();
+       }
+       return hash;
+}