run tabbing pass
authorbdemsky <bdemsky@uci.edu>
Tue, 16 Jul 2019 17:26:13 +0000 (10:26 -0700)
committerbdemsky <bdemsky@uci.edu>
Tue, 16 Jul 2019 17:26:13 +0000 (10:26 -0700)
cmodelint.cc
datarace.cc
execution.cc
execution.h
funcinst.cc
funcnode.cc
funcnode.h
futex.cc
hashtable.h
history.cc
history.h

index 82bf974f03b99b7aaae1ecd7b4fd440ed05f104f..3d55f24de9f3d46cc95e355629062728bd4b87d7 100644 (file)
@@ -376,8 +376,8 @@ void cds_func_entry(const char * funcName) {
 
                // add func id to reverse func map
                ModelVector<const char *> * func_map_rev = history->getFuncMapRev();
-               if ( func_map_rev->size() <= func_id )
-                       func_map_rev->resize( func_id + 1 );
+               if ( func_map_rev->size() <= func_id )
+                       func_map_rev->resize( func_id + 1 );
                func_map_rev->at(func_id) = funcName;
        } else {
                func_id = history->getFuncMap()->get(funcName);
@@ -396,9 +396,9 @@ void cds_func_exit(const char * funcName) {
        func_id = history->getFuncMap()->get(funcName);
 
        /* func_id not found; this could happen in the case where a function calls cds_func_entry
-       * when the model has been defined yet, but then an atomic inside the function initializes 
-       * the model. And then cds_func_exit is called upon the function exiting. 
-       */
+        * when the model has been defined yet, but then an atomic inside the function initializes
+        * the model. And then cds_func_exit is called upon the function exiting.
+        */
        if (func_id == 0)
                return;
 
index 22e473f50b981d41fc2cdcb3bf529b5ca30f4eef..fcc4b08c3ea3cfff9787df81be032c0aaf667ece 100644 (file)
@@ -285,7 +285,7 @@ void fullRaceCheckRead(thread_id_t thread, const void *location, uint64_t *shado
                if (clock_may_race(currClock, thread, readClock, readThread)) {
                        /* Still need this read in vector */
                        if (copytoindex != i) {
-                         ASSERT(record->thread[i] >= 0);
+                               ASSERT(record->thread[i] >= 0);
                                record->readClock[copytoindex] = record->readClock[i];
                                record->thread[copytoindex] = record->thread[i];
                        }
index c5c40a91f7776d43e98dd3cc027e8b9b05db56b0..e162a4a10f9e250c123efd6d5c9c39c601b86d17 100644 (file)
@@ -63,7 +63,7 @@ ModelExecution::ModelExecution(ModelChecker *m, Scheduler *scheduler) :
        thrd_last_action(1),
        thrd_last_fence_release(),
        priv(new struct model_snapshot_members ()),
-       mo_graph(new CycleGraph()),
+                        mo_graph(new CycleGraph()),
        fuzzer(new Fuzzer()),
        thrd_func_list(),
        thrd_func_inst_lists()
index ced21e4c90f17777c953193a6d412c1b4390242b..422430e87babd8bb5a1fee1f770b77e6f662959c 100644 (file)
@@ -192,17 +192,17 @@ private:
 
        Thread * action_select_next_thread(const ModelAction *curr) const;
 
-       /* thrd_func_list stores a list of function ids for each thread. 
+       /* thrd_func_list stores a list of function ids for each thread.
         * Each element in thrd_func_list stores the functions that
-        * thread i has entered and yet to exit from 
+        * thread i has entered and yet to exit from
         *
         * This data structure is handled by ModelHistory
         */
        SnapVector< func_id_list_t * > thrd_func_list;
 
        /* Keeps track of atomic actions that thread i has performed in some
-        * function. Index of SnapVector is thread id. SnapList simulates 
-        * the call stack. 
+        * function. Index of SnapVector is thread id. SnapList simulates
+        * the call stack.
         *
         * This data structure is handled by ModelHistory
         */
index 61e3d92290c34b354cb16ccf15c6f26ca9e251cd..7e0446ffec149e9c778345c6ca2790ca48916cec 100644 (file)
@@ -12,7 +12,7 @@ FuncInst::FuncInst(ModelAction *act, FuncNode *func_node) :
 }
 
 /* @param other Preceding FuncInst in the same execution trace
- * Add other to predecessors if it has been added 
+ * Add other to predecessors if it has been added
  *
  * @return false: other is already in predecessors
  *         true : other is added to precedessors
@@ -20,7 +20,7 @@ FuncInst::FuncInst(ModelAction *act, FuncNode *func_node) :
 bool FuncInst::add_pred(FuncInst * other)
 {
        func_inst_list_mt::iterator it;
-       for (it = predecessors.begin(); it != predecessors.end(); it++) {
+       for (it = predecessors.begin();it != predecessors.end();it++) {
                FuncInst * inst = *it;
                if (inst == other)
                        return false;
@@ -33,7 +33,7 @@ bool FuncInst::add_pred(FuncInst * other)
 bool FuncInst::add_succ(FuncInst * other)
 {
        func_inst_list_mt::iterator it;
-       for (it = successors.begin(); it != successors.end(); it++) {
+       for (it = successors.begin();it != successors.end();it++) {
                FuncInst * inst = *it;
                if ( inst == other )
                        return false;
@@ -48,7 +48,7 @@ FuncInst * FuncInst::search_in_collision(ModelAction *act)
        action_type type = act->get_type();
 
        func_inst_list_mt::iterator it;
-       for (it = collisions.begin(); it != collisions.end(); it++) {
+       for (it = collisions.begin();it != collisions.end();it++) {
                FuncInst * inst = *it;
                if ( inst->get_type() == type )
                        return inst;
index ce91815f7c8ac2ff860f22287a5e8b649465ce31..12bf530661322fc26a3a0a06fe1039a1037d3897 100644 (file)
@@ -6,7 +6,7 @@ FuncNode::FuncNode() :
        entry_insts()
 {}
 
-/* Check whether FuncInst with the same type, position, and location 
+/* Check whether FuncInst with the same type, position, and location
  * as act has been added to func_inst_map or not. If so, return it;
  * if not, add it and return it.
  *
@@ -38,7 +38,7 @@ FuncInst * FuncNode::get_or_add_action(ModelAction *act)
 
                        func_inst = new FuncInst(act, this);
                        inst->get_collisions()->push_back(func_inst);
-                       inst_list.push_back(func_inst);         // delete?
+                       inst_list.push_back(func_inst); // delete?
                        if (func_inst->is_read())
                                group_reads_by_loc(func_inst);
 
@@ -64,7 +64,7 @@ void FuncNode::add_entry_inst(FuncInst * inst)
                return;
 
        func_inst_list_mt::iterator it;
-       for (it = entry_insts.begin(); it != entry_insts.end(); it++) {
+       for (it = entry_insts.begin();it != entry_insts.end();it++) {
                if (inst == *it)
                        return;
        }
@@ -91,7 +91,7 @@ void FuncNode::group_reads_by_loc(FuncInst * inst)
 
        reads = reads_by_loc.get(location);
        func_inst_list_mt::iterator it;
-       for (it = reads->begin(); it != reads->end(); it++) {
+       for (it = reads->begin();it != reads->end();it++) {
                if (inst == *it)
                        return;
        }
index 51f19f0cce65812a9771c60e796093357e024911..c8c76ba7f8695bdf084e0c189aae910924e8e271 100644 (file)
@@ -30,7 +30,7 @@ private:
        uint32_t func_id;
        const char * func_name;
 
-       /* Use source line number as the key of hashtable, to check if 
+       /* 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
index 11685d3826e0c117d724cb60e877f1925402f530..677b4afd9fe29740aacd604566d8811da833d06f 100644 (file)
--- a/futex.cc
+++ b/futex.cc
@@ -63,7 +63,7 @@ namespace std _GLIBCXX_VISIBILITY(default)
                cdsc::condition_variable *v = execution->getCondMap()->get( (pthread_cond_t *) __addr);
 
                if (v == NULL)
-                       return;         // do nothing
+                       return;// do nothing
 
                v->notify_all();
        }
index 16744bb45f39e89a165bf12a804c96cad466123b..f71203887a6c871fbae10c272d4915b488680f38 100644 (file)
@@ -81,7 +81,7 @@ public:
                capacitymask = initialcapacity - 1;
 
                threshold = (unsigned int)(initialcapacity * loadfactor);
-               size = 0;                                                       // Initial number of elements in the hash
+               size = 0;       // Initial number of elements in the hash
        }
 
        /** @brief Hash table destructor */
@@ -327,7 +327,7 @@ public:
                        exit(EXIT_FAILURE);
                }
 
-               table = newtable;                                                                                       // Update the global hashtable upon resize()
+               table = newtable;       // Update the global hashtable upon resize()
                capacity = newsize;
                capacitymask = newsize - 1;
 
@@ -353,7 +353,7 @@ public:
                        search->val = bin->val;
                }
 
-               _free(oldtable);                                                                                                // Free the memory of the old hash table
+               _free(oldtable);        // Free the memory of the old hash table
        }
        double getLoadFactor() {return loadfactor;}
        unsigned int getCapacity() {return capacity;}
