Fix bug by only putting reads or writes in objthrdmap
[c11tester.git] / newfuzzer.h
index 9f30ec6d3e477c97176fc29bf0388682f1e6949a..bf01faf00aa0435f6beab22cf0adac7d698a0090 100644 (file)
@@ -34,7 +34,7 @@ public:
        bool shouldWake(const ModelAction * sleep);
        bool shouldWait(const ModelAction * wait);
 
-       void register_engine(ModelHistory * history, ModelExecution * execution);
+       void register_engine(ModelExecution * execution);
        Predicate * get_selected_child_branch(thread_id_t tid);
 
        SNAPSHOTALLOC
@@ -45,13 +45,14 @@ private:
        SnapVector<ModelAction *> thrd_last_read_act;
        SnapVector<FuncInst *> thrd_last_func_inst;
 
+       SnapVector<Predicate *> available_branches_tmp_storage;
        SnapVector<Predicate *> thrd_selected_child_branch;
        SnapVector< SnapVector<ModelAction *> *> thrd_pruned_writes;
 
-       bool check_store_visibility(Predicate * curr_pred, FuncInst * read_inst, inst_act_map_t * inst_act_map, SnapVector<ModelAction *> * rf_set);
+       bool check_branch_inst(Predicate * curr_pred, FuncInst * read_inst, inst_act_map_t * inst_act_map, SnapVector<ModelAction *> * rf_set);
        Predicate * selectBranch(thread_id_t tid, Predicate * curr_pred, FuncInst * read_inst);
        bool prune_writes(thread_id_t tid, Predicate * pred, SnapVector<ModelAction *> * rf_set, inst_act_map_t * inst_act_map);
-       int choose_index(SnapVector<Predicate *> * branches, uint32_t numerator);
+       int choose_branch_index(SnapVector<Predicate *> * branches);
 
        /* The set of Threads put to sleep by NewFuzzer because no writes in rf_set satisfies the selected predicate. Only used by selectWrite.
         */
@@ -62,11 +63,9 @@ private:
        SnapVector<struct node_dist_info> dist_info_vec;        //--
 
        void conditional_sleep(Thread * thread);        //--
-       bool should_conditional_sleep(Predicate * predicate);
        void wake_up_paused_threads(int * threadlist, int * numthreads);        //--
 
        bool find_threads(ModelAction * pending_read);  //--
-       /*-- void update_predicate_score(Predicate * predicate, sleep_result_t type); */
 
        bool check_predicate_expressions(PredExprSet * pred_expressions, inst_act_map_t * inst_act_map, uint64_t write_val, bool * no_predicate);
 };