glsl: Make ir_rvalue_visitor visit ir_discard::condition.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 24 Feb 2015 06:00:34 +0000 (22:00 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 24 Feb 2015 23:24:52 +0000 (15:24 -0800)
This was forgotten.

I omitted the NULL check since we don't check ir_assignment::condition
either.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/glsl/ir_rvalue_visitor.cpp
src/glsl/ir_rvalue_visitor.h

index 34cdb1c98a02c401ab448610c0f4eab0947b6cfd..2eee3da7b22ccc39bc76b4d7368002f9adb5bd74 100644 (file)
@@ -134,6 +134,13 @@ ir_rvalue_base_visitor::rvalue_visit(ir_call *ir)
    return visit_continue;
 }
 
+ir_visitor_status
+ir_rvalue_base_visitor::rvalue_visit(ir_discard *ir)
+{
+   handle_rvalue(&ir->condition);
+   return visit_continue;
+}
+
 ir_visitor_status
 ir_rvalue_base_visitor::rvalue_visit(ir_return *ir)
 {
@@ -204,6 +211,12 @@ ir_rvalue_visitor::visit_leave(ir_call *ir)
    return rvalue_visit(ir);
 }
 
+ir_visitor_status
+ir_rvalue_visitor::visit_leave(ir_discard *ir)
+{
+   return rvalue_visit(ir);
+}
+
 ir_visitor_status
 ir_rvalue_visitor::visit_leave(ir_return *ir)
 {
@@ -270,6 +283,12 @@ ir_rvalue_enter_visitor::visit_enter(ir_call *ir)
    return rvalue_visit(ir);
 }
 
+ir_visitor_status
+ir_rvalue_enter_visitor::visit_enter(ir_discard *ir)
+{
+   return rvalue_visit(ir);
+}
+
 ir_visitor_status
 ir_rvalue_enter_visitor::visit_enter(ir_return *ir)
 {
index 04ec0fa398ce37c28e699f1959dd2a69bb1aa305..185c72a5ba1fc4e240f277992d6928d72cdcbb8a 100644 (file)
@@ -36,6 +36,7 @@ public:
    ir_visitor_status rvalue_visit(ir_call *);
    ir_visitor_status rvalue_visit(ir_dereference_array *);
    ir_visitor_status rvalue_visit(ir_dereference_record *);
+   ir_visitor_status rvalue_visit(ir_discard *);
    ir_visitor_status rvalue_visit(ir_expression *);
    ir_visitor_status rvalue_visit(ir_if *);
    ir_visitor_status rvalue_visit(ir_return *);
@@ -54,6 +55,7 @@ public:
    virtual ir_visitor_status visit_leave(ir_call *);
    virtual ir_visitor_status visit_leave(ir_dereference_array *);
    virtual ir_visitor_status visit_leave(ir_dereference_record *);
+   virtual ir_visitor_status visit_leave(ir_discard *);
    virtual ir_visitor_status visit_leave(ir_expression *);
    virtual ir_visitor_status visit_leave(ir_if *);
    virtual ir_visitor_status visit_leave(ir_return *);
@@ -70,6 +72,7 @@ public:
    virtual ir_visitor_status visit_enter(ir_call *);
    virtual ir_visitor_status visit_enter(ir_dereference_array *);
    virtual ir_visitor_status visit_enter(ir_dereference_record *);
+   virtual ir_visitor_status visit_enter(ir_discard *);
    virtual ir_visitor_status visit_enter(ir_expression *);
    virtual ir_visitor_status visit_enter(ir_if *);
    virtual ir_visitor_status visit_enter(ir_return *);