aboutsummaryrefslogtreecommitdiffstats
path: root/src/glsl/ir.h
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2011-09-20 17:58:45 -0700
committerKenneth Graunke <[email protected]>2012-04-02 14:15:46 -0700
commitf75c2d53146ea14f8dfedcc5b7a4704278ba0792 (patch)
tree512d5cda78998a6b5b80d3f6ec90ba92dcb47b8c /src/glsl/ir.h
parent82065fa20ee3f2880a070f1f4f75509b910cedde (diff)
glsl: Demote 'type' from ir_instruction to ir_rvalue and ir_variable.
Variables have types, expression trees have types, but statements don't. Rather than have a nonsensical field that stays NULL in the base class, just move it to where it makes sense. Fix up a few places that lazily used ir_instruction even though they actually knew the particular subclass. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/glsl/ir.h')
-rw-r--r--src/glsl/ir.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/glsl/ir.h b/src/glsl/ir.h
index 6adfaa38e06..b1ae6db7416 100644
--- a/src/glsl/ir.h
+++ b/src/glsl/ir.h
@@ -88,7 +88,6 @@ enum ir_node_type {
class ir_instruction : public exec_node {
public:
enum ir_node_type ir_type;
- const struct glsl_type *type;
/** ir_print_visitor helper for debugging. */
void print(void) const;
@@ -127,7 +126,6 @@ protected:
ir_instruction()
{
ir_type = ir_type_unset;
- type = NULL;
}
};
@@ -137,6 +135,8 @@ protected:
*/
class ir_rvalue : public ir_instruction {
public:
+ const struct glsl_type *type;
+
virtual ir_rvalue *clone(void *mem_ctx, struct hash_table *) const;
virtual void accept(ir_visitor *v)
@@ -321,6 +321,11 @@ public:
glsl_interp_qualifier determine_interpolation_mode(bool flat_shade);
/**
+ * Declared type of the variable
+ */
+ const struct glsl_type *type;
+
+ /**
* Delcared name of the variable
*/
const char *name;