From 8caa7a3bd239c0141876f4f5a47d3910f1747e3c Mon Sep 17 00:00:00 2001 From: weiyu Date: Fri, 23 Aug 2019 15:50:19 -0700 Subject: [PATCH] get rid of an unused function --- funcnode.cc | 35 ----------------------------------- funcnode.h | 2 -- history.cc | 1 + history.h | 6 ++++-- 4 files changed, 5 insertions(+), 39 deletions(-) diff --git a/funcnode.cc b/funcnode.cc index fb3a0753..73363c7f 100644 --- a/funcnode.cc +++ b/funcnode.cc @@ -168,7 +168,6 @@ void FuncNode::update_tree(action_list_t * act_list) update_inst_tree(&inst_list); update_predicate_tree(&read_act_list); -// deep_update(predicate_tree_entry); print_predicate_tree(); } @@ -369,40 +368,6 @@ void FuncNode::update_predicate_tree(action_list_t * act_list) } } -void FuncNode::deep_update(Predicate * curr_pred) -{ - FuncInst * func_inst = curr_pred->get_func_inst(); - if (func_inst != NULL && !func_inst->is_single_location()) { - bool has_null_pred = false; - PredExprSet * pred_expressions = curr_pred->get_pred_expressions(); - PredExprSetIter * pred_expr_it = pred_expressions->iterator(); - while (pred_expr_it->hasNext()) { - pred_expr * pred_expression = pred_expr_it->next(); - if (pred_expression->token == NULLITY) { - has_null_pred = true; - break; - } - } - - if (!has_null_pred) { -// func_inst->print(); - Predicate * another_branch = new Predicate(func_inst); - another_branch->copy_predicate_expr(curr_pred); - another_branch->add_predicate_expr(NULLITY, NULL, 1); - curr_pred->add_predicate_expr(NULLITY, NULL, 0); - - Predicate * parent = curr_pred->get_parent(); - parent->add_child(another_branch); - } - } - - ModelVector * branches = curr_pred->get_children(); - for (uint i = 0; i < branches->size(); i++) { - Predicate * branch = (*branches)[i]; - deep_update(branch); - } -} - /* Given curr_pred and next_inst, find the branch following curr_pred that * contains next_inst and the correct predicate. * @return true if branch found, false otherwise. diff --git a/funcnode.h b/funcnode.h index cbc03c93..9cf082bd 100644 --- a/funcnode.h +++ b/funcnode.h @@ -39,11 +39,9 @@ public: /* TODO: generate EQUALITY or NULLITY predicate based on write_history in history.cc */ void update_predicate_tree(action_list_t * act_list); - void deep_update(Predicate * pred); bool follow_branch(Predicate ** curr_pred, FuncInst * next_inst, ModelAction * next_act, HashTable* inst_act_map, SnapVector * unset_predicates); void generate_predicate(Predicate ** curr_pred, FuncInst * next_inst, SnapVector * half_pred_expressions); - void incr_exit_count() { exit_count++; } uint32_t get_exit_count() { return exit_count; } diff --git a/history.cc b/history.cc index 581dfc1b..9b0780e9 100644 --- a/history.cc +++ b/history.cc @@ -223,6 +223,7 @@ void ModelHistory::add_to_loc_func_nodes_map(void * location, FuncNode * node) func_node_list->push_back(node); } +/* Reallocate some snapshotted memories when new executions start */ void ModelHistory::set_new_exec_flag() { for (uint i = 1; i < func_nodes.size(); i++) { diff --git a/history.h b/history.h index 3bb61564..2a77e251 100644 --- a/history.h +++ b/history.h @@ -40,15 +40,17 @@ public: private: uint32_t func_counter; - /* map function names to integer ids */ + /* Map function names to integer ids */ HashTable func_map; - /* map integer ids to function names */ + /* Map integer ids to function names */ ModelVector func_map_rev; ModelVector func_nodes; HashTable write_history; + + /* Map a location to FuncNodes that may read from it */ HashTable *, uintptr_t, 4> loc_func_nodes_map; }; -- 2.34.1