[Mesa-dev] [PATCH 12/17] nir: Silence unused parameter warnings
Ian Romanick
idr at freedesktop.org
Wed Aug 26 10:20:01 PDT 2015
From: Ian Romanick <ian.d.romanick at intel.com>
This should remove all of the unused parameter warnings in src/glsl/nir.
These cases had the parameter removed:
nir/nir_lower_vars_to_ssa.c: In function 'get_ssa_def_for_block':
nir/nir_lower_vars_to_ssa.c:527:59: warning: unused parameter 'block' [-Wunused-parameter]
get_ssa_def_for_block(struct deref_node *node, nir_block *block,
^
nir/nir_print.c: In function 'print_deref_array':
nir/nir_print.c:278:60: warning: unused parameter 'state' [-Wunused-parameter]
print_deref_array(nir_deref_array *deref, print_var_state *state, FILE *fp)
^
nir/nir_print.c: In function 'print_deref_struct':
nir/nir_print.c:299:37: warning: unused parameter 'state' [-Wunused-parameter]
print_var_state *state, FILE *fp)
^
nir/nir_print.c: In function 'print_load_const_instr':
nir/nir_print.c:519:62: warning: unused parameter 'tabs' [-Wunused-parameter]
print_load_const_instr(nir_load_const_instr *instr, unsigned tabs, FILE *fp)
^
These cases had the parameter (void) silenced because the parameter was
necessary for an interface:
nir/glsl_to_nir.cpp:1900:32: warning: unused parameter 'ir' [-Wunused-parameter]
nir_visitor::visit(ir_barrier *ir)
^
nir/nir_lower_load_const_to_scalar.c: In function 'lower_load_const_to_scalar_block':
nir/nir_lower_load_const_to_scalar.c:80:58: warning: unused parameter 'data' [-Wunused-parameter]
lower_load_const_to_scalar_block(nir_block *block, void *data)
^
nir/nir_lower_to_source_mods.c: In function 'nir_lower_to_source_mods_block':
nir/nir_lower_to_source_mods.c:37:56: warning: unused parameter 'state' [-Wunused-parameter]
nir_lower_to_source_mods_block(nir_block *block, void *state)
^
Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
src/glsl/nir/glsl_to_nir.cpp | 2 +-
src/glsl/nir/nir_lower_load_const_to_scalar.c | 2 ++
src/glsl/nir/nir_lower_to_source_mods.c | 2 ++
src/glsl/nir/nir_lower_vars_to_ssa.c | 6 +++---
src/glsl/nir/nir_print.c | 12 ++++++------
5 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/src/glsl/nir/glsl_to_nir.cpp b/src/glsl/nir/glsl_to_nir.cpp
index 77327b6..c9130b2 100644
--- a/src/glsl/nir/glsl_to_nir.cpp
+++ b/src/glsl/nir/glsl_to_nir.cpp
@@ -1897,7 +1897,7 @@ nir_visitor::visit(ir_dereference_array *ir)
}
void
-nir_visitor::visit(ir_barrier *ir)
+nir_visitor::visit(ir_barrier *)
{
nir_intrinsic_instr *instr =
nir_intrinsic_instr_create(this->shader, nir_intrinsic_barrier);
diff --git a/src/glsl/nir/nir_lower_load_const_to_scalar.c b/src/glsl/nir/nir_lower_load_const_to_scalar.c
index a90e524..d5af3a5 100644
--- a/src/glsl/nir/nir_lower_load_const_to_scalar.c
+++ b/src/glsl/nir/nir_lower_load_const_to_scalar.c
@@ -79,6 +79,8 @@ lower_load_const_instr_scalar(nir_load_const_instr *lower)
static bool
lower_load_const_to_scalar_block(nir_block *block, void *data)
{
+ (void) data;
+
nir_foreach_instr_safe(block, instr) {
if (instr->type == nir_instr_type_load_const)
lower_load_const_instr_scalar(nir_instr_as_load_const(instr));
diff --git a/src/glsl/nir/nir_lower_to_source_mods.c b/src/glsl/nir/nir_lower_to_source_mods.c
index 94c7e36..fc53d6b 100644
--- a/src/glsl/nir/nir_lower_to_source_mods.c
+++ b/src/glsl/nir/nir_lower_to_source_mods.c
@@ -36,6 +36,8 @@
static bool
nir_lower_to_source_mods_block(nir_block *block, void *state)
{
+ (void) state;
+
nir_foreach_instr(block, instr) {
if (instr->type != nir_instr_type_alu)
continue;
diff --git a/src/glsl/nir/nir_lower_vars_to_ssa.c b/src/glsl/nir/nir_lower_vars_to_ssa.c
index ccb8f99..9733dc5 100644
--- a/src/glsl/nir/nir_lower_vars_to_ssa.c
+++ b/src/glsl/nir/nir_lower_vars_to_ssa.c
@@ -524,7 +524,7 @@ def_stack_pop_if_in_block(struct deref_node *node, nir_block *block)
* initializer (if it exists) or an SSA undef.
*/
static nir_ssa_def *
-get_ssa_def_for_block(struct deref_node *node, nir_block *block,
+get_ssa_def_for_block(struct deref_node *node,
struct lower_variables_state *state)
{
/* If we have something on the stack, go ahead and return it. We're
@@ -569,7 +569,7 @@ add_phi_sources(nir_block *block, nir_block *pred,
src->pred = pred;
src->src.parent_instr = &phi->instr;
src->src.is_ssa = true;
- src->src.ssa = get_ssa_def_for_block(node, pred, state);
+ src->src.ssa = get_ssa_def_for_block(node, state);
list_addtail(&src->src.use_link, &src->src.ssa->uses);
@@ -636,7 +636,7 @@ rename_variables_block(nir_block *block, struct lower_variables_state *state)
nir_alu_instr *mov = nir_alu_instr_create(state->shader,
nir_op_imov);
mov->src[0].src.is_ssa = true;
- mov->src[0].src.ssa = get_ssa_def_for_block(node, block, state);
+ mov->src[0].src.ssa = get_ssa_def_for_block(node, state);
for (unsigned i = intrin->num_components; i < 4; i++)
mov->src[0].swizzle[i] = 0;
diff --git a/src/glsl/nir/nir_print.c b/src/glsl/nir/nir_print.c
index f591c4b..89aa984 100644
--- a/src/glsl/nir/nir_print.c
+++ b/src/glsl/nir/nir_print.c
@@ -275,7 +275,7 @@ print_deref_var(nir_deref_var *deref, print_var_state *state, FILE *fp)
}
static void
-print_deref_array(nir_deref_array *deref, print_var_state *state, FILE *fp)
+print_deref_array(nir_deref_array *deref, FILE *fp)
{
fprintf(fp, "[");
switch (deref->deref_array_type) {
@@ -296,7 +296,7 @@ print_deref_array(nir_deref_array *deref, print_var_state *state, FILE *fp)
static void
print_deref_struct(nir_deref_struct *deref, const struct glsl_type *parent_type,
- print_var_state *state, FILE *fp)
+ FILE *fp)
{
fprintf(fp, ".%s", glsl_get_struct_elem_name(parent_type, deref->index));
}
@@ -316,13 +316,13 @@ print_deref(nir_deref_var *deref, print_var_state *state, FILE *fp)
case nir_deref_type_array:
assert(pretail != NULL);
- print_deref_array(nir_deref_as_array(tail), state, fp);
+ print_deref_array(nir_deref_as_array(tail), fp);
break;
case nir_deref_type_struct:
assert(pretail != NULL);
print_deref_struct(nir_deref_as_struct(tail),
- pretail->type, state, fp);
+ pretail->type, fp);
break;
default:
@@ -516,7 +516,7 @@ print_call_instr(nir_call_instr *instr, print_var_state *state, FILE *fp)
}
static void
-print_load_const_instr(nir_load_const_instr *instr, unsigned tabs, FILE *fp)
+print_load_const_instr(nir_load_const_instr *instr, FILE *fp)
{
print_ssa_def(&instr->def, fp);
@@ -613,7 +613,7 @@ print_instr(const nir_instr *instr, print_var_state *state, unsigned tabs, FILE
break;
case nir_instr_type_load_const:
- print_load_const_instr(nir_instr_as_load_const(instr), tabs, fp);
+ print_load_const_instr(nir_instr_as_load_const(instr), fp);
break;
case nir_instr_type_jump:
--
2.1.0
More information about the mesa-dev
mailing list