glsl: Remove unnecessary assignments to type
authorIan Romanick <ian.d.romanick@intel.com>
Sat, 6 Jan 2018 01:50:24 +0000 (17:50 -0800)
committerIan Romanick <ian.d.romanick@intel.com>
Wed, 10 Jan 2018 15:21:11 +0000 (07:21 -0800)
None of these are necessary because result->type is the only thing used
outside the giant switch-statement.

CID: 12309831230984
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
src/compiler/glsl/ast_to_hir.cpp

index 7abb8199e1eea03a37ef32d8ee7d914acd97d120..41e74815f3184bb4ad62090605ead691254e4624 100644 (file)
@@ -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;
    }