From 374ad2e2bd14b4fd0c161d41e3627793ffabe468 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Thu, 2 Jun 2016 11:13:26 -0400 Subject: [PATCH] freedreno/ir3: use nir_shader_get_entrypoint() helper Should also fix coverity warning: CID 1362454 Signed-off-by: Rob Clark --- src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c b/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c index aa2d6882a76..04c99d1db02 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c +++ b/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c @@ -2188,16 +2188,7 @@ static void emit_instructions(struct ir3_compile *ctx) { unsigned ninputs, noutputs; - nir_function_impl *fxn = NULL; - - /* Find the main function: */ - nir_foreach_function(function, ctx->s) { - compile_assert(ctx, strcmp(function->name, "main") == 0); - compile_assert(ctx, function->impl); - fxn = function->impl; - break; - } - + nir_function_impl *fxn = nir_shader_get_entrypoint(ctx->s)->impl; ninputs = (max_drvloc(&ctx->s->inputs) + 1) * 4; noutputs = (max_drvloc(&ctx->s->outputs) + 1) * 4; -- 2.30.2