spirv-reduce: Remove redundant r-value references (#4232)

This commit is contained in:
Alastair Donaldson 2021-04-09 13:55:51 +01:00 committed by GitHub
parent 212895d4c2
commit 8da800c4cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View File

@ -54,10 +54,10 @@ void Reducer::SetInterestingnessFunction(
}
Reducer::ReductionResultStatus Reducer::Run(
std::vector<uint32_t>&& binary_in, std::vector<uint32_t>* binary_out,
const std::vector<uint32_t>& binary_in, std::vector<uint32_t>* binary_out,
spv_const_reducer_options options,
spv_validator_options validator_options) {
std::vector<uint32_t> current_binary(std::move(binary_in));
std::vector<uint32_t> current_binary(binary_in);
spvtools::SpirvTools tools(target_env_);
assert(tools.IsValid() && "Failed to create SPIRV-Tools interface");
@ -138,13 +138,13 @@ void Reducer::AddDefaultReductionPasses() {
}
void Reducer::AddReductionPass(
std::unique_ptr<ReductionOpportunityFinder>&& finder) {
std::unique_ptr<ReductionOpportunityFinder> finder) {
passes_.push_back(
spvtools::MakeUnique<ReductionPass>(target_env_, std::move(finder)));
}
}
void Reducer::AddCleanupReductionPass(
std::unique_ptr<ReductionOpportunityFinder>&& finder) {
std::unique_ptr<ReductionOpportunityFinder> finder) {
cleanup_passes_.push_back(
spvtools::MakeUnique<ReductionPass>(target_env_, std::move(finder)));
}

View File

@ -84,17 +84,17 @@ class Reducer {
// Adds a reduction pass based on the given finder to the sequence of passes
// that will be iterated over.
void AddReductionPass(std::unique_ptr<ReductionOpportunityFinder>&& finder);
void AddReductionPass(std::unique_ptr<ReductionOpportunityFinder> finder);
// Adds a cleanup reduction pass based on the given finder to the sequence of
// passes that will run after other passes.
void AddCleanupReductionPass(
std::unique_ptr<ReductionOpportunityFinder>&& finder);
std::unique_ptr<ReductionOpportunityFinder> finder);
// Reduces the given SPIR-V module |binary_out|.
// The reduced binary ends up in |binary_out|.
// A status is returned.
ReductionResultStatus Run(std::vector<uint32_t>&& binary_in,
ReductionResultStatus Run(const std::vector<uint32_t>& binary_in,
std::vector<uint32_t>* binary_out,
spv_const_reducer_options options,
spv_validator_options validator_options);