projects
/
c11tester.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2d685f1
)
cyclegraph: add back edges to CycleNode
author
Brian Norris
<banorris@uci.edu>
Fri, 4 Jan 2013 19:05:10 +0000
(11:05 -0800)
committer
Brian Norris
<banorris@uci.edu>
Fri, 4 Jan 2013 19:05:10 +0000
(11:05 -0800)
cyclegraph.cc
patch
|
blob
|
history
cyclegraph.h
patch
|
blob
|
history
diff --git
a/cyclegraph.cc
b/cyclegraph.cc
index 672a3986fc58b058ccfe32855ff07103a1e93266..3949b6ec86d885056282a0b84d0975267da13cdd 100644
(file)
--- a/
cyclegraph.cc
+++ b/
cyclegraph.cc
@@
-319,6
+319,16
@@
unsigned int CycleNode::getNumEdges() const
return edges.size();
}
return edges.size();
}
+CycleNode * CycleNode::getBackEdge(unsigned int i) const
+{
+ return back_edges[i];
+}
+
+unsigned int CycleNode::getNumBackEdges() const
+{
+ return back_edges.size();
+}
+
/**
* Adds an edge from this CycleNode to another CycleNode.
* @param node The node to which we add a directed edge
/**
* Adds an edge from this CycleNode to another CycleNode.
* @param node The node to which we add a directed edge
@@
-329,6
+339,7
@@
bool CycleNode::addEdge(CycleNode *node)
if (edges[i] == node)
return false;
edges.push_back(node);
if (edges[i] == node)
return false;
edges.push_back(node);
+ node->back_edges.push_back(this);
return true;
}
return true;
}
diff --git
a/cyclegraph.h
b/cyclegraph.h
index 6b3d93e5e45ec661d3acd4db987796b9b1adaea6..f2f30329203c226c5a7a1c6140fa3043bb260613 100644
(file)
--- a/
cyclegraph.h
+++ b/
cyclegraph.h
@@
-70,6
+70,8
@@
class CycleNode {
bool addEdge(CycleNode *node);
CycleNode * getEdge(unsigned int i) const;
unsigned int getNumEdges() const;
bool addEdge(CycleNode *node);
CycleNode * getEdge(unsigned int i) const;
unsigned int getNumEdges() const;
+ CycleNode * getBackEdge(unsigned int i) const;
+ unsigned int getNumBackEdges() const;
bool setRMW(CycleNode *);
CycleNode * getRMW() const;
const ModelAction * getAction() const { return action; }
bool setRMW(CycleNode *);
CycleNode * getRMW() const;
const ModelAction * getAction() const { return action; }
@@
-89,6
+91,9
@@
class CycleNode {
/** @brief The edges leading out from this node */
std::vector< CycleNode *, SnapshotAlloc<CycleNode *> > edges;
/** @brief The edges leading out from this node */
std::vector< CycleNode *, SnapshotAlloc<CycleNode *> > edges;
+ /** @brief The edges leading into this node */
+ std::vector< CycleNode *, SnapshotAlloc<CycleNode *> > back_edges;
+
/** Pointer to a RMW node that reads from this node, or NULL, if none
* exists */
CycleNode *hasRMW;
/** Pointer to a RMW node that reads from this node, or NULL, if none
* exists */
CycleNode *hasRMW;