nir/lower_idiv: fixup for new foreach_block()
authorConnor Abbott <cwabbott0@gmail.com>
Fri, 8 Apr 2016 20:32:58 +0000 (16:32 -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_idiv.c

index 724c0c6eb3d25c614e052efcb3dbf3690d84834a..f5dafa7213793f70c7a96231476b1967dc11ca8d 100644 (file)
@@ -117,26 +117,19 @@ convert_instr(nir_builder *bld, nir_alu_instr *alu)
    nir_ssa_def_rewrite_uses(&alu->dest.dest.ssa, nir_src_for_ssa(q));
 }
 
-static bool
-convert_block(nir_block *block, void *state)
-{
-   nir_builder *b = state;
-
-   nir_foreach_instr_safe(block, instr) {
-      if (instr->type == nir_instr_type_alu)
-         convert_instr(b, nir_instr_as_alu(instr));
-   }
-
-   return true;
-}
-
 static void
 convert_impl(nir_function_impl *impl)
 {
    nir_builder b;
    nir_builder_init(&b, impl);
 
-   nir_foreach_block_call(impl, convert_block, &b);
+   nir_foreach_block(block, impl) {
+      nir_foreach_instr_safe(block, instr) {
+         if (instr->type == nir_instr_type_alu)
+            convert_instr(&b, nir_instr_as_alu(instr));
+      }
+   }
+
    nir_metadata_preserve(impl, nir_metadata_block_index |
                                nir_metadata_dominance);
 }