public:
CycleGraph();
~CycleGraph();
- void addEdge(const ModelAction *from, const ModelAction *to);
+
+ template <typename T, typename U>
+ void addEdge(const T from, const U to);
+
bool checkForCycles() const;
void addRMWEdge(const ModelAction *from, const ModelAction *rmw);
bool checkPromise(const ModelAction *from, Promise *p) const;
SNAPSHOTALLOC
private:
- void addEdge(CycleNode *fromnode, CycleNode *tonode);
+ void addNodeEdge(CycleNode *fromnode, CycleNode *tonode);
void putNode(const ModelAction *act, CycleNode *node);
CycleNode * getNode(const ModelAction *);
+ CycleNode * getNode(const Promise *promise);
+
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;
+ /** @brief A table for mapping reader ModelActions to Promise
+ * CycleNodes */
+ HashTable<const ModelAction *, CycleNode *, uintptr_t, 4> readerToPromiseNode;
+
#if SUPPORT_MOD_ORDER_DUMP
std::vector<CycleNode *> nodeList;
#endif
unsigned int getNumEdges() const;
CycleNode * getBackEdge(unsigned int i) const;
unsigned int getNumBackEdges() const;
+ CycleNode * removeEdge();
+ CycleNode * removeBackEdge();
+
bool setRMW(CycleNode *);
CycleNode * getRMW() const;
void clearRMW() { hasRMW = NULL; }