if (reads_from)
model_print(" Rf: %-3d", reads_from->get_seq_number());
else if (reads_from_promise) {
- int idx = model->get_promise_number(reads_from_promise);
+ int idx = reads_from_promise->get_index();
if (idx >= 0)
model_print(" Rf: P%-2d", idx);
else
if (reads_from)
hash ^= reads_from->get_seq_number();
else if (reads_from_promise)
- hash ^= model->get_promise_number(reads_from_promise);
+ hash ^= reads_from_promise->get_index();
hash ^= get_reads_from_value();
}
return hash;
{
if (node->is_promise()) {
const Promise *promise = node->getPromise();
- int idx = model->get_promise_number(promise);
+ int idx = promise->get_index();
fprintf(file, "P%u", idx);
if (label) {
int first = 1;
{
return get_reader(0)->same_var(act);
}
+
+/** @brief Get this Promise's index within the execution's promise array */
+int Promise::get_index() const
+{
+ return model->get_promise_number(this);
+}
uint64_t get_value() const { return fv.value; }
struct future_value get_fv() const { return fv; }
+ int get_index() const;
+
void print() const;
bool equals(const Promise *x) const { return this == x; }