From: weiyu Date: Tue, 17 Sep 2019 02:45:34 +0000 (-0700) Subject: Add comment about the difference between ModelAction::is_write and FuncInst::is_write X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=63ef91baad03c3c49a2d999b729ef58f55c80dcf;p=c11tester.git Add comment about the difference between ModelAction::is_write and FuncInst::is_write --- diff --git a/funcinst.cc b/funcinst.cc index a3a2874e..7f031d17 100644 --- a/funcinst.cc +++ b/funcinst.cc @@ -59,11 +59,14 @@ FuncInst * FuncInst::search_in_collision(ModelAction *act) } */ +/* Note: is_read() is equivalent to ModelAction::is_read() */ bool FuncInst::is_read() const { return type == ATOMIC_READ || type == ATOMIC_RMWR || type == ATOMIC_RMWRCAS || type == ATOMIC_RMW; } +/* Note: because of action type conversion in ModelExecution + * is_write() <==> pure writes (excluding rmw) */ bool FuncInst::is_write() const { return type == ATOMIC_WRITE || type == ATOMIC_RMW || type == ATOMIC_INIT || type == ATOMIC_UNINIT || type == NONATOMIC_WRITE; diff --git a/funcinst.h b/funcinst.h index 95d92ff3..6bbed2c8 100644 --- a/funcinst.h +++ b/funcinst.h @@ -48,7 +48,11 @@ private: * location only stores the memory location when this FuncInst was constructed. */ void * location; + + /* NOTE: for rmw actions, func_inst and act may have different + * action types because of action type conversion in ModelExecution */ action_type type; + memory_order order; FuncNode * func_node; @@ -66,4 +70,3 @@ private: }; #endif /* __FUNCINST_H__ */ -