projects
/
model-checker.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
nodestack: move has_priority() out of header
[model-checker.git]
/
cyclegraph.cc
diff --git
a/cyclegraph.cc
b/cyclegraph.cc
index 2bfe76ac424c274bf8152638543ad7dd6bc1d31f..aa3d24548a554ab039074282f5bab3246e3d3ccd 100644
(file)
--- a/
cyclegraph.cc
+++ b/
cyclegraph.cc
@@
-122,11
+122,7
@@
void CycleGraph::addRMWEdge(const ModelAction *from, const ModelAction *rmw) {
}
#if SUPPORT_MOD_ORDER_DUMP
}
#if SUPPORT_MOD_ORDER_DUMP
-void CycleGraph::dumpGraphToFile(const char *filename) {
- char buffer[200];
- sprintf(buffer, "%s.dot",filename);
- FILE *file=fopen(buffer, "w");
- fprintf(file, "digraph %s {\n",filename);
+void CycleGraph::dumpNodes(FILE *file) {
for(unsigned int i=0;i<nodeList.size();i++) {
CycleNode *cn=nodeList[i];
std::vector<CycleNode *> * edges=cn->getEdges();
for(unsigned int i=0;i<nodeList.size();i++) {
CycleNode *cn=nodeList[i];
std::vector<CycleNode *> * edges=cn->getEdges();
@@
-141,6
+137,14
@@
void CycleGraph::dumpGraphToFile(const char *filename) {
fprintf(file, "N%u -> N%u;\n", action->get_seq_number(), dstaction->get_seq_number());
}
}
fprintf(file, "N%u -> N%u;\n", action->get_seq_number(), dstaction->get_seq_number());
}
}
+}
+
+void CycleGraph::dumpGraphToFile(const char *filename) {
+ char buffer[200];
+ sprintf(buffer, "%s.dot",filename);
+ FILE *file=fopen(buffer, "w");
+ fprintf(file, "digraph %s {\n",filename);
+ dumpNodes(file);
fprintf(file,"}\n");
fclose(file);
}
fprintf(file,"}\n");
fclose(file);
}
@@
-169,8
+173,8
@@
bool CycleGraph::checkReachable(const ModelAction *from, const ModelAction *to)
* @return True, @a from can reach @a to; otherwise, false
*/
bool CycleGraph::checkReachable(CycleNode *from, CycleNode *to) {
* @return True, @a from can reach @a to; otherwise, false
*/
bool CycleGraph::checkReachable(CycleNode *from, CycleNode *to) {
- std::vector<CycleNode *, M
y
Alloc<CycleNode *> > queue;
- HashTable<CycleNode *, CycleNode *, uintptr_t, 4,
MYMALLOC, MYCALLOC, MYFREE
> discovered;
+ std::vector<CycleNode *, M
odel
Alloc<CycleNode *> > queue;
+ HashTable<CycleNode *, CycleNode *, uintptr_t, 4,
model_malloc, model_calloc, model_free
> discovered;
queue.push_back(from);
discovered.put(from, from);
queue.push_back(from);
discovered.put(from, from);