action: print promise number, not just ?
[model-checker.git] / action.cc
index 317c6a7cd87d9a94fbb695ecb95615ed5bae5613..81f447a5b13f9d8e3db3e352e4be49f4659559b0 100644 (file)
--- a/action.cc
+++ b/action.cc
@@ -300,9 +300,9 @@ bool ModelAction::could_synchronize_with(const ModelAction *act) const
        if (!same_var(act))
                return false;
 
-       // Explore interleavings of seqcst writes to guarantee total
+       // Explore interleavings of seqcst writes/fences to guarantee total
        // order of seq_cst operations that don't commute
-       if ((could_be_write() || act->could_be_write()) && is_seqcst() && act->is_seqcst())
+       if ((could_be_write() || act->could_be_write() || is_fence() || act->is_fence()) && is_seqcst() && act->is_seqcst())
                return true;
 
        // Explore synchronizing read/write pairs
@@ -402,7 +402,7 @@ void ModelAction::set_read_from(const ModelAction *act)
  * Set this action's read-from promise
  * @param promise The promise to read from
  */
-void ModelAction::set_read_from_promise(const Promise *promise)
+void ModelAction::set_read_from_promise(Promise *promise)
 {
        ASSERT(is_read());
        reads_from_promise = promise;
@@ -543,7 +543,13 @@ void ModelAction::print() const
        if (is_read()) {
                if (reads_from)
                        model_print("  Rf: %-3d", reads_from->get_seq_number());
-               else
+               else if (reads_from_promise) {
+                       int idx = model->get_promise_number(reads_from_promise);
+                       if (idx >= 0)
+                               model_print("  Rf: P%-2d", idx);
+                       else
+                               model_print("  RF: P? ");
+               } else
                        model_print("  Rf: ?  ");
        }
        if (cv) {