X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11tester.git;a=blobdiff_plain;f=cyclegraph.h;h=556af1cfdd04627c8b9a5d70d05c3078b01c3469;hp=1a3e0eb63f722b95c11b416373e4ca39a9069ddb;hb=f750120c93252f2b677c4b07d003fc71fcdaaa00;hpb=b3b2aa79d695bcef7f7f862aca7d1dffa334b3b8 diff --git a/cyclegraph.h b/cyclegraph.h index 1a3e0eb6..556af1cf 100644 --- a/cyclegraph.h +++ b/cyclegraph.h @@ -16,10 +16,7 @@ #include "config.h" #include "mymemory.h" #include "stl-model.h" - -class Promise; -class CycleNode; -class ModelAction; +#include "classlist.h" /** @brief A graph of Model Actions for tracking cycles. */ class CycleGraph { @@ -34,7 +31,6 @@ class CycleGraph { void addRMWEdge(const T *from, const ModelAction *rmw); bool checkForCycles() const; - bool checkPromise(const ModelAction *from, Promise *p) const; template bool checkReachable(const T *from, const U *to) const; @@ -50,19 +46,13 @@ class CycleGraph { template void dot_print_edge(FILE *file, const T *from, const U *to, const char *prop); #endif - - bool resolvePromise(const Promise *promise, ModelAction *writer); + CycleNode * getNode_noCreate(const ModelAction *act) const; SNAPSHOTALLOC private: bool addNodeEdge(CycleNode *fromnode, CycleNode *tonode); void putNode(const ModelAction *act, CycleNode *node); - void putNode(const Promise *promise, CycleNode *node); - void erasePromiseNode(const Promise *promise); CycleNode * getNode(const ModelAction *act); - CycleNode * getNode(const Promise *promise); - CycleNode * getNode_noCreate(const ModelAction *act) const; - CycleNode * getNode_noCreate(const Promise *promise) const; bool mergeNodes(CycleNode *node1, CycleNode *node2); HashTable *discovered; @@ -71,8 +61,6 @@ class CycleGraph { /** @brief A table for mapping ModelActions to CycleNodes */ HashTable actionToNode; - /** @brief A table for mapping Promises to CycleNodes */ - HashTable promiseToNode; #if SUPPORT_MOD_ORDER_DUMP SnapVector nodeList; @@ -82,6 +70,7 @@ class CycleGraph { /** @brief A flag: true if this graph contains cycles */ bool hasCycles; + /** @brief The previous value of CycleGraph::hasCycles, for rollback */ bool oldCycles; SnapVector rollbackvector; @@ -89,13 +78,11 @@ class CycleGraph { }; /** - * @brief A node within a CycleGraph; corresponds either to one ModelAction or - * to a promised future value + * @brief A node within a CycleGraph; corresponds either to one ModelAction */ class CycleNode { public: CycleNode(const ModelAction *act); - CycleNode(const Promise *promise); bool addEdge(CycleNode *node); CycleNode * getEdge(unsigned int i) const; unsigned int getNumEdges() const; @@ -108,19 +95,12 @@ class CycleNode { CycleNode * getRMW() const; void clearRMW() { hasRMW = NULL; } const ModelAction * getAction() const { return action; } - const Promise * getPromise() const { return promise; } - bool is_promise() const { return !action; } - void resolvePromise(const ModelAction *writer); SNAPSHOTALLOC private: /** @brief The ModelAction that this node represents */ const ModelAction *action; - /** @brief The promise represented by this node; only valid when action - * is NULL */ - const Promise *promise; - /** @brief The edges leading out from this node */ SnapVector edges;