* @param to The edge points to this ModelAction
* @param from The edge comes from this ModelAction
*/
-void CycleGraph::addEdge(const ModelAction *to, const ModelAction *from) {
+void CycleGraph::addEdge(const ModelAction *from, const ModelAction *to) {
CycleNode *fromnode=getNode(from);
CycleNode *tonode=getNode(to);
* can occur in between the rmw and the from action. Only one RMW
* action can read from a given write.
*/
-void CycleGraph::addRMWEdge(const ModelAction *rmw, const ModelAction *from) {
+void CycleGraph::addRMWEdge(const ModelAction *from, const ModelAction *rmw) {
CycleNode *fromnode=getNode(from);
CycleNode *rmwnode=getNode(rmw);
ModelAction *lastread = get_last_action(tid);
lastread->process_rmw(act);
if (act->is_rmw())
- mo_graph->addRMWEdge(lastread, lastread->get_reads_from());
+ mo_graph->addRMWEdge(lastread->get_reads_from(), lastread);
return lastread;
}
if (act->is_read()) {
const ModelAction * prevreadfrom = act->get_reads_from();
if (prevreadfrom != NULL && rf != prevreadfrom)
- mo_graph->addEdge(rf, prevreadfrom);
+ mo_graph->addEdge(prevreadfrom, rf);
} else if (rf != act) {
- mo_graph->addEdge(rf, act);
+ mo_graph->addEdge(act, rf);
}
break;
}
if (lastact->is_read()) {
const ModelAction * postreadfrom = lastact->get_reads_from();
if (postreadfrom != NULL&&rf != postreadfrom)
- mo_graph->addEdge(postreadfrom, rf);
+ mo_graph->addEdge(rf, postreadfrom);
} else if (rf != lastact) {
- mo_graph->addEdge(lastact, rf);
+ mo_graph->addEdge(rf, lastact);
}
break;
}
so we are initialized. */
ModelAction * last_seq_cst = get_last_seq_cst(curr->get_location());
if (last_seq_cst != NULL)
- mo_graph->addEdge(curr, last_seq_cst);
+ mo_graph->addEdge(last_seq_cst, curr);
}
/* Iterate over all threads */
/* Include at most one act per-thread that "happens before" curr */
if (act->happens_before(curr)) {
if (act->is_read())
- mo_graph->addEdge(curr, act->get_reads_from());
+ mo_graph->addEdge(act->get_reads_from(), curr);
else
- mo_graph->addEdge(curr, act);
+ mo_graph->addEdge(act, curr);
break;
} else if (act->is_read() && !act->is_synchronizing(curr) &&
!act->same_thread(curr)) {