From: Brian Norris Date: Thu, 12 Jul 2012 19:29:34 +0000 (-0700) Subject: model: rearrange switch block, handle RMW X-Git-Tag: pldi2013~362 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=fe5598b01eb1a72a708a67a1a004149b8bcbc83a;p=model-checker.git model: rearrange switch block, handle RMW This switch block shouldn't have to be updated for every new action_type_t. Rewrite so that we only have to worry about significant actions, like ATOMIC_{READ,WRITE,RMW}. --- diff --git a/model.cc b/model.cc index d80d1d2..9d07d41 100644 --- a/model.cc +++ b/model.cc @@ -167,14 +167,12 @@ ModelAction * ModelChecker::get_last_conflict(ModelAction *act) action_type type = act->get_type(); switch (type) { - case THREAD_CREATE: - case THREAD_YIELD: - case THREAD_JOIN: - return NULL; case ATOMIC_READ: case ATOMIC_WRITE: - default: + case ATOMIC_RMW: break; + default: + return NULL; } /* linear search: from most recent to oldest */ action_list_t::reverse_iterator rit;