diff options
author | Kenneth Graunke <kenneth@whitecape.org> | 2011-09-22 15:04:56 -0700 |
---|---|---|
committer | Kenneth Graunke <kenneth@whitecape.org> | 2012-04-02 14:15:34 -0700 |
commit | 807e967c615dc80a264af5a89af7649f95481744 (patch) | |
tree | bc95060bdeba0fac02a0183f3b21f9e0119389b9 /src/glsl/ir_hierarchical_visitor.h | |
parent | ac0f8bae8d39ca9f5e873ba8411472e2962890cd (diff) | |
download | external_mesa3d-807e967c615dc80a264af5a89af7649f95481744.zip external_mesa3d-807e967c615dc80a264af5a89af7649f95481744.tar.gz external_mesa3d-807e967c615dc80a264af5a89af7649f95481744.tar.bz2 |
glsl: Use ir_rvalue to represent generic error_type values.
Currently, ir_call can be used as either a statement (for void
functions) or a value (for non-void functions). This is rather awkward,
as it's the only class that can be used in both forms.
A number of places use ir_call::get_error_instruction() to construct a
generic value of error_type. If ir_call is to become a statement, it
can no longer serve this purpose.
Unfortunately, none of our classes are particularly well suited for
this, and creating a new one would be rather aggrandizing. So, this
patch introduces ir_rvalue::error_value(), a static method that creates
an instance of the base class, ir_rvalue. This has the nice property
that you can't accidentally try and access uninitialized fields (as it
doesn't have any). The downside is that the base class is no longer
abstract.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Diffstat (limited to 'src/glsl/ir_hierarchical_visitor.h')
-rw-r--r-- | src/glsl/ir_hierarchical_visitor.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/glsl/ir_hierarchical_visitor.h b/src/glsl/ir_hierarchical_visitor.h index bba046d..143eb7c 100644 --- a/src/glsl/ir_hierarchical_visitor.h +++ b/src/glsl/ir_hierarchical_visitor.h @@ -82,6 +82,7 @@ public: * \name Visit methods for leaf-node classes */ /*@{*/ + virtual ir_visitor_status visit(class ir_rvalue *); virtual ir_visitor_status visit(class ir_variable *); virtual ir_visitor_status visit(class ir_constant *); virtual ir_visitor_status visit(class ir_loop_jump *); |