/** 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),
* @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()) {
- CycleNode *node = queue.back();
+ const CycleNode *node = queue.back();
queue.pop_back();
if (node == to)
return true;
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;
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;