get rid of an unused function
authorweiyu <weiyuluo1232@gmail.com>
Fri, 23 Aug 2019 22:50:19 +0000 (15:50 -0700)
committerweiyu <weiyuluo1232@gmail.com>
Fri, 23 Aug 2019 22:50:19 +0000 (15:50 -0700)
funcnode.cc
funcnode.h
history.cc
history.h

index fb3a075336ad994ba26eb99461c83adb648a913e..73363c7ffc3fc175eccf1691fd26afabfc62d60d 100644 (file)
@@ -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<Predicate *> * 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.
index cbc03c93f16444bc174c18b544cba16c8af3230e..9cf082bd723234957b50cf2eb1a03b5ecba24544 100644 (file)
@@ -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<FuncInst *, ModelAction *, uintptr_t, 0>* inst_act_map, SnapVector<Predicate *> * unset_predicates);
        void generate_predicate(Predicate ** curr_pred, FuncInst * next_inst, SnapVector<struct half_pred_expr *> * half_pred_expressions);
 
-
        void incr_exit_count() { exit_count++; }
        uint32_t get_exit_count() { return exit_count; }
 
index 581dfc1b57c6a0be5cf82e53656b97312c057e80..9b0780e9f09d8ed2243143bdd3e63ee9b10f1612 100644 (file)
@@ -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++) {
index 3bb615640eca3e86728675db2c366c508689d4d4..2a77e251f8786709d7731318075047803e31d1fe 100644 (file)
--- 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<const char *, uint32_t, uintptr_t, 4, model_malloc, model_calloc, model_free> func_map;
 
-       /* map integer ids to function names */
+       /* Map integer ids to function names */
        ModelVector<const char *> func_map_rev;
 
        ModelVector<FuncNode *> func_nodes;
 
        HashTable<void *, value_set_t *, uintptr_t, 4> write_history;
+
+       /* Map a location to FuncNodes that may read from it */
        HashTable<void *, SnapList<FuncNode *> *, uintptr_t, 4> loc_func_nodes_map;
 };