From aa56934e2ae75b31fbc22a5e03f95628c38f8d84 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 24 Sep 2018 06:44:38 -0700 Subject: [PATCH] spirv: Silence a bunch of unused parameter warnings MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The change to get_uniform_nir_atomic_op make it look like the other get_*_nir_atomic_op functions. The rest just add UNUSED or ASSERTED to parameters required for some of the interfaces. src/compiler/spirv/spirv_to_nir.c: In function ‘struct_member_decoration_cb’: src/compiler/spirv/spirv_to_nir.c:673:47: warning: unused parameter ‘val’ [-Wunused-parameter] struct vtn_value *val, int member, ^~~ src/compiler/spirv/spirv_to_nir.c: In function ‘struct_member_matrix_stride_cb’: src/compiler/spirv/spirv_to_nir.c:778:50: warning: unused parameter ‘val’ [-Wunused-parameter] struct vtn_value *val, int member, ^~~ src/compiler/spirv/spirv_to_nir.c: In function ‘type_decoration_cb’: src/compiler/spirv/spirv_to_nir.c:805:61: warning: unused parameter ‘ctx’ [-Wunused-parameter] const struct vtn_decoration *dec, void *ctx) ^~~ src/compiler/spirv/spirv_to_nir.c: In function ‘spec_constant_decoration_cb’: src/compiler/spirv/spirv_to_nir.c:1359:70: warning: unused parameter ‘v’ [-Wunused-parameter] spec_constant_decoration_cb(struct vtn_builder *b, struct vtn_value *v, ^ src/compiler/spirv/spirv_to_nir.c: In function ‘handle_workgroup_size_decoration_cb’: src/compiler/spirv/spirv_to_nir.c:1407:43: warning: unused parameter ‘data’ [-Wunused-parameter] void *data) ^~~~ src/compiler/spirv/spirv_to_nir.c: In function ‘vtn_handle_function_call’: src/compiler/spirv/spirv_to_nir.c:1806:55: warning: unused parameter ‘opcode’ [-Wunused-parameter] vtn_handle_function_call(struct vtn_builder *b, SpvOp opcode, ^~~~~~ src/compiler/spirv/spirv_to_nir.c:1807:54: warning: unused parameter ‘count’ [-Wunused-parameter] const uint32_t *w, unsigned count) ^~~~~ src/compiler/spirv/spirv_to_nir.c: In function ‘get_uniform_nir_atomic_op’: src/compiler/spirv/spirv_to_nir.c:2548:47: warning: unused parameter ‘b’ [-Wunused-parameter] get_uniform_nir_atomic_op(struct vtn_builder *b, SpvOp opcode) ^ src/compiler/spirv/spirv_to_nir.c: In function ‘vtn_handle_atomics’: src/compiler/spirv/spirv_to_nir.c:2633:48: warning: unused parameter ‘count’ [-Wunused-parameter] const uint32_t *w, unsigned count) ^~~~~ src/compiler/spirv/spirv_to_nir.c: In function ‘vtn_handle_barrier’: src/compiler/spirv/spirv_to_nir.c:3197:48: warning: unused parameter ‘count’ [-Wunused-parameter] const uint32_t *w, unsigned count) ^~~~~ src/compiler/spirv/spirv_to_nir.c: In function ‘vtn_handle_execution_mode’: src/compiler/spirv/spirv_to_nir.c:3618:68: warning: unused parameter ‘data’ [-Wunused-parameter] const struct vtn_decoration *mode, void *data) ^~~~ Acked-by: Caio Marcelo de Oliveira Filho Part-of: --- src/compiler/spirv/spirv_to_nir.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c index 145e0e25fbd..fc74ab661ee 100644 --- a/src/compiler/spirv/spirv_to_nir.c +++ b/src/compiler/spirv/spirv_to_nir.c @@ -746,7 +746,7 @@ array_stride_decoration_cb(struct vtn_builder *b, static void struct_member_decoration_cb(struct vtn_builder *b, - struct vtn_value *val, int member, + UNUSED struct vtn_value *val, int member, const struct vtn_decoration *dec, void *void_ctx) { struct member_decoration_ctx *ctx = void_ctx; @@ -889,7 +889,7 @@ vtn_array_type_rewrite_glsl_type(struct vtn_type *type) */ static void struct_member_matrix_stride_cb(struct vtn_builder *b, - struct vtn_value *val, int member, + UNUSED struct vtn_value *val, int member, const struct vtn_decoration *dec, void *void_ctx) { @@ -946,7 +946,7 @@ struct_block_decoration_cb(struct vtn_builder *b, static void type_decoration_cb(struct vtn_builder *b, struct vtn_value *val, int member, - const struct vtn_decoration *dec, void *ctx) + const struct vtn_decoration *dec, UNUSED void *ctx) { struct vtn_type *type = val->type; @@ -1532,9 +1532,9 @@ vtn_null_constant(struct vtn_builder *b, struct vtn_type *type) } static void -spec_constant_decoration_cb(struct vtn_builder *b, struct vtn_value *v, - int member, const struct vtn_decoration *dec, - void *data) +spec_constant_decoration_cb(struct vtn_builder *b, UNUSED struct vtn_value *val, + ASSERTED int member, + const struct vtn_decoration *dec, void *data) { vtn_assert(member == -1); if (dec->decoration != SpvDecorationSpecId) @@ -1578,9 +1578,9 @@ get_specialization64(struct vtn_builder *b, struct vtn_value *val, static void handle_workgroup_size_decoration_cb(struct vtn_builder *b, struct vtn_value *val, - int member, + ASSERTED int member, const struct vtn_decoration *dec, - void *data) + UNUSED void *data) { vtn_assert(member == -1); if (dec->decoration != SpvDecorationBuiltIn || @@ -3018,7 +3018,7 @@ get_uniform_nir_atomic_op(struct vtn_builder *b, SpvOp opcode) * only need to support GLSL Atomic Counters that are uints and don't * allow direct storage. */ - unreachable("Invalid uniform atomic"); + vtn_fail("Invalid uniform atomic"); } } @@ -3054,7 +3054,7 @@ get_deref_nir_atomic_op(struct vtn_builder *b, SpvOp opcode) */ static void vtn_handle_atomics(struct vtn_builder *b, SpvOp opcode, - const uint32_t *w, unsigned count) + const uint32_t *w, UNUSED unsigned count) { struct vtn_pointer *ptr; nir_intrinsic_instr *atomic; @@ -3632,7 +3632,7 @@ vtn_emit_memory_barrier(struct vtn_builder *b, SpvScope scope, static void vtn_handle_barrier(struct vtn_builder *b, SpvOp opcode, - const uint32_t *w, unsigned count) + const uint32_t *w, UNUSED unsigned count) { switch (opcode) { case SpvOpEmitVertex: @@ -4232,7 +4232,7 @@ vtn_handle_preamble_instruction(struct vtn_builder *b, SpvOp opcode, static void vtn_handle_execution_mode(struct vtn_builder *b, struct vtn_value *entry_point, - const struct vtn_decoration *mode, void *data) + const struct vtn_decoration *mode, UNUSED void *data) { vtn_assert(b->entry_point == entry_point); -- 2.30.2