action: print '?' for unknown read-from-future
[model-checker.git] / action.cc
index b435524d6d4a423405e221724794e8fcfeae4f84..692d14cf03033d4b3c89ed7e05a7d386acdfe352 100644 (file)
--- a/action.cc
+++ b/action.cc
@@ -186,6 +186,11 @@ void ModelAction::synchronize_with(const ModelAction *act) {
        cv->merge(act->cv);
 }
 
+bool ModelAction::has_synchronized_with(const ModelAction *act) const
+{
+       return cv->has_synchronized_with(act->cv);
+}
+
 /**
  * Check whether 'this' happens before act, according to the memory-model's
  * happens before relation. This is checked via the ClockVector constructs.
@@ -260,8 +265,12 @@ void ModelAction::print(void) const
 
        printf("(%3d) Thread: %-2d   Action: %-13s   MO: %7s  Loc: %14p  Value: %-12" PRIu64,
                        seq_number, id_to_int(tid), type_str, mo_str, location, valuetoprint);
-       if (reads_from)
-               printf(" Rf: %d", reads_from->get_seq_number());
+       if (is_read()) {
+               if (reads_from)
+                       printf(" Rf: %d", reads_from->get_seq_number());
+               else
+                       printf(" Rf: ?");
+       }
        if (cv) {
                printf("\t");
                cv->print();