X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=cyclegraph.cc;h=672a3986fc58b058ccfe32855ff07103a1e93266;hb=2d685f1dc9ae1f1ace850737196e6e40d2f9e326;hp=168ad90cdb0c4930d045d2dd97d2d45cc2e2f068;hpb=86c1040ac133d94bcafac7e72b7a8353d2b5757d;p=model-checker.git diff --git a/cyclegraph.cc b/cyclegraph.cc index 168ad90..672a398 100644 --- a/cyclegraph.cc +++ b/cyclegraph.cc @@ -20,6 +20,19 @@ CycleGraph::~CycleGraph() 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 @@ -30,10 +43,7 @@ CycleNode * CycleGraph::getNode(const ModelAction *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; }