[Mesa-dev] [PATCH 1/2] glsl: add a empty set_is_lhs on ast_node

Ian Romanick idr at freedesktop.org
Tue Apr 26 11:51:42 UTC 2016


On 04/19/2016 07:48 PM, Alejandro PiƱeiro wrote:
> Just to allow to call set_is_lhs on any ast_node without a casting. Useful
> when processing a ast_node list that we know it contain ast_expression.
> ---
> 
> Worth to note that ast_node has other dummy implementations, like
> ast_node::hir.
> 
>  src/compiler/glsl/ast.h          | 2 ++
>  src/compiler/glsl/ast_to_hir.cpp | 5 +++++
>  2 files changed, 7 insertions(+)
> 
> diff --git a/src/compiler/glsl/ast.h b/src/compiler/glsl/ast.h
> index 92aa39e..8cb3789 100644
> --- a/src/compiler/glsl/ast.h
> +++ b/src/compiler/glsl/ast.h
> @@ -126,6 +126,8 @@ public:
>  
>     exec_node link;
>  
> +   virtual void set_is_lhs(bool);
> +
>  protected:
>     /**
>      * The only constructor is protected so that only derived class objects can
> diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
> index 82eb22a..2142955 100644
> --- a/src/compiler/glsl/ast_to_hir.cpp
> +++ b/src/compiler/glsl/ast_to_hir.cpp
> @@ -1054,6 +1054,11 @@ ast_node::has_sequence_subexpression() const
>  }
>  
>  void
> +ast_node::set_is_lhs(bool new_value)

To prevent unused parameter warnings, please do this as

ast_node::set_is_lhs(bool /* new_value */)

or just leave new_value out altogether.

> +{
> +}
> +
> +void
>  ast_function_expression::hir_no_rvalue(exec_list *instructions,
>                                         struct _mesa_glsl_parse_state *state)
>  {
> 



More information about the mesa-dev mailing list