projects
/
cdsspec-compiler.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b410cb2
)
cyclegraph: add const
author
Brian Norris
<banorris@uci.edu>
Wed, 9 Jan 2013 00:29:17 +0000
(16:29 -0800)
committer
Brian Norris
<banorris@uci.edu>
Wed, 9 Jan 2013 00:29:17 +0000
(16:29 -0800)
cyclegraph.cc
patch
|
blob
|
history
cyclegraph.h
patch
|
blob
|
history
diff --git
a/cyclegraph.cc
b/cyclegraph.cc
index 3949b6ec86d885056282a0b84d0975267da13cdd..e3d0d8366694d53c44170ba589062df01d179aa0 100644
(file)
--- a/
cyclegraph.cc
+++ b/
cyclegraph.cc
@@
-6,7
+6,7
@@
/** Initializes a CycleGraph object. */
CycleGraph::CycleGraph() :
/** Initializes a CycleGraph object. */
CycleGraph::CycleGraph() :
- discovered(new HashTable<
CycleNode *,
CycleNode *, uintptr_t, 4, model_malloc, model_calloc, model_free>(16)),
+ discovered(new HashTable<
const CycleNode *, const
CycleNode *, uintptr_t, 4, model_malloc, model_calloc, model_free>(16)),
hasCycles(false),
oldCycles(false),
hasRMWViolation(false),
hasCycles(false),
oldCycles(false),
hasRMWViolation(false),
@@
-198,15
+198,15
@@
bool CycleGraph::checkReachable(const ModelAction *from, const ModelAction *to)
* @param to The CycleNode to reach
* @return True, @a from can reach @a to; otherwise, false
*/
* @param to The CycleNode to reach
* @return True, @a from can reach @a to; otherwise, false
*/
-bool CycleGraph::checkReachable(
CycleNode *from,
CycleNode *to) const
+bool CycleGraph::checkReachable(
const CycleNode *from, const
CycleNode *to) const
{
{
- std::vector<
CycleNode *, ModelAlloc<
CycleNode *> > queue;
+ std::vector<
const CycleNode *, ModelAlloc<const
CycleNode *> > queue;
discovered->reset();
queue.push_back(from);
discovered->put(from, from);
while (!queue.empty()) {
discovered->reset();
queue.push_back(from);
discovered->put(from, from);
while (!queue.empty()) {
- CycleNode *node = queue.back();
+
const
CycleNode *node = queue.back();
queue.pop_back();
if (node == to)
return true;
queue.pop_back();
if (node == to)
return true;
diff --git
a/cyclegraph.h
b/cyclegraph.h
index f2f30329203c226c5a7a1c6140fa3043bb260613..45e49fb7bec3950656054e02f92b06aa5cf3ae65 100644
(file)
--- a/
cyclegraph.h
+++ b/
cyclegraph.h
@@
-42,7
+42,7
@@
class CycleGraph {
private:
void putNode(const ModelAction *act, CycleNode *node);
CycleNode * getNode(const ModelAction *);
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;
+ HashTable<
const CycleNode *, const
CycleNode *, uintptr_t, 4, model_malloc, model_calloc, model_free> *discovered;
/** @brief A table for mapping ModelActions to CycleNodes */
HashTable<const ModelAction *, CycleNode *, uintptr_t, 4> actionToNode;
/** @brief A table for mapping ModelActions to CycleNodes */
HashTable<const ModelAction *, CycleNode *, uintptr_t, 4> actionToNode;
@@
-50,7
+50,7
@@
class CycleGraph {
std::vector<CycleNode *> nodeList;
#endif
std::vector<CycleNode *> nodeList;
#endif
- bool checkReachable(
CycleNode *from,
CycleNode *to) const;
+ bool checkReachable(
const CycleNode *from, const
CycleNode *to) const;
/** @brief A flag: true if this graph contains cycles */
bool hasCycles;
/** @brief A flag: true if this graph contains cycles */
bool hasCycles;