nir/lower_locals_to_regs: fixup for new foreach_block()
authorConnor Abbott <cwabbott0@gmail.com>
Fri, 8 Apr 2016 19:56:09 +0000 (15:56 -0400)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 28 Apr 2016 22:52:17 +0000 (15:52 -0700)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/compiler/nir/nir_lower_locals_to_regs.c

index 0a4d9befd730f36c71c051a32e0c72a1f30d6316..3465d54224d7683c0d1da5ff8525fafc287fde51 100644 (file)
@@ -201,10 +201,9 @@ get_deref_reg_src(nir_deref_var *deref, nir_instr *instr,
 }
 
 static bool
-lower_locals_to_regs_block(nir_block *block, void *void_state)
+lower_locals_to_regs_block(nir_block *block,
+                           struct locals_to_regs_state *state)
 {
-   struct locals_to_regs_state *state = void_state;
-
    nir_foreach_instr_safe(block, instr) {
       if (instr->type != nir_instr_type_intrinsic)
          continue;
@@ -358,7 +357,9 @@ nir_lower_locals_to_regs_impl(nir_function_impl *impl)
 
    nir_metadata_require(impl, nir_metadata_dominance);
 
-   nir_foreach_block_call(impl, lower_locals_to_regs_block, &state);
+   nir_foreach_block(block, impl) {
+      lower_locals_to_regs_block(block, &state);
+   }
 
    nir_array_foreach(&state.derefs_array, nir_deref_var *, deref_ptr) {
       nir_deref_var *deref = *deref_ptr;