3 FuncInst::FuncInst(ModelAction *act, FuncNode *func_node) :
8 this->position = act->get_position();
9 this->location = act->get_location();
10 this->type = act->get_type();
11 this->func_node = func_node;
14 /* @param other Preceding FuncInst in the same execution trace
15 * Add other to predecessors if it has been added
17 * @return false: other is already in predecessors
18 * true : other is added to precedessors
20 bool FuncInst::add_pred(FuncInst * other)
22 mllnode<FuncInst*> * it;
23 for (it = predecessors.begin();it != NULL;it=it->getNext()) {
24 FuncInst * inst = it->getVal();
29 predecessors.push_back(other);
33 bool FuncInst::add_succ(FuncInst * other)
35 mllnode<FuncInst*>* it;
36 for (it = successors.begin();it != NULL;it=it->getNext()) {
37 FuncInst * inst = it->getVal();
42 successors.push_back(other);
46 FuncInst * FuncInst::search_in_collision(ModelAction *act)
48 action_type type = act->get_type();
50 mllnode<FuncInst*>* it;
51 for (it = collisions.begin();it != NULL;it=it->getNext()) {
52 FuncInst * inst = it->getVal();
53 if ( inst->get_type() == type )
59 bool FuncInst::is_read() const
61 return type == ATOMIC_READ || type == ATOMIC_RMWR || type == ATOMIC_RMWRCAS; /* type == ATOMIC_RMW ? */
64 bool FuncInst::is_write() const
66 return type == ATOMIC_WRITE || type == ATOMIC_RMW || type == ATOMIC_INIT || type == ATOMIC_UNINIT || type == NONATOMIC_WRITE;