nir/lower_load_const: fixup for new foreach_block()
authorConnor Abbott <cwabbott0@gmail.com>
Fri, 8 Apr 2016 19:57:40 +0000 (15:57 -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_load_const_to_scalar.c

index 44242320b72e0a96f599949aed1e7898a09c88b9..06cdd5abd55c106740e40d215546c74114b90fdf 100644 (file)
@@ -67,21 +67,15 @@ lower_load_const_instr_scalar(nir_load_const_instr *lower)
    nir_instr_remove(&lower->instr);
 }
 
-static bool
-lower_load_const_to_scalar_block(nir_block *block, void *data)
-{
-   nir_foreach_instr_safe(block, instr) {
-      if (instr->type == nir_instr_type_load_const)
-         lower_load_const_instr_scalar(nir_instr_as_load_const(instr));
-   }
-
-   return true;
-}
-
 static void
 nir_lower_load_const_to_scalar_impl(nir_function_impl *impl)
 {
-   nir_foreach_block_call(impl, lower_load_const_to_scalar_block, NULL);
+   nir_foreach_block(block, impl) {
+      nir_foreach_instr_safe(block, instr) {
+         if (instr->type == nir_instr_type_load_const)
+            lower_load_const_instr_scalar(nir_instr_as_load_const(instr));
+      }
+   }
 }
 
 void