Add mailing list
[c11tester.git] / funcinst.h
index 3f2307e17c9e01fd5c7aa4ba635e24234da7c850..bc56e2772544869097979b42bee45e7f44b1b675 100644 (file)
@@ -1,3 +1,6 @@
+#ifndef __FUNCINST_H__
+#define __FUNCINST_H__
+
 #include "action.h"
 #include "hashtable.h"
 
@@ -7,13 +10,14 @@ typedef ModelList<FuncInst *> func_inst_list_mt;
 
 class FuncInst {
 public:
-       FuncInst(ModelAction *act);
+       FuncInst(ModelAction *act, FuncNode *func_node);
        ~FuncInst();
 
        //ModelAction * get_action() const { return action; }
        const char * get_position() const { return position; }
        void * get_location() const { return location; }
        action_type get_type() const { return type; }
+       FuncNode * get_func_node() const { return func_node; }
 
        bool add_pred(FuncInst * other);
        bool add_succ(FuncInst * other);
@@ -24,14 +28,25 @@ public:
        func_inst_list_mt * get_preds() { return &predecessors; }
        func_inst_list_mt * get_succs() { return &successors; }
 
+       bool is_read() const;
+       bool is_write() const;
+
        MEMALLOC
 private:
        //ModelAction * const action;
        const char * position;
-       void *location;
+       void * location;
        action_type type;
+       FuncNode * func_node;
 
+       /* collisions store a list of FuncInsts with the same position
+        * but different action types. For example, CAS is broken down
+        * as three different atomic operations in cmodelint.cc */
        func_inst_list_mt collisions;
+
        func_inst_list_mt predecessors;
        func_inst_list_mt successors;
 };
+
+#endif /* __FUNCINST_H__ */
+