[Mesa-dev] [PATCH 22/22] glsl: Simplify ir_assignment::clone

Ian Romanick idr at freedesktop.org
Thu Sep 21 14:34:35 UTC 2017


From: "\"Ian Romanick\"" <idr at freedesktop.org>

From: Ian Romanick <ian.d.romanick at intel.com>

Use the ir_assignment constructor that takes the write mask as a
parameter.  This skips some work that was done in the other constructor.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 src/compiler/glsl/ir_clone.cpp | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/compiler/glsl/ir_clone.cpp b/src/compiler/glsl/ir_clone.cpp
index e08f0c8..9cc962c 100644
--- a/src/compiler/glsl/ir_clone.cpp
+++ b/src/compiler/glsl/ir_clone.cpp
@@ -251,11 +251,9 @@ ir_texture::clone(void *mem_ctx, struct hash_table *ht) const
 ir_assignment *
 ir_assignment::clone(void *mem_ctx, struct hash_table *ht) const
 {
-   ir_assignment *cloned =
-      new(mem_ctx) ir_assignment(this->lhs->clone(mem_ctx, ht),
-                                 this->rhs->clone(mem_ctx, ht));
-   cloned->write_mask = this->write_mask;
-   return cloned;
+   return new(mem_ctx) ir_assignment(this->lhs->clone(mem_ctx, ht),
+                                     this->rhs->clone(mem_ctx, ht),
+                                     this->write_mask);
 }
 
 ir_function *
-- 
2.9.5



More information about the mesa-dev mailing list