From 2fb6087b4a961be34e5bc69e1eee770b0f7439a8 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Tue, 16 Jul 2019 10:26:13 -0700 Subject: [PATCH] run tabbing pass --- cmodelint.cc | 10 +++++----- datarace.cc | 2 +- execution.cc | 2 +- execution.h | 8 ++++---- funcinst.cc | 8 ++++---- funcnode.cc | 8 ++++---- funcnode.h | 2 +- futex.cc | 2 +- hashtable.h | 8 ++++---- history.cc | 30 +++++++++++++++--------------- history.h | 4 ++-- 11 files changed, 42 insertions(+), 42 deletions(-) diff --git a/cmodelint.cc b/cmodelint.cc index 82bf974f..3d55f24d 100644 --- a/cmodelint.cc +++ b/cmodelint.cc @@ -376,8 +376,8 @@ void cds_func_entry(const char * funcName) { // add func id to reverse func map ModelVector * 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; diff --git a/datarace.cc b/datarace.cc index 22e473f5..fcc4b08c 100644 --- a/datarace.cc +++ b/datarace.cc @@ -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]; } diff --git a/execution.cc b/execution.cc index c5c40a91..e162a4a1 100644 --- a/execution.cc +++ b/execution.cc @@ -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() diff --git a/execution.h b/execution.h index ced21e4c..422430e8 100644 --- a/execution.h +++ b/execution.h @@ -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 */ diff --git a/funcinst.cc b/funcinst.cc index 61e3d922..7e0446ff 100644 --- a/funcinst.cc +++ b/funcinst.cc @@ -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; diff --git a/funcnode.cc b/funcnode.cc index ce91815f..12bf5306 100644 --- a/funcnode.cc +++ b/funcnode.cc @@ -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; } diff --git a/funcnode.h b/funcnode.h index 51f19f0c..c8c76ba7 100644 --- a/funcnode.h +++ b/funcnode.h @@ -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 diff --git a/futex.cc b/futex.cc index 11685d38..677b4afd 100644 --- 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(); } diff --git a/hashtable.h b/hashtable.h index 16744bb4..f7120388 100644 --- a/hashtable.h +++ b/hashtable.h @@ -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__ */ diff --git a/history.cc b/history.cc index caf86ced..cdb642fd 100644 --- a/history.cc +++ b/history.cc @@ -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 * thrd_func_list = model->get_execution()->get_thrd_func_list(); SnapVector< SnapList *> * - 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 * thrd_func_list = model->get_execution()->get_thrd_func_list(); SnapVector< SnapList *> * - 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_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 * thrd_func_list = model->get_execution()->get_thrd_func_list(); SnapVector< SnapList *> * - 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()); + } + */ } } diff --git a/history.h b/history.h index b6707f9f..92f45151 100644 --- 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 func_map; - /* map integer ids to function names */ + /* map integer ids to function names */ ModelVector func_map_rev; ModelVector func_atomics; -- 2.34.1