change data structures
[c11tester.git] / funcnode.h
index 03c92ef01a94f8b235257cc7c1f99924dda8c183..f150846d5b2cbef16ceadd37dc85ca0c802c68d5 100644 (file)
@@ -3,19 +3,24 @@
 
 class ModelAction;
 
-typedef ModelList<const ModelAction *> action_mlist_t;
-typedef SnapList<uint32_t> func_id_list_t;
+typedef ModelList<FuncInst *> func_inst_list_t;
 
 class FuncInst {
-public: 
+public:
        FuncInst(ModelAction *act);
        ~FuncInst();
 
-       ModelAction * get_action() const { return action; }
+       //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; }
+
+       MEMALLOC
 private:
-       ModelAction * const action;
+       //ModelAction * const action;
        const char * position;
+       void *location;
+       action_type type;
 };
 
 class FuncNode {
@@ -23,8 +28,19 @@ public:
        FuncNode();
        ~FuncNode();
 
+       void add_action(ModelAction *act);
+
        HashTable<const char *, FuncInst *, uintptr_t, 4> * getFuncInsts() { return &func_insts; }
+       func_inst_list_t * get_inst_list() { return &inst_list; }
+
+       MEMALLOC
 private:
+       /* Use source line number as the key of hashtable
+        *
+        * To do: cds_atomic_compare_exchange contains three atomic operations
+        * that are feeded with the same source line number by llvm pass
+        */
        HashTable<const char *, FuncInst *, uintptr_t, 4> func_insts;
-};
 
+       func_inst_list_t inst_list;
+};