X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11tester.git;a=blobdiff_plain;f=funcnode.h;h=d2bc3cf2f7ae079597a5e380f7746d01015a4db1;hp=c8c76ba7f8695bdf084e0c189aae910924e8e271;hb=e9e6aaed0177ca95f216a59a284464262c835c3c;hpb=2fb6087b4a961be34e5bc69e1eee770b0f7439a8 diff --git a/funcnode.h b/funcnode.h index c8c76ba7..d2bc3cf2 100644 --- a/funcnode.h +++ b/funcnode.h @@ -1,10 +1,13 @@ +#ifndef __FUNCNODE_H__ +#define __FUNCNODE_H__ + #include "action.h" #include "funcinst.h" #include "hashtable.h" - -class ModelAction; +#include "hashset.h" typedef ModelList func_inst_list_mt; +typedef HashTable read_map_t; class FuncNode { public: @@ -22,8 +25,16 @@ public: func_inst_list_mt * get_inst_list() { return &inst_list; } func_inst_list_mt * get_entry_insts() { return &entry_insts; } void add_entry_inst(FuncInst * inst); + void link_insts(func_inst_list_t * inst_list); + + void store_read(ModelAction * act, uint32_t tid); + uint64_t query_last_read(void * location, uint32_t tid); + void clear_read_map(uint32_t tid); - void group_reads_by_loc(FuncInst * inst); + /* TODO: generate EQUALITY or NULLITY predicate based on write_history in history.cc */ + void generate_predicate(FuncInst * func_inst); + + void print_last_read(uint32_t tid); MEMALLOC private: @@ -32,9 +43,6 @@ private: /* Use source line number as the key of hashtable, to check if * atomic operation with this line number has been added or not - * - * To do: cds_atomic_compare_exchange contains three atomic operations - * that are feeded with the same source line number by llvm pass */ HashTable func_inst_map; @@ -44,6 +52,9 @@ private: /* possible entry atomic actions in this function */ func_inst_list_mt entry_insts; - /* group atomic read actions by memory location */ - HashTable reads_by_loc; + /* Store the values read by atomic read actions per memory location for each thread */ + ModelVector thrd_read_map; + }; + +#endif /* __FUNCNODE_H__ */