[Mesa-dev] [PATCH 3/6] spriv: Mark default cases unreachable().

Eric Engestrom eric.engestrom at imgtec.com
Wed May 25 13:10:19 UTC 2016


Typo in the commit message: s/spriv/spirv/

On Tue, May 24, 2016 at 01:23:07PM -0700, Matt Turner wrote:
> ---
>  src/compiler/spirv/vtn_alu.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/compiler/spirv/vtn_alu.c b/src/compiler/spirv/vtn_alu.c
> index 8b9a63c..5730ca4 100644
> --- a/src/compiler/spirv/vtn_alu.c
> +++ b/src/compiler/spirv/vtn_alu.c
> @@ -356,6 +356,7 @@ vtn_handle_alu(struct vtn_builder *b, SpvOp opcode,
>           case 2:  op = nir_op_bany_inequal2; break;
>           case 3:  op = nir_op_bany_inequal3; break;
>           case 4:  op = nir_op_bany_inequal4; break;
> +         default: unreachable("not reached");

I'll admit I don't know this code very well, but I'm sure one can write
a more informative message :)
"invalid number of components" for instance?

With those two and the typo fixed, the series is:
Reviewed-by: Eric Engestrom <eric.engestrom at imgtec.com>

>           }
>           val->ssa->def = nir_build_alu(&b->nb, op, src[0],
>                                         nir_imm_int(&b->nb, NIR_FALSE),
> @@ -372,6 +373,7 @@ vtn_handle_alu(struct vtn_builder *b, SpvOp opcode,
>           case 2:  op = nir_op_ball_iequal2;  break;
>           case 3:  op = nir_op_ball_iequal3;  break;
>           case 4:  op = nir_op_ball_iequal4;  break;
> +         default: unreachable("not reached");
>           }
>           val->ssa->def = nir_build_alu(&b->nb, op, src[0],
>                                         nir_imm_int(&b->nb, NIR_TRUE),
> -- 
> 2.7.3


More information about the mesa-dev mailing list