projects
/
c11tester.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
360053c
)
cyclegraph: add putNode() helper
author
Brian Norris
<banorris@uci.edu>
Fri, 4 Jan 2013 17:53:04 +0000
(09:53 -0800)
committer
Brian Norris
<banorris@uci.edu>
Fri, 4 Jan 2013 17:53:04 +0000
(09:53 -0800)
cyclegraph.cc
patch
|
blob
|
history
cyclegraph.h
patch
|
blob
|
history
diff --git
a/cyclegraph.cc
b/cyclegraph.cc
index 168ad90cdb0c4930d045d2dd97d2d45cc2e2f068..672a3986fc58b058ccfe32855ff07103a1e93266 100644
(file)
--- a/
cyclegraph.cc
+++ b/
cyclegraph.cc
@@
-20,6
+20,19
@@
CycleGraph::~CycleGraph()
delete discovered;
}
delete discovered;
}
+/**
+ * Add a CycleNode to the graph, corresponding to a store ModelAction
+ * @param act The write action that should be added
+ * @param node The CycleNode that corresponds to the store
+ */
+void CycleGraph::putNode(const ModelAction *act, CycleNode *node)
+{
+ actionToNode.put(act, node);
+#if SUPPORT_MOD_ORDER_DUMP
+ nodeList.push_back(node);
+#endif
+}
+
/**
* @brief Returns the CycleNode corresponding to a given ModelAction
* @param action The ModelAction to find a node for
/**
* @brief Returns the CycleNode corresponding to a given ModelAction
* @param action The ModelAction to find a node for
@@
-30,10
+43,7
@@
CycleNode * CycleGraph::getNode(const ModelAction *action)
CycleNode *node = actionToNode.get(action);
if (node == NULL) {
node = new CycleNode(action);
CycleNode *node = actionToNode.get(action);
if (node == NULL) {
node = new CycleNode(action);
- actionToNode.put(action, node);
-#if SUPPORT_MOD_ORDER_DUMP
- nodeList.push_back(node);
-#endif
+ putNode(action, node);
}
return node;
}
}
return node;
}
diff --git
a/cyclegraph.h
b/cyclegraph.h
index dcdeb3f217deced343e4ee227741040bfc733e1e..6b3d93e5e45ec661d3acd4db987796b9b1adaea6 100644
(file)
--- a/
cyclegraph.h
+++ b/
cyclegraph.h
@@
-40,6
+40,7
@@
class CycleGraph {
SNAPSHOTALLOC
private:
SNAPSHOTALLOC
private:
+ void putNode(const ModelAction *act, CycleNode *node);
CycleNode * getNode(const ModelAction *);
HashTable<CycleNode *, CycleNode *, uintptr_t, 4, model_malloc, model_calloc, model_free> *discovered;
CycleNode * getNode(const ModelAction *);
HashTable<CycleNode *, CycleNode *, uintptr_t, 4, model_malloc, model_calloc, model_free> *discovered;