glsl2: Move constant_expression_value method to ir_rvalue.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 12 Jul 2010 20:55:10 +0000 (13:55 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Wed, 21 Jul 2010 00:10:05 +0000 (17:10 -0700)
This prevents top-level callers from asking for the value of something
that is guaranteed not to have one.

src/glsl/ir.h
src/glsl/ir_constant_expression.cpp

index 1d667be89c08a41aeeef821491427fd5f433e845..b6cd1bae31cacf390d47451118b9a8d211ad8622 100644 (file)
@@ -71,8 +71,6 @@ public:
    enum ir_node_type ir_type;
    const struct glsl_type *type;
 
-   class ir_constant *constant_expression_value();
-
    /** ir_print_visitor helper for debugging. */
    void print(void) const;
 
@@ -114,6 +112,8 @@ protected:
 
 class ir_rvalue : public ir_instruction {
 public:
+   class ir_constant *constant_expression_value();
+
    virtual ir_rvalue *clone(struct hash_table *) const = 0;
 
    virtual ir_rvalue * as_rvalue()
index ca834978f471bfd6287618640fea2b4a93b57828..44f4a642099ce0cf7c02ab4e3c28d806332e998d 100644 (file)
@@ -96,7 +96,7 @@ public:
 
 
 ir_constant *
-ir_instruction::constant_expression_value()
+ir_rvalue::constant_expression_value()
 {
    ir_constant_visitor visitor;