[Mesa-dev] [PATCH 2/4] nir: Silence unused "options" warning in algebraic passes.

Dylan Baker baker.dylan.c at gmail.com
Fri Apr 8 18:18:46 UTC 2016


Quoting Eduardo Lima Mitev (2016-04-08 08:26:22)
> On 04/08/2016 01:35 AM, Kenneth Graunke wrote:
> > Some passes may not refer to options->..., at which point the compiler
> > will warn about an unused variable.  Just cast to void unconditionally
> > to shut it up.
> >
> > Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> > ---
> >   src/compiler/nir/nir_algebraic.py | 1 +
> >   1 file changed, 1 insertion(+)
> >
> > diff --git a/src/compiler/nir/nir_algebraic.py b/src/compiler/nir/nir_algebraic.py
> > index d05564f..53a7907 100644
> > --- a/src/compiler/nir/nir_algebraic.py
> > +++ b/src/compiler/nir/nir_algebraic.py
> > @@ -291,6 +291,7 @@ ${pass_name}(nir_shader *shader)
> >      bool progress = false;
> >      bool condition_flags[${len(condition_list)}];
> >      const nir_shader_compiler_options *options = shader->options;
> > +   (void) options;
> >
> 
> Hmm, don't like this very much. I suppose since it is generated code, it 
> can not be done per block where options is unused.
> For respect to other people's right to have clean build logs, patch is:
> 
> Reviewed-by: Eduardo Lima Mitev <elima at igalia.com>
> 
> >      % for index, condition in enumerate(condition_list):
> >      condition_flags[${index}] = ${condition};
> >
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev

I'm not familiar with the code, but looking at it options must be used
in the condition_list argument?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: signature
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160408/c775d09f/attachment.sig>


More information about the mesa-dev mailing list