@@ -367,4 +367,4 @@ private:
        double loadfactor;
 };
 
-#endif/* __HASHTABLE_H__ */
+#endif /* __HASHTABLE_H__ */
index caf86cedb46a46b2d72cc542c2598057d0b98fa2..cdb642fd3fefd50a8a121a6400ce5f53279b20fd 100644 (file)
@@ -10,7 +10,7 @@
 
 /** @brief Constructor */
 ModelHistory::ModelHistory() :
-       func_counter(0), /* function id starts with 0 */
+       func_counter(0),        /* function id starts with 0 */
        func_map(),
        func_map_rev(),
        func_atomics()
@@ -22,7 +22,7 @@ void ModelHistory::enter_function(const uint32_t func_id, thread_id_t tid)
        uint32_t id = id_to_int(tid);
        SnapVector<func_id_list_t *> * thrd_func_list = model->get_execution()->get_thrd_func_list();
        SnapVector< SnapList<func_inst_list_t *> *> *
-                       thrd_func_inst_lists = model->get_execution()->get_thrd_func_inst_lists();
+               thrd_func_inst_lists = model->get_execution()->get_thrd_func_inst_lists();
 
        if ( thrd_func_list->size() <= id ) {
                thrd_func_list->resize( id + 1 );
@@ -52,7 +52,7 @@ void ModelHistory::exit_function(const uint32_t func_id, thread_id_t tid)
        uint32_t id = id_to_int(tid);
        SnapVector<func_id_list_t *> * thrd_func_list = model->get_execution()->get_thrd_func_list();
        SnapVector< SnapList<func_inst_list_t *> *> *
-                       thrd_func_inst_lists = model->get_execution()->get_thrd_func_inst_lists();
+               thrd_func_inst_lists = model->get_execution()->get_thrd_func_inst_lists();
 
        func_id_list_t * func_list = thrd_func_list->at(id);
        SnapList<func_inst_list_t *> * func_inst_lists = thrd_func_inst_lists->at(id);
@@ -79,7 +79,7 @@ void ModelHistory::add_func_atomic(ModelAction *act, thread_id_t tid)
           from all functions */
        SnapVector<func_id_list_t *> * thrd_func_list = model->get_execution()->get_thrd_func_list();
        SnapVector< SnapList<func_inst_list_t *> *> *
-                       thrd_func_inst_lists = model->get_execution()->get_thrd_func_inst_lists();
+               thrd_func_inst_lists = model->get_execution()->get_thrd_func_inst_lists();
 
        uint32_t id = id_to_int(tid);
        if ( thrd_func_list->size() <= id )
@@ -149,7 +149,7 @@ void ModelHistory::link_insts(func_inst_list_t * inst_list)
 
 void ModelHistory::print()
 {
-       for (uint32_t i = 0; i < func_atomics.size(); i++ ) {
+       for (uint32_t i = 0;i < func_atomics.size();i++ ) {
                FuncNode * funcNode = func_atomics[i];
                if (funcNode == NULL)
                        continue;
@@ -158,20 +158,20 @@ void ModelHistory::print()
 
                model_print("function %s has entry actions\n", funcNode->get_func_name());
                func_inst_list_mt::iterator it;
-               for (it = entry_insts->begin(); it != entry_insts->end(); it++) {
+               for (it = entry_insts->begin();it != entry_insts->end();it++) {
                        FuncInst *inst = *it;
                        model_print("type: %d, at: %s\n", inst->get_type(), inst->get_position());
                }
 
 /*
-               func_inst_list_mt * inst_list = funcNode->get_inst_list();
-
-               model_print("function %s has following actions\n", funcNode->get_func_name());
-               func_inst_list_mt::iterator it;
-               for (it = inst_list->begin(); it != inst_list->end(); it++) {
-                       FuncInst *inst = *it;
-                       model_print("type: %d, at: %s\n", inst->get_type(), inst->get_position());
-               }
-*/
+                func_inst_list_mt * inst_list = funcNode->get_inst_list();
+
+                model_print("function %s has following actions\n", funcNode->get_func_name());
+                func_inst_list_mt::iterator it;
+                for (it = inst_list->begin(); it != inst_list->end(); it++) {
+                        FuncInst *inst = *it;
+                        model_print("type: %d, at: %s\n", inst->get_type(), inst->get_position());
+                }
+ */
        }
 }
index b6707f9fe6d2cd9f2343ae820080fe53f63eda79..92f451519bb93e18d1b41fbfd248ce6efbefe77c 100644 (file)
--- a/history.h
+++ b/history.h
@@ -28,9 +28,9 @@ 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_atomics;