mesa: Move declarations before code.
[mesa.git] / src / glsl / lower_discard.cpp
index b95313df8c817e943a77081a80b9af783889ad63..f2757d12048829541de00406eb14677179ba48e5 100644 (file)
 #include "glsl_types.h"
 #include "ir.h"
 
+namespace {
+
 class lower_discard_visitor : public ir_hierarchical_visitor {
 public:
    lower_discard_visitor()
@@ -120,6 +122,7 @@ public:
    bool progress;
 };
 
+} /* anonymous namespace */
 
 bool
 lower_discard(exec_list *instructions)
@@ -170,7 +173,7 @@ lower_discard_visitor::visit_leave(ir_if *ir)
    if (then_discard == NULL && else_discard == NULL)
       return visit_continue;
 
-   void *mem_ctx = talloc_parent(ir);
+   void *mem_ctx = ralloc_parent(ir);
 
    ir_variable *temp = new(mem_ctx) ir_variable(glsl_type::bool_type,
                                                "discard_cond_temp",