blob: 9b48cdcd096568b472c853765873a770bb7b8dcb [file] [log] [blame]
From 4fffcd275b50d08b54b0411679ead98970651bad Mon Sep 17 00:00:00 2001
From: David Neto <dneto@google.com>
Date: Fri, 27 Dec 2019 12:05:58 -0500
Subject: [PATCH] Avoid pessimizing std::move (#3124)
Should fix a warning
Upstream-Status: Backport [https://github.com/KhronosGroup/SPIRV-Tools/commit/8aa423930db37e37086665efcc55944d577c06e5]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
test/opt/pass_fixture.h | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/test/opt/pass_fixture.h b/test/opt/pass_fixture.h
index 53fb206f..64c089d8 100644
--- a/test/opt/pass_fixture.h
+++ b/test/opt/pass_fixture.h
@@ -60,8 +60,7 @@ class PassTest : public TestT {
// from pass Process() function.
std::tuple<std::vector<uint32_t>, Pass::Status> OptimizeToBinary(
Pass* pass, const std::string& original, bool skip_nop) {
- context_ =
- std::move(BuildModule(env_, consumer_, original, assemble_options_));
+ context_ = BuildModule(env_, consumer_, original, assemble_options_);
EXPECT_NE(nullptr, context()) << "Assembling failed for shader:\n"
<< original << std::endl;
if (!context()) {
@@ -197,8 +196,7 @@ class PassTest : public TestT {
// messages.
template <typename PassT, typename... Args>
void SinglePassRunAndFail(const std::string& original, Args&&... args) {
- context_ =
- std::move(BuildModule(env_, consumer_, original, assemble_options_));
+ context_ = BuildModule(env_, consumer_, original, assemble_options_);
EXPECT_NE(nullptr, context()) << "Assembling failed for shader:\n"
<< original << std::endl;
std::ostringstream errs;
@@ -235,8 +233,7 @@ class PassTest : public TestT {
void RunAndCheck(const std::string& original, const std::string& expected) {
assert(manager_->NumPasses());
- context_ =
- std::move(BuildModule(env_, nullptr, original, assemble_options_));
+ context_ = BuildModule(env_, nullptr, original, assemble_options_);
ASSERT_NE(nullptr, context());
context()->set_preserve_bindings(OptimizerOptions()->preserve_bindings_);
--
2.24.1