model: add const to get_thread(ModelAction *act)
[cdsspec-compiler.git] / nodestack.cc
index 708ec3d0f5fa3da43a563228ef53c4b6e72475dd..404339b6ebcf033b96b55f6b66aa4832c4dc1259 100644 (file)
@@ -8,6 +8,7 @@
 #include "common.h"
 #include "model.h"
 #include "threads-model.h"
+#include "modeltypes.h"
 
 /**
  * @brief Node constructor
@@ -89,7 +90,7 @@ Node::~Node()
 }
 
 /** Prints debugging info for the ModelAction associated with this Node */
-void Node::print()
+void Node::print() const
 {
        action->print();
        model_print("          backtrack: %s", backtrack_empty() ? "empty" : "non-empty ");
@@ -225,8 +226,9 @@ bool Node::misc_empty() const
  * @param value is the value to backtrack to.
  * @return True if the future value was successully added; false otherwise
  */
-bool Node::add_future_value(uint64_t value, modelclock_t expiration)
+bool Node::add_future_value(const ModelAction *writer, modelclock_t expiration)
 {
+       uint64_t value = writer->get_value();
        int idx = -1; /* Highest index where value is found */
        for (unsigned int i = 0; i < future_values.size(); i++) {
                if (future_values[i].value == value) {