From: Gabriel Corona Date: Tue, 29 Mar 2016 12:53:05 +0000 (+0200) Subject: [mc] -Wredundant-move X-Git-Tag: v3_13~232^2~1 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/126597feb03d318d3d70a351ae0adff9bab8f59c [mc] -Wredundant-move --- diff --git a/src/mc/CommunicationDeterminismChecker.cpp b/src/mc/CommunicationDeterminismChecker.cpp index 93be2c040f..b30b312d48 100644 --- a/src/mc/CommunicationDeterminismChecker.cpp +++ b/src/mc/CommunicationDeterminismChecker.cpp @@ -329,7 +329,7 @@ RecordTrace CommunicationDeterminismChecker::getRecordTrace() // override res.push_back(RecordTraceElement(pid, value)); } - return std::move(res); + return res; } // TODO, deduplicate with SafetyChecker @@ -348,7 +348,7 @@ std::vector CommunicationDeterminismChecker::getTextualTrace() // o xbt_free(req_str); } } - return std::move(res); + return res; } void CommunicationDeterminismChecker::prepare() diff --git a/src/mc/LivenessChecker.cpp b/src/mc/LivenessChecker.cpp index c9be6e953c..dd526a306b 100644 --- a/src/mc/LivenessChecker.cpp +++ b/src/mc/LivenessChecker.cpp @@ -145,7 +145,7 @@ simgrid::xbt::unique_ptr LivenessChecker::getPropositionValues() int res = xbt_automaton_propositional_symbol_evaluate(ps); xbt_dynar_push_as(values.get(), int, res); } - return std::move(values); + return values; } int LivenessChecker::compare(simgrid::mc::VisitedPair* state1, simgrid::mc::VisitedPair* state2) @@ -417,7 +417,7 @@ RecordTrace LivenessChecker::getRecordTrace() // override } } - return std::move(res); + return res; } void LivenessChecker::showAcceptanceCycle(std::size_t depth) @@ -447,7 +447,7 @@ std::vector LivenessChecker::getTextualTrace() // override xbt_free(req_str); } } - return std::move(trace); + return trace; } int LivenessChecker::main(void) diff --git a/src/mc/LocationList.cpp b/src/mc/LocationList.cpp index 2797bc00b4..fdf5cd536c 100644 --- a/src/mc/LocationList.cpp +++ b/src/mc/LocationList.cpp @@ -112,7 +112,7 @@ LocationList location_list( locations.push_back({ DwarfExpression(ops, ops+len), range }); } - return std::move(locations); + return locations; } diff --git a/src/mc/RegionSnapshot.cpp b/src/mc/RegionSnapshot.cpp index fc74d88e8d..8fe9a9865f 100644 --- a/src/mc/RegionSnapshot.cpp +++ b/src/mc/RegionSnapshot.cpp @@ -101,7 +101,7 @@ RegionSnapshot dense_region( XBT_DEBUG("New region : type : %s, data : %p (real addr %p), size : %zu", to_cstr(region_type), region.flat_data().get(), permanent_addr, size); - return std::move(region); + return region; } /** @brief Take a snapshot of a given region @@ -155,7 +155,7 @@ RegionSnapshot sparse_region(RegionType region_type, simgrid::mc::RegionSnapshot region( region_type, start_addr, permanent_addr, size); region.page_data(std::move(page_data)); - return std::move(region); + return region; } } diff --git a/src/mc/SafetyChecker.cpp b/src/mc/SafetyChecker.cpp index 8903c2865f..9848af70fd 100644 --- a/src/mc/SafetyChecker.cpp +++ b/src/mc/SafetyChecker.cpp @@ -84,7 +84,7 @@ RecordTrace SafetyChecker::getRecordTrace() // override res.push_back(RecordTraceElement(pid, value)); } - return std::move(res); + return res; } std::vector SafetyChecker::getTextualTrace() // override @@ -102,7 +102,7 @@ std::vector SafetyChecker::getTextualTrace() // override xbt_free(req_str); } } - return std::move(trace); + return trace; } int SafetyChecker::run() diff --git a/src/mc/mc_checkpoint.cpp b/src/mc/mc_checkpoint.cpp index 7e1084b34d..3658048dc0 100644 --- a/src/mc/mc_checkpoint.cpp +++ b/src/mc/mc_checkpoint.cpp @@ -110,7 +110,7 @@ RegionSnapshot privatized_region( simgrid::mc::RegionSnapshot region = simgrid::mc::RegionSnapshot( region_type, start_addr, permanent_addr, size); region.privatized_data(std::move(data)); - return std::move(region); + return region; } #endif @@ -353,7 +353,7 @@ static std::vector get_local_variables_values( std::vector variables; for (s_mc_stack_frame_t& stack_frame : stack_frames) fill_local_variables_values(&stack_frame, stack_frame.frame, process_index, variables); - return std::move(variables); + return variables; } static std::vector unwind_stack_frames(simgrid::mc::UnwindContext* stack_context) @@ -412,7 +412,7 @@ static std::vector unwind_stack_frames(simgrid::mc::UnwindCo xbt_abort(); } - return std::move(result); + return result; }; static std::vector take_snapshot_stacks(simgrid::mc::Snapshot* snapshot) @@ -442,7 +442,7 @@ static std::vector take_snapshot_stacks(simgrid::mc::Snap snapshot->stack_sizes.push_back(stack_size); } - return std::move(res); + return res; } @@ -558,7 +558,7 @@ static std::vector get_current_fds(pid_t pid) } closedir (fd_dir); - return std::move(fds); + return fds; } std::shared_ptr take_snapshot(int num_state) diff --git a/src/mc/mc_dwarf.cpp b/src/mc/mc_dwarf.cpp index 247d3fe9d9..41161a49c0 100644 --- a/src/mc/mc_dwarf.cpp +++ b/src/mc/mc_dwarf.cpp @@ -679,7 +679,7 @@ static simgrid::mc::Type MC_dwarf_die_to_type( break; } - return std::move(type); + return type; } static void MC_dwarf_handle_type_die(simgrid::mc::ObjectInformation* info, Dwarf_Die * die, @@ -804,7 +804,7 @@ static std::unique_ptr MC_die_to_variable( variable->name = "@anonymous#" + std::to_string(mc_anonymous_variable_index++); - return std::move(variable); + return variable; } static void MC_dwarf_handle_variable_die(simgrid::mc::ObjectInformation* info, Dwarf_Die * die, @@ -1081,7 +1081,7 @@ std::string to_hex(const char* data, std::size_t count) for (int j = 0; j < 2; ++j) res[2 * i + j] = hex_byte[j]; } - return std::move(res); + return res; } /** Binary data to hexadecimal */ @@ -1113,7 +1113,7 @@ std::string find_by_build_id(std::vector id) + to_hex(id.data() + 1, id.size() - 1) + ".debug"; XBT_DEBUG("Checking debug file: %s", filename.c_str()); if (access(filename.c_str(), F_OK) == 0) - return std::move(filename); + return filename; } return std::string(); } @@ -1324,7 +1324,7 @@ std::shared_ptr createObjectInformation( for (auto& entry : result.get()->subprograms) mc_post_process_scope(result.get(), &entry.second); MC_make_functions_index(result.get()); - return std::move(result); + return result; } /*************************************************************************/ diff --git a/src/mc/mc_record.cpp b/src/mc/mc_record.cpp index 49f111f258..19e7db49ec 100644 --- a/src/mc/mc_record.cpp +++ b/src/mc/mc_record.cpp @@ -99,7 +99,7 @@ RecordTrace parseRecordTrace(const char* data) current = end + 1; } - return std::move(res); + return res; } #if HAVE_MC