fix git conflict
[c11tester.git] / funcnode.h
1 #include "action.h"
2 #include "hashtable.h"
3
4 class ModelAction;
5
6 typedef ModelList<FuncInst *> func_inst_list_t;
7
8 class FuncInst {
9 public:
10         FuncInst(ModelAction *act);
11         ~FuncInst();
12
13         //ModelAction * get_action() const { return action; }
14         const char * get_position() const { return position; }
15         void * get_location() const { return location; }
16         action_type get_type() const { return type; }
17
18         MEMALLOC
19 private:
20         //ModelAction * const action;
21         const char * position;
22         void *location;
23         action_type type;
24 };
25
26 class FuncNode {
27 public:
28         FuncNode();
29         ~FuncNode();
30
31         void add_action(ModelAction *act);
32
33         HashTable<const char *, FuncInst *, uintptr_t, 4, model_malloc, model_calloc, model_free> * getFuncInsts() { return &func_insts; }
34         func_inst_list_t * get_inst_list() { return &inst_list; }
35
36         MEMALLOC
37 private:
38         /* Use source line number as the key of hashtable
39          *
40          * To do: cds_atomic_compare_exchange contains three atomic operations
41          * that are feeded with the same source line number by llvm pass
42          */
43         HashTable<const char *, FuncInst *, uintptr_t, 4, model_malloc, model_calloc, model_free> func_insts;
44
45         func_inst_list_t inst_list;
46 };