cyclegraph: RMW atomicity violation must flag a cycle
[model-checker.git] / cyclegraph.h
index f2f30329203c226c5a7a1c6140fa3043bb260613..5f6974b9033f3950af16f7108270bc427c2c9ce5 100644 (file)
@@ -26,7 +26,6 @@ class CycleGraph {
        ~CycleGraph();
        void addEdge(const ModelAction *from, const ModelAction *to);
        bool checkForCycles() const;
-       bool checkForRMWViolation() const;
        void addRMWEdge(const ModelAction *from, const ModelAction *rmw);
        bool checkPromise(const ModelAction *from, Promise *p) const;
        bool checkReachable(const ModelAction *from, const ModelAction *to) const;
@@ -40,9 +39,10 @@ class CycleGraph {
 
        SNAPSHOTALLOC
  private:
+       void addEdge(CycleNode *fromnode, CycleNode *tonode);
        void putNode(const ModelAction *act, CycleNode *node);
        CycleNode * getNode(const ModelAction *);
-       HashTable<CycleNode *, CycleNode *, uintptr_t, 4, model_malloc, model_calloc, model_free> *discovered;
+       HashTable<const CycleNode *, const CycleNode *, uintptr_t, 4, model_malloc, model_calloc, model_free> *discovered;
 
        /** @brief A table for mapping ModelActions to CycleNodes */
        HashTable<const ModelAction *, CycleNode *, uintptr_t, 4> actionToNode;
@@ -50,15 +50,12 @@ class CycleGraph {
        std::vector<CycleNode *> nodeList;
 #endif
 
-       bool checkReachable(CycleNode *from, CycleNode *to) const;
+       bool checkReachable(const CycleNode *from, const CycleNode *to) const;
 
        /** @brief A flag: true if this graph contains cycles */
        bool hasCycles;
        bool oldCycles;
 
-       bool hasRMWViolation;
-       bool oldRMWViolation;
-
        std::vector< CycleNode *, SnapshotAlloc<CycleNode *> > rollbackvector;
        std::vector< CycleNode *, SnapshotAlloc<CycleNode *> > rmwrollbackvector;
 };