add support for docs
[model-checker.git] / action.cc
index b0d8fc9b7bed4aaacc843cc8620c0abfffc1dd00..ec50807422cc4a8e6c9864e65c561896df579000 100644 (file)
--- a/action.cc
+++ b/action.cc
@@ -84,11 +84,13 @@ bool ModelAction::is_dependent(ModelAction *act)
 
 void ModelAction::create_cv(ModelAction *parent)
 {
-       ASSERT(cv == NULL);
+       if (cv)
+               return;
+
        if (parent)
                cv = new ClockVector(parent->cv, this);
        else
-               cv = new ClockVector();
+               cv = new ClockVector(NULL, this);
 }
 
 void ModelAction::read_from(ModelAction *act)
@@ -118,10 +120,18 @@ void ModelAction::print(void)
        case ATOMIC_WRITE:
                type_str = "atomic write";
                break;
+       case ATOMIC_RMW:
+               type_str = "atomic rmw";
+               break;
        default:
                type_str = "unknown type";
        }
 
-       printf("(%4d) Thread: %d\tAction: %s\tMO: %d\tLoc: %14p\tValue: %d\n",
+       printf("(%3d) Thread: %-2d    Action: %-13s    MO: %d    Loc: %14p    Value: %d",
                        seq_number, id_to_int(tid), type_str, order, location, value);
+       if (cv) {
+               printf("\t");
+               cv->print();
+       } else
+               printf("\n");
 }