From 63ef91baad03c3c49a2d999b729ef58f55c80dcf Mon Sep 17 00:00:00 2001 From: weiyu Date: Mon, 16 Sep 2019 19:45:34 -0700 Subject: [PATCH] Add comment about the difference between ModelAction::is_write and FuncInst::is_write --- funcinst.cc | 3 +++ funcinst.h | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) 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__ */ - -- 2.34.1