From cb9bcfa58847b8261c41890d517918260d409bdd Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Tue, 11 Dec 2012 18:05:51 -0800 Subject: [PATCH] action: refactor ATOMIC_READ printing For ATOMIC_READ, we don't need a special case to print VALUE_NONE, because any action where the value isn't explicitly set (e.g., all ATOMIC_READ actions) default to VALUE_NONE. And if this 'default' changes in the future, we would want to print it. (Right now it's confusing, for instance, when we have a failed promise execution, since the model-checker trace gives no indication of what the promised value actually *was*. This should be fixed sometime.) --- action.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/action.cc b/action.cc index e88fcee..a114675 100644 --- a/action.cc +++ b/action.cc @@ -470,7 +470,11 @@ void ModelAction::print() const type_str = "unknown type"; } - uint64_t valuetoprint=type==ATOMIC_READ?(reads_from!=NULL?reads_from->value:VALUE_NONE):value; + uint64_t valuetoprint; + if (type == ATOMIC_READ && reads_from != NULL) + valuetoprint = reads_from->value; + else + valuetoprint = value; switch (this->order) { case std::memory_order_relaxed: -- 2.34.1