X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11tester.git;a=blobdiff_plain;f=cyclegraph.cc;h=eeec66520c34d19d1f3d63539ce0c01a7109814b;hp=44f5a28bc15b69cc3289a4906b298341845ae324;hb=3510b440b186949cbc0760d369da6787f0def7ac;hpb=dbee0c57f6edff31aafb79d6e956f1408bbb8fb8 diff --git a/cyclegraph.cc b/cyclegraph.cc index 44f5a28b..eeec6652 100644 --- a/cyclegraph.cc +++ b/cyclegraph.cc @@ -38,8 +38,7 @@ void CycleGraph::putNode(const ModelAction *act, CycleNode *node) */ void CycleGraph::putNode(const Promise *promise, CycleNode *node) { - const ModelAction *reader = promise->get_action(); - readerToPromiseNode.put(reader, node); + promiseToNode.put(promise, node); #if SUPPORT_MOD_ORDER_DUMP nodeList.push_back(node); #endif @@ -51,8 +50,7 @@ void CycleGraph::putNode(const Promise *promise, CycleNode *node) */ void CycleGraph::erasePromiseNode(const Promise *promise) { - const ModelAction *reader = promise->get_action(); - readerToPromiseNode.put(reader, NULL); + promiseToNode.put(promise, NULL); #if SUPPORT_MOD_ORDER_DUMP /* Remove the promise node from nodeList */ CycleNode *node = getNode_noCreate(promise); @@ -73,7 +71,7 @@ CycleNode * CycleGraph::getNode_noCreate(const ModelAction *act) const /** @return The corresponding CycleNode, if exists; otherwise NULL */ CycleNode * CycleGraph::getNode_noCreate(const Promise *promise) const { - return readerToPromiseNode.get(promise->get_action()); + return promiseToNode.get(promise); } /** @@ -116,10 +114,10 @@ CycleNode * CycleGraph::getNode(const Promise *promise) /** * @return false if the resolution results in a cycle; true otherwise */ -bool CycleGraph::resolvePromise(ModelAction *reader, ModelAction *writer, +bool CycleGraph::resolvePromise(const Promise *promise, ModelAction *writer, promise_list_t *mustResolve) { - CycleNode *promise_node = readerToPromiseNode.get(reader); + CycleNode *promise_node = promiseToNode.get(promise); CycleNode *w_node = actionToNode.get(writer); ASSERT(promise_node);