Add functions to SnapList plus tabbing
[c11tester.git] / funcnode.cc
index 663447bf17fed96f8eea6e8cb02e48d84595c828..30b691df8c85cfb5ca999745416cb5d793765bb6 100644 (file)
@@ -349,7 +349,7 @@ void FuncNode::update_predicate_tree(action_list_t * act_list)
  * @return true if branch found, false otherwise.
  */
 bool FuncNode::follow_branch(Predicate ** curr_pred, FuncInst * next_inst,
-ModelAction * next_act, SnapVector<Predicate *> * unset_predicates)
+                                                                                                                ModelAction * next_act, SnapVector<Predicate *> * unset_predicates)
 {
        /* Check if a branch with func_inst and corresponding predicate exists */
        bool branch_found = false;
@@ -376,34 +376,34 @@ ModelAction * next_act, SnapVector<Predicate *> * unset_predicates)
                        bool equality;
 
                        switch(pred_expression->token) {
-                               case NOPREDICATE:
-                                       predicate_correct = true;
-                                       break;
-                               case EQUALITY:
-                                       FuncInst * to_be_compared;
-                                       ModelAction * last_act;
+                       case NOPREDICATE:
+                               predicate_correct = true;
+                               break;
+                       case EQUALITY:
+                               FuncInst * to_be_compared;
+                               ModelAction * last_act;
 
-                                       to_be_compared = pred_expression->func_inst;
-                                       last_act = to_be_compared->get_associated_act(marker);
+                               to_be_compared = pred_expression->func_inst;
+                               last_act = to_be_compared->get_associated_act(marker);
 
-                                       last_read = last_act->get_reads_from_value();
-                                       next_read = next_act->get_reads_from_value();
-                                       equality = (last_read == next_read);
-                                       if (equality != pred_expression->value)
-                                               predicate_correct = false;
+                               last_read = last_act->get_reads_from_value();
+                               next_read = next_act->get_reads_from_value();
+                               equality = (last_read == next_read);
+                               if (equality != pred_expression->value)
+                                       predicate_correct = false;
 
-                                       break;
-                               case NULLITY:
-                                       next_read = next_act->get_reads_from_value();
-                                       // TODO: implement likely to be null
-                                       equality = ( (void*) (next_read & 0xffffffff) == NULL);
-                                       if (equality != pred_expression->value)
-                                               predicate_correct = false;
-                                       break;
-                               default:
+                               break;
+                       case NULLITY:
+                               next_read = next_act->get_reads_from_value();
+                               // TODO: implement likely to be null
+                               equality = ( (void*) (next_read & 0xffffffff) == NULL);
+                               if (equality != pred_expression->value)
                                        predicate_correct = false;
-                                       model_print("unkown predicate token\n");
-                                       break;
+                               break;
+                       default:
+                               predicate_correct = false;
+                               model_print("unkown predicate token\n");
+                               break;
                        }
                }
 
@@ -419,8 +419,8 @@ ModelAction * next_act, SnapVector<Predicate *> * unset_predicates)
 
 /* Infer predicate expressions, which are generated in FuncNode::generate_predicates */
 void FuncNode::infer_predicates(FuncInst * next_inst, ModelAction * next_act,
-HashTable<void *, ModelAction *, uintptr_t, 0> * loc_act_map,
-SnapVector<struct half_pred_expr *> * half_pred_expressions)
+                                                                                                                               HashTable<void *, ModelAction *, uintptr_t, 0> * loc_act_map,
+                                                                                                                               SnapVector<struct half_pred_expr *> * half_pred_expressions)
 {
        void * loc = next_act->get_location();
 
@@ -465,7 +465,7 @@ SnapVector<struct half_pred_expr *> * half_pred_expressions)
 
 /* Able to generate complex predicates when there are multiple predciate expressions */
 void FuncNode::generate_predicates(Predicate ** curr_pred, FuncInst * next_inst,
-SnapVector<struct half_pred_expr *> * half_pred_expressions)
+                                                                                                                                        SnapVector<struct half_pred_expr *> * half_pred_expressions)
 {
        if (half_pred_expressions->size() == 0) {
                Predicate * new_pred = new Predicate(next_inst);
@@ -744,7 +744,7 @@ void FuncNode::assign_base_score()
                        leaves.push_back(node);
                }
 
-               for (uint i = 0; i < children->size(); i++)
+               for (uint i = 0;i < children->size();i++)
                        queue.push_front( (*children)[i] );
        }
 
@@ -764,7 +764,7 @@ void FuncNode::assign_base_score()
                        double weight_sum = 0;
                        bool has_unassigned_node = false;
 
-                       for (uint i = 0; i < children->size(); i++) {
+                       for (uint i = 0;i < children->size();i++) {
                                Predicate * child = (*children)[i];
 
                                // If a child has unassigned weight