Mesa (master): glsl: Remove unnecessary assignments to type

Ian Romanick idr at kemper.freedesktop.org
Wed Jan 10 15:21:23 UTC 2018


Module: Mesa
Branch: master
Commit: a170f279581fc0cbdd112a1e01d37e8858895bb3
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a170f279581fc0cbdd112a1e01d37e8858895bb3

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Fri Jan  5 17:50:24 2018 -0800

glsl: Remove unnecessary assignments to type

None of these are necessary because result->type is the only thing used
outside the giant switch-statement.

CID: 1230983, 1230984
Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Alejandro Piñeiro <apinheiro at igalia.com>

---

 src/compiler/glsl/ast_to_hir.cpp | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
index 7abb8199e1..41e74815f3 100644
--- a/src/compiler/glsl/ast_to_hir.cpp
+++ b/src/compiler/glsl/ast_to_hir.cpp
@@ -1589,7 +1589,6 @@ ast_expression::do_hir(exec_list *instructions,
 
       if (rhs_instructions.is_empty()) {
          result = new(ctx) ir_expression(ir_binop_logic_and, op[0], op[1]);
-         type = result->type;
       } else {
          ir_variable *const tmp = new(ctx) ir_variable(glsl_type::bool_type,
                                                        "and_tmp",
@@ -1611,7 +1610,6 @@ ast_expression::do_hir(exec_list *instructions,
          stmt->else_instructions.push_tail(else_assign);
 
          result = new(ctx) ir_dereference_variable(tmp);
-         type = tmp->type;
       }
       break;
    }
@@ -1625,7 +1623,6 @@ ast_expression::do_hir(exec_list *instructions,
 
       if (rhs_instructions.is_empty()) {
          result = new(ctx) ir_expression(ir_binop_logic_or, op[0], op[1]);
-         type = result->type;
       } else {
          ir_variable *const tmp = new(ctx) ir_variable(glsl_type::bool_type,
                                                        "or_tmp",
@@ -1647,7 +1644,6 @@ ast_expression::do_hir(exec_list *instructions,
          stmt->else_instructions.push_tail(else_assign);
 
          result = new(ctx) ir_dereference_variable(tmp);
-         type = tmp->type;
       }
       break;
    }




More information about the mesa-commit mailing list