nir/phi_builder: fixup for new foreach_block()
authorConnor Abbott <cwabbott0@gmail.com>
Tue, 12 Apr 2016 18:57:35 +0000 (14: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_phi_builder.c

index 1dd9c621cba4e0581b3703323ad5bf6980823a75..dd489755d62ff572950fce6bd5ff4207eb5aa29d 100644 (file)
@@ -78,14 +78,6 @@ struct nir_phi_builder_value {
    nir_ssa_def *defs[0];
 };
 
-static bool
-fill_block_array(nir_block *block, void *void_data)
-{
-   nir_block **blocks = void_data;
-   blocks[block->index] = block;
-   return true;
-}
-
 struct nir_phi_builder *
 nir_phi_builder_create(nir_function_impl *impl)
 {
@@ -99,7 +91,9 @@ nir_phi_builder_create(nir_function_impl *impl)
 
    pb->num_blocks = impl->num_blocks;
    pb->blocks = ralloc_array(pb, nir_block *, pb->num_blocks);
-   nir_foreach_block_call(impl, fill_block_array, pb->blocks);
+   nir_foreach_block(block, impl) {
+      pb->blocks[block->index] = block;
+   }
 
    exec_list_make_empty(&pb->values